| Index: content/browser/service_worker/service_worker_dispatcher_host.cc
|
| diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
|
| index 2c19cabaf95d343fb674a4d76c1941bdd3ac7b8a..54cd17d581f40696af551657fc935cf21cdf8c1f 100644
|
| --- a/content/browser/service_worker/service_worker_dispatcher_host.cc
|
| +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
|
| @@ -101,7 +101,12 @@ ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost(
|
| render_process_id_(render_process_id),
|
| message_port_message_filter_(message_port_message_filter),
|
| resource_context_(resource_context),
|
| - channel_ready_(false) {
|
| + channel_ready_(false),
|
| + weak_factory_(this) {
|
| + AddAssociatedInterface(
|
| + mojom::ServiceWorkerDispatcherHost::Name_,
|
| + base::Bind(&ServiceWorkerDispatcherHost::AddMojoBinding,
|
| + base::Unretained(this)));
|
| }
|
|
|
| ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {
|
| @@ -219,6 +224,13 @@ bool ServiceWorkerDispatcherHost::OnMessageReceived(
|
| return handled;
|
| }
|
|
|
| +void ServiceWorkerDispatcherHost::AddMojoBinding(
|
| + mojo::ScopedInterfaceEndpointHandle handle) {
|
| + bindings_.AddBinding(
|
| + this, mojo::MakeAssociatedRequest<mojom::ServiceWorkerDispatcherHost>(
|
| + std::move(handle)));
|
| +}
|
| +
|
| bool ServiceWorkerDispatcherHost::Send(IPC::Message* message) {
|
| if (channel_ready_) {
|
| BrowserMessageFilter::Send(message);
|
|
|