summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/mojo
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/mojo')
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/BUILD.gn12
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo.cc36
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo.h3
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo.idl8
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo_handle.cc20
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo_handle.idl10
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo_watcher.cc10
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/mojo_watcher.h10
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.cc97
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.h27
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.idl5
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.cc4
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.h2
-rw-r--r--chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.idl2
14 files changed, 79 insertions, 167 deletions
diff --git a/chromium/third_party/blink/renderer/core/mojo/BUILD.gn b/chromium/third_party/blink/renderer/core/mojo/BUILD.gn
index eb1f27925c4..537be921093 100644
--- a/chromium/third_party/blink/renderer/core/mojo/BUILD.gn
+++ b/chromium/third_party/blink/renderer/core/mojo/BUILD.gn
@@ -28,13 +28,9 @@ blink_core_sources("mojo") {
jumbo_source_set("unit_tests") {
testonly = true
- sources = [
- "tests/js_to_cpp_test.cc",
- ]
+ sources = [ "tests/js_to_cpp_test.cc" ]
- data = [
- "tests/JsToCppTest.js",
- ]
+ data = [ "tests/JsToCppTest.js" ]
configs += [
"//third_party/blink/renderer/core:blink_core_pch",
@@ -57,7 +53,5 @@ jumbo_source_set("unit_tests") {
}
mojom("test_bindings") {
- sources = [
- "tests/js_to_cpp.mojom",
- ]
+ sources = [ "tests/js_to_cpp.mojom" ]
}
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo.cc b/chromium/third_party/blink/renderer/core/mojo/mojo.cc
index aab3fa5cd51..28de5f1938d 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo.cc
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo.cc
@@ -8,16 +8,15 @@
#include <utility>
#include "mojo/public/cpp/system/message_pipe.h"
-#include "services/service_manager/public/cpp/interface_provider.h"
-#include "third_party/blink/public/platform/interface_provider.h"
+#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/platform.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_create_data_pipe_options.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_create_data_pipe_result.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_create_message_pipe_result.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_create_shared_buffer_result.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
-#include "third_party/blink/renderer/core/mojo/mojo_create_data_pipe_options.h"
-#include "third_party/blink/renderer/core/mojo/mojo_create_data_pipe_result.h"
-#include "third_party/blink/renderer/core/mojo/mojo_create_message_pipe_result.h"
-#include "third_party/blink/renderer/core/mojo/mojo_create_shared_buffer_result.h"
#include "third_party/blink/renderer/core/mojo/mojo_handle.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/core/workers/worker_thread.h"
@@ -98,33 +97,20 @@ MojoCreateSharedBufferResult* Mojo::createSharedBuffer(unsigned num_bytes) {
void Mojo::bindInterface(ScriptState* script_state,
const String& interface_name,
MojoHandle* request_handle,
- const String& scope,
- bool use_browser_interface_broker) {
+ const String& scope) {
std::string name = interface_name.Utf8();
auto handle =
mojo::ScopedMessagePipeHandle::From(request_handle->TakeHandle());
if (scope == "process") {
- Platform::Current()->GetInterfaceProvider()->GetInterface(
- name.c_str(), std::move(handle));
+ Platform::Current()->GetBrowserInterfaceBroker()->GetInterface(
+ mojo::GenericPendingReceiver(name, std::move(handle)));
return;
}
- // This should replace InterfaceProvider usage below when all
- // InterfaceProvider clients are converted to use BrowserInterfaceBroker. See
- // crbug.com/936482.
- if (use_browser_interface_broker) {
- ExecutionContext::From(script_state)
- ->GetBrowserInterfaceBroker()
- .GetInterface(name, std::move(handle));
- return;
- }
-
- // TODO(crbug.com/995556): remove when no longer used.
- if (auto* interface_provider =
- ExecutionContext::From(script_state)->GetInterfaceProvider()) {
- interface_provider->GetInterfaceByName(name, std::move(handle));
- }
+ ExecutionContext::From(script_state)
+ ->GetBrowserInterfaceBroker()
+ .GetInterface(name, std::move(handle));
}
} // namespace blink
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo.h b/chromium/third_party/blink/renderer/core/mojo/mojo.h
index b0e8b78d35f..a81831c93b0 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo.h
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo.h
@@ -54,8 +54,7 @@ class Mojo final : public ScriptWrappable {
static void bindInterface(ScriptState*,
const String& interface_name,
MojoHandle*,
- const String& scope,
- bool use_browser_interface_broker);
+ const String& scope);
};
} // namespace blink
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo.idl b/chromium/third_party/blink/renderer/core/mojo/mojo.idl
index 9bfcfc67066..d407172039f 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo.idl
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo.idl
@@ -7,14 +7,14 @@
typedef unsigned long MojoResult;
enum MojoScope {
- // Refers to the InterfaceProvider associated with the current execution
+ // Refers to the BrowserInterfaceBroker associated with the current execution
// context. Either a Document or WorkerGlobalScope.
"context",
- // Refers to the InterfaceProvider of the current process.
+ // Refers to the BrowserInterfaceBroker of the current process.
//
// Note: A "process" is not a web concept. In some cases the browser process
// concept of a "site instance" may be useful however there is currently no
- // InterfaceProvider per site instance.
+ // BrowserInterfaceBroker per site instance.
"process",
};
@@ -46,5 +46,5 @@ enum MojoScope {
static MojoCreateDataPipeResult createDataPipe(MojoCreateDataPipeOptions options);
static MojoCreateSharedBufferResult createSharedBuffer(unsigned long numBytes);
- [CallWith=ScriptState] static void bindInterface(DOMString interfaceName, MojoHandle request_handle, optional MojoScope scope = "context", optional boolean useBrowserInterfaceBroker = false);
+ [CallWith=ScriptState] static void bindInterface(DOMString interfaceName, MojoHandle request_handle, optional MojoScope scope = "context");
};
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo_handle.cc b/chromium/third_party/blink/renderer/core/mojo/mojo_handle.cc
index a7c22b55bc0..5f1aafc57b1 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo_handle.cc
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo_handle.cc
@@ -9,18 +9,18 @@
#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "third_party/blink/renderer/bindings/core/v8/array_buffer_or_array_buffer_view.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_create_shared_buffer_result.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_discard_data_options.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_duplicate_buffer_handle_options.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_map_buffer_result.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_data_options.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_data_result.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_message_flags.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_message_result.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_write_data_options.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_write_data_result.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
-#include "third_party/blink/renderer/core/mojo/mojo_create_shared_buffer_result.h"
-#include "third_party/blink/renderer/core/mojo/mojo_discard_data_options.h"
-#include "third_party/blink/renderer/core/mojo/mojo_duplicate_buffer_handle_options.h"
-#include "third_party/blink/renderer/core/mojo/mojo_map_buffer_result.h"
-#include "third_party/blink/renderer/core/mojo/mojo_read_data_options.h"
-#include "third_party/blink/renderer/core/mojo/mojo_read_data_result.h"
-#include "third_party/blink/renderer/core/mojo/mojo_read_message_flags.h"
-#include "third_party/blink/renderer/core/mojo/mojo_read_message_result.h"
#include "third_party/blink/renderer/core/mojo/mojo_watcher.h"
-#include "third_party/blink/renderer/core/mojo/mojo_write_data_options.h"
-#include "third_party/blink/renderer/core/mojo/mojo_write_data_result.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer_view.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo_handle.idl b/chromium/third_party/blink/renderer/core/mojo/mojo_handle.idl
index 4fe2ab28ad1..428236f88a8 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo_handle.idl
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo_handle.idl
@@ -15,17 +15,17 @@ callback MojoWatchCallback = void (MojoResult result);
// TODO(alokp): Create MojoMessagePipeHandle, a subclass of MojoHandle
// and move the following member functions.
MojoResult writeMessage(BufferSource buffer, sequence<MojoHandle> handles);
- MojoReadMessageResult readMessage(optional MojoReadMessageFlags flags);
+ MojoReadMessageResult readMessage(optional MojoReadMessageFlags flags = {});
// TODO(alokp): Create MojoDataPipeProducerHandle and MojoDataPipeConsumerHandle,
// subclasses of MojoHandle and move the following member functions.
- MojoWriteDataResult writeData(BufferSource buffer, optional MojoWriteDataOptions options);
+ MojoWriteDataResult writeData(BufferSource buffer, optional MojoWriteDataOptions options = {});
MojoReadDataResult queryData();
- MojoReadDataResult discardData(unsigned long numBytes, optional MojoDiscardDataOptions options);
- MojoReadDataResult readData(BufferSource buffer, optional MojoReadDataOptions options);
+ MojoReadDataResult discardData(unsigned long numBytes, optional MojoDiscardDataOptions options = {});
+ MojoReadDataResult readData(BufferSource buffer, optional MojoReadDataOptions options = {});
// TODO(alokp): Create MojoSharedBufferHandle, a subclass of MojoHandle
// and move the following member functions.
MojoMapBufferResult mapBuffer(unsigned long offset, unsigned long numBytes);
- MojoCreateSharedBufferResult duplicateBufferHandle(optional MojoDuplicateBufferHandleOptions options);
+ MojoCreateSharedBufferResult duplicateBufferHandle(optional MojoDuplicateBufferHandleOptions options = {});
};
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.cc b/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.cc
index 3f0ec6ee1f0..b9f8e2bdcc2 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.cc
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.cc
@@ -6,9 +6,9 @@
#include "base/single_thread_task_runner.h"
#include "third_party/blink/public/platform/task_type.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_handle_signals.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_watch_callback.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
-#include "third_party/blink/renderer/core/mojo/mojo_handle_signals.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
@@ -49,23 +49,23 @@ MojoResult MojoWatcher::cancel() {
return MOJO_RESULT_OK;
}
-void MojoWatcher::Trace(blink::Visitor* visitor) {
+void MojoWatcher::Trace(Visitor* visitor) {
visitor->Trace(callback_);
ScriptWrappable::Trace(visitor);
- ContextLifecycleObserver::Trace(visitor);
+ ExecutionContextLifecycleObserver::Trace(visitor);
}
bool MojoWatcher::HasPendingActivity() const {
return handle_.is_valid();
}
-void MojoWatcher::ContextDestroyed(ExecutionContext*) {
+void MojoWatcher::ContextDestroyed() {
cancel();
}
MojoWatcher::MojoWatcher(ExecutionContext* context,
V8MojoWatchCallback* callback)
- : ContextLifecycleObserver(context),
+ : ExecutionContextLifecycleObserver(context),
task_runner_(context->GetTaskRunner(TaskType::kInternalDefault)),
callback_(callback) {}
diff --git a/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.h b/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.h
index 8fc307a6aa4..1de31f7482e 100644
--- a/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.h
+++ b/chromium/third_party/blink/renderer/core/mojo/mojo_watcher.h
@@ -8,7 +8,7 @@
#include "mojo/public/cpp/system/handle.h"
#include "mojo/public/cpp/system/trap.h"
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
-#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
@@ -19,7 +19,7 @@ class V8MojoWatchCallback;
class MojoWatcher final : public ScriptWrappable,
public ActiveScriptWrappable<MojoWatcher>,
- public ContextLifecycleObserver {
+ public ExecutionContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(MojoWatcher);
@@ -34,13 +34,13 @@ class MojoWatcher final : public ScriptWrappable,
MojoResult cancel();
- void Trace(blink::Visitor*) override;
+ void Trace(Visitor*) override;
// ActiveScriptWrappable
bool HasPendingActivity() const final;
- // ContextLifecycleObserver
- void ContextDestroyed(ExecutionContext*) final;
+ // ExecutionContextLifecycleObserver
+ void ContextDestroyed() final;
private:
friend class V8MojoWatcher;
diff --git a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.cc b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.cc
index 473044dbfb9..2251830a146 100644
--- a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.cc
+++ b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.cc
@@ -4,7 +4,6 @@
#include "third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.h"
-#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/platform.h"
@@ -29,7 +28,6 @@ MojoInterfaceInterceptor* MojoInterfaceInterceptor::Create(
ExecutionContext* context,
const String& interface_name,
const String& scope,
- bool use_browser_interface_broker,
ExceptionState& exception_state) {
bool process_scope = scope == "process";
if (process_scope && !context->IsDocument()) {
@@ -39,9 +37,8 @@ MojoInterfaceInterceptor* MojoInterfaceInterceptor::Create(
return nullptr;
}
- return MakeGarbageCollected<MojoInterfaceInterceptor>(
- context, interface_name, process_scope,
- UseBrowserInterfaceBroker(use_browser_interface_broker));
+ return MakeGarbageCollected<MojoInterfaceInterceptor>(context, interface_name,
+ process_scope);
}
MojoInterfaceInterceptor::~MojoInterfaceInterceptor() = default;
@@ -68,48 +65,21 @@ void MojoInterfaceInterceptor::start(ExceptionState& exception_state) {
return;
}
- if (use_browser_interface_broker_) {
- ExecutionContext* context = GetExecutionContext();
-
- if (!context)
- return;
-
- started_ = true;
- if (!context->GetBrowserInterfaceBroker().SetBinderForTesting(
- interface_name,
- WTF::BindRepeating(&MojoInterfaceInterceptor::OnInterfaceRequest,
- WrapWeakPersistent(this)))) {
- exception_state.ThrowDOMException(
- DOMExceptionCode::kInvalidModificationError,
- "Interface " + interface_name_ +
- " is already intercepted by another MojoInterfaceInterceptor.");
- }
- return;
- }
+ ExecutionContext* context = GetExecutionContext();
- // TODO(crbug.com/994843): remove when no longer used.
- service_manager::InterfaceProvider* interface_provider =
- GetInterfaceProvider();
- if (!interface_provider) {
- exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
- "The interface provider is unavailable.");
+ if (!context)
return;
- }
- service_manager::InterfaceProvider::TestApi test_api(interface_provider);
- if (test_api.HasBinderForName(interface_name)) {
+ started_ = true;
+ if (!context->GetBrowserInterfaceBroker().SetBinderForTesting(
+ interface_name,
+ WTF::BindRepeating(&MojoInterfaceInterceptor::OnInterfaceRequest,
+ WrapWeakPersistent(this)))) {
exception_state.ThrowDOMException(
DOMExceptionCode::kInvalidModificationError,
"Interface " + interface_name_ +
" is already intercepted by another MojoInterfaceInterceptor.");
- return;
}
-
- started_ = true;
- test_api.SetBinderForName(
- interface_name,
- WTF::BindRepeating(&MojoInterfaceInterceptor::OnInterfaceRequest,
- WrapWeakPersistent(this)));
}
void MojoInterfaceInterceptor::stop() {
@@ -125,25 +95,14 @@ void MojoInterfaceInterceptor::stop() {
return;
}
- if (use_browser_interface_broker_) {
- ExecutionContext* context = GetExecutionContext();
- DCHECK(context);
- context->GetBrowserInterfaceBroker().SetBinderForTesting(interface_name,
- {});
- return;
- }
-
- // TODO(crbug.com/994843): remove when no longer used.
- // GetInterfaceProvider() is guaranteed not to return nullptr because this
- // method is called when the context is destroyed.
- service_manager::InterfaceProvider::TestApi test_api(GetInterfaceProvider());
- DCHECK(test_api.HasBinderForName(interface_name));
- test_api.ClearBinderForName(interface_name);
+ ExecutionContext* context = GetExecutionContext();
+ DCHECK(context);
+ context->GetBrowserInterfaceBroker().SetBinderForTesting(interface_name, {});
}
-void MojoInterfaceInterceptor::Trace(blink::Visitor* visitor) {
+void MojoInterfaceInterceptor::Trace(Visitor* visitor) {
EventTargetWithInlineData::Trace(visitor);
- ContextLifecycleObserver::Trace(visitor);
+ ExecutionContextLifecycleObserver::Trace(visitor);
}
const AtomicString& MojoInterfaceInterceptor::InterfaceName() const {
@@ -151,40 +110,28 @@ const AtomicString& MojoInterfaceInterceptor::InterfaceName() const {
}
ExecutionContext* MojoInterfaceInterceptor::GetExecutionContext() const {
- return ContextLifecycleObserver::GetExecutionContext();
+ return ExecutionContextLifecycleObserver::GetExecutionContext();
}
bool MojoInterfaceInterceptor::HasPendingActivity() const {
return started_;
}
-void MojoInterfaceInterceptor::ContextDestroyed(ExecutionContext*) {
+void MojoInterfaceInterceptor::ContextDestroyed() {
stop();
}
-MojoInterfaceInterceptor::MojoInterfaceInterceptor(
- ExecutionContext* context,
- const String& interface_name,
- bool process_scope,
- UseBrowserInterfaceBroker use_browser_interface_broker)
- : ContextLifecycleObserver(context),
+MojoInterfaceInterceptor::MojoInterfaceInterceptor(ExecutionContext* context,
+ const String& interface_name,
+ bool process_scope)
+ : ExecutionContextLifecycleObserver(context),
interface_name_(interface_name),
- process_scope_(process_scope),
- use_browser_interface_broker_(use_browser_interface_broker) {}
-
-service_manager::InterfaceProvider*
-MojoInterfaceInterceptor::GetInterfaceProvider() const {
- ExecutionContext* context = GetExecutionContext();
- if (!context)
- return nullptr;
-
- return context->GetInterfaceProvider();
-}
+ process_scope_(process_scope) {}
void MojoInterfaceInterceptor::OnInterfaceRequest(
mojo::ScopedMessagePipeHandle handle) {
// Execution of JavaScript may be forbidden in this context as this method is
- // called synchronously by the InterfaceProvider. Dispatching of the
+ // called synchronously by the BrowserInterfaceBroker. Dispatching of the
// 'interfacerequest' event is therefore scheduled to take place in the next
// microtask. This also more closely mirrors the behavior when an interface
// request is being satisfied by another process.
diff --git a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.h b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.h
index 010d146b816..c45bfdcc387 100644
--- a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.h
+++ b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.h
@@ -10,14 +10,10 @@
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
#include "third_party/blink/renderer/core/dom/events/event_listener.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
-#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
-namespace service_manager {
-class InterfaceProvider;
-}
-
namespace blink {
class ExceptionState;
@@ -32,7 +28,7 @@ class ExecutionContext;
class MojoInterfaceInterceptor final
: public EventTargetWithInlineData,
public ActiveScriptWrappable<MojoInterfaceInterceptor>,
- public ContextLifecycleObserver {
+ public ExecutionContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(MojoInterfaceInterceptor);
@@ -40,16 +36,11 @@ class MojoInterfaceInterceptor final
static MojoInterfaceInterceptor* Create(ExecutionContext*,
const String& interface_name,
const String& scope,
- bool use_browser_interface_broker,
ExceptionState&);
- using UseBrowserInterfaceBroker =
- util::StrongAlias<class UseBrowserInterfaceBrokerTag, bool>;
- MojoInterfaceInterceptor(
- ExecutionContext*,
- const String& interface_name,
- bool process_scope,
- UseBrowserInterfaceBroker use_browser_interface_broker);
+ MojoInterfaceInterceptor(ExecutionContext*,
+ const String& interface_name,
+ bool process_scope);
~MojoInterfaceInterceptor() override;
void start(ExceptionState&);
@@ -57,7 +48,7 @@ class MojoInterfaceInterceptor final
DEFINE_ATTRIBUTE_EVENT_LISTENER(interfacerequest, kInterfacerequest)
- void Trace(blink::Visitor*) override;
+ void Trace(Visitor*) override;
// EventTargetWithInlineData
const AtomicString& InterfaceName() const override;
@@ -66,18 +57,16 @@ class MojoInterfaceInterceptor final
// ActiveScriptWrappable
bool HasPendingActivity() const final;
- // ContextLifecycleObserver
- void ContextDestroyed(ExecutionContext*) final;
+ // ExecutionContextLifecycleObserver
+ void ContextDestroyed() final;
private:
- service_manager::InterfaceProvider* GetInterfaceProvider() const;
void OnInterfaceRequest(mojo::ScopedMessagePipeHandle);
void DispatchInterfaceRequestEvent(mojo::ScopedMessagePipeHandle);
const String interface_name_;
bool started_ = false;
bool process_scope_ = false;
- bool use_browser_interface_broker_ = false;
};
} // namespace blink
diff --git a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.idl b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.idl
index e50fcf3aee9..075783322e9 100644
--- a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.idl
+++ b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.idl
@@ -4,13 +4,10 @@
[
ActiveScriptWrappable,
- Constructor(DOMString interfaceName, optional MojoScope scope = "context",
- optional boolean useBrowserInterfaceBroker = false),
- ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker),
- RaisesException=Constructor,
RuntimeEnabled=MojoJSTest
] interface MojoInterfaceInterceptor : EventTarget {
+ [CallWith=ExecutionContext, RaisesException] constructor(DOMString interfaceName, optional MojoScope scope = "context");
[RaisesException] void start();
void stop();
diff --git a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.cc b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.cc
index 70587940e03..1356522ce63 100644
--- a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.cc
+++ b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.cc
@@ -4,15 +4,15 @@
#include "third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_interface_request_event_init.h"
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/mojo/mojo_handle.h"
-#include "third_party/blink/renderer/core/mojo/test/mojo_interface_request_event_init.h"
namespace blink {
MojoInterfaceRequestEvent::~MojoInterfaceRequestEvent() = default;
-void MojoInterfaceRequestEvent::Trace(blink::Visitor* visitor) {
+void MojoInterfaceRequestEvent::Trace(Visitor* visitor) {
Event::Trace(visitor);
visitor->Trace(handle_);
}
diff --git a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.h b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.h
index c67cf9af86a..7427b07786d 100644
--- a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.h
+++ b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.h
@@ -39,7 +39,7 @@ class MojoInterfaceRequestEvent final : public Event {
return event_interface_names::kMojoInterfaceRequestEvent;
}
- void Trace(blink::Visitor*) override;
+ void Trace(Visitor*) override;
private:
Member<MojoHandle> handle_;
diff --git a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.idl b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.idl
index 9d96d25693f..3a0ceac0954 100644
--- a/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.idl
+++ b/chromium/third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.idl
@@ -3,9 +3,9 @@
// found in the LICENSE file.
[
- Constructor(DOMString type, optional MojoInterfaceRequestEventInit eventInitDict),
Exposed=(Window,Worker),
RuntimeEnabled=MojoJSTest
] interface MojoInterfaceRequestEvent : Event {
+ constructor(DOMString type, optional MojoInterfaceRequestEventInit eventInitDict = {});
readonly attribute MojoHandle handle;
};