#include "third_party/blink/renderer/modules/ml/ml.h"
#include "services/webnn/public/mojom/webnn_context_provider.mojom-blink-forward.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_context_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_device_type.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_power_preference.h"
#include "third_party/blink/renderer/modules/ml/ml_context.h"
#include "third_party/blink/renderer/modules/ml/webnn/ml_error.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
namespace blink {
namespace {
webnn::mojom::blink::CreateContextOptions::Device ConvertBlinkDeviceTypeToMojo(
const V8MLDeviceType& device_type_blink) { … }
webnn::mojom::blink::CreateContextOptions::PowerPreference
ConvertBlinkPowerPreferenceToMojo(
const V8MLPowerPreference& power_preference_blink) { … }
}
ML::ML(ExecutionContext* execution_context)
: … { … }
void ML::Trace(Visitor* visitor) const { … }
ScriptPromise<MLContext> ML::createContext(ScriptState* script_state,
MLContextOptions* options,
ExceptionState& exception_state) { … }
void ML::OnWebNNServiceConnectionError() { … }
void ML::EnsureWebNNServiceConnection() { … }
}