Index: content/browser/service_worker/embedded_worker_instance.h |
diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h |
index 607a8c5c4f4c30e9371af11103526158cd8aa07a..412583390ff358cd97c095fd56f5f8792398de70 100644 |
--- a/content/browser/service_worker/embedded_worker_instance.h |
+++ b/content/browser/service_worker/embedded_worker_instance.h |
@@ -26,6 +26,7 @@ |
#include "content/common/service_worker/embedded_worker.mojom.h" |
#include "content/common/service_worker/service_worker_status_code.h" |
#include "content/public/common/console_message_level.h" |
+#include "mojo/public/cpp/bindings/binding.h" |
#include "url/gurl.h" |
// Windows headers will redefine SendMessage. |
@@ -53,7 +54,8 @@ class ServiceWorkerContextCore; |
// This gives an interface to control one EmbeddedWorker instance, which |
// may be 'in-waiting' or running in one of the child processes added by |
// AddProcessReference(). |
-class CONTENT_EXPORT EmbeddedWorkerInstance { |
+class CONTENT_EXPORT EmbeddedWorkerInstance |
+ : public mojom::EmbeddedWorkerInstance { |
public: |
typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; |
@@ -105,7 +107,7 @@ class CONTENT_EXPORT EmbeddedWorkerInstance { |
CONTENT_EXPORT virtual bool OnMessageReceived(const IPC::Message& message); |
}; |
- ~EmbeddedWorkerInstance(); |
+ ~EmbeddedWorkerInstance() override; |
// Starts the worker. It is invalid to call this when the worker is not in |
// STOPPED status. |callback| is invoked after the worker script has been |
@@ -140,6 +142,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance { |
shell::InterfaceRegistry* GetInterfaceRegistry(); |
shell::InterfaceProvider* GetRemoteInterfaces(); |
+ // Methods overrides mojom::EmbeddedWorkerInstance |
nhiroki
2016/09/06 01:38:05
// Overrides mojom::EmbeddedWorkerInstance
shimazu
2016/09/21 07:00:51
Done.
|
+ void AttachClientInterfaceProvider( |
+ shell::mojom::InterfaceProviderPtr client_interfaces) override; |
+ |
int embedded_worker_id() const { return embedded_worker_id_; } |
EmbeddedWorkerStatus status() const { return status_; } |
StartingPhase starting_phase() const { |
@@ -197,6 +203,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance { |
void Detach(); |
+ // Factory registered to |interface_registry_| for binding a mojo endpoint to |
+ // |binding_| |
nhiroki
2016/09/06 01:38:05
"// Binds a mojo endpoint to |binding_|." ?
('Fac
shimazu
2016/09/21 07:00:51
"Factory" is a mojo word defined here:
https://cs.
|
+ void BindMojoRequest(mojom::EmbeddedWorkerInstanceRequest request); |
+ |
base::WeakPtr<EmbeddedWorkerInstance> AsWeakPtr(); |
private: |
@@ -312,6 +322,7 @@ class CONTENT_EXPORT EmbeddedWorkerInstance { |
int thread_id_; |
std::unique_ptr<shell::InterfaceRegistry> interface_registry_; |
std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; |
+ mojo::Binding<mojom::EmbeddedWorkerInstance> binding_; |
mojom::EmbeddedWorkerInstanceClientPtr instance_client_; |
// Whether devtools is attached or not. |