Commit 39d3c649 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Pass approprite task runners to AssociatedBinding::Bind via ServiceWorker

This is part of efforts to replace base::ThreadTaskRunnerHandle::Get()
and SequencedTaskRunnerHandle::Get() with other appropriate task runners
in the renderer.

Bug: 786332
Change-Id: I7df2d7a4d0154d8b563c4d0e350a78c97067093b
Reviewed-on: https://chromium-review.googlesource.com/c/1293107Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601850}
parent dc458653
...@@ -183,11 +183,15 @@ ServiceWorker::ServiceWorker(ExecutionContext* execution_context, ...@@ -183,11 +183,15 @@ ServiceWorker::ServiceWorker(ExecutionContext* execution_context,
state_(info.state), state_(info.state),
binding_(this) { binding_(this) {
DCHECK_NE(mojom::blink::kInvalidServiceWorkerVersionId, info.version_id); DCHECK_NE(mojom::blink::kInvalidServiceWorkerVersionId, info.version_id);
host_.Bind(mojom::blink::ServiceWorkerObjectHostAssociatedPtrInfo( host_.Bind(
std::move(info.host_ptr_info), mojom::blink::ServiceWorkerObjectHostAssociatedPtrInfo(
mojom::blink::ServiceWorkerObjectHost::Version_)); std::move(info.host_ptr_info),
binding_.Bind(mojom::blink::ServiceWorkerObjectAssociatedRequest( mojom::blink::ServiceWorkerObjectHost::Version_),
std::move(info.request))); execution_context->GetTaskRunner(blink::TaskType::kInternalDefault));
binding_.Bind(
mojom::blink::ServiceWorkerObjectAssociatedRequest(
std::move(info.request)),
execution_context->GetTaskRunner(blink::TaskType::kInternalDefault));
} }
ServiceWorker::~ServiceWorker() = default; ServiceWorker::~ServiceWorker() = default;
......
...@@ -151,12 +151,16 @@ void ServiceWorkerRegistration::Attach( ...@@ -151,12 +151,16 @@ void ServiceWorkerRegistration::Attach(
host_.Bind( host_.Bind(
mojom::blink::ServiceWorkerRegistrationObjectHostAssociatedPtrInfo( mojom::blink::ServiceWorkerRegistrationObjectHostAssociatedPtrInfo(
std::move(info.host_ptr_info), std::move(info.host_ptr_info),
mojom::blink::ServiceWorkerRegistrationObjectHost::Version_)); mojom::blink::ServiceWorkerRegistrationObjectHost::Version_),
GetExecutionContext()->GetTaskRunner(
blink::TaskType::kInternalDefault));
} }
// The host expects us to use |info.request| so bind to it. // The host expects us to use |info.request| so bind to it.
binding_.Close(); binding_.Close();
binding_.Bind(mojom::blink::ServiceWorkerRegistrationObjectAssociatedRequest( binding_.Bind(
std::move(info.request))); mojom::blink::ServiceWorkerRegistrationObjectAssociatedRequest(
std::move(info.request)),
GetExecutionContext()->GetTaskRunner(blink::TaskType::kInternalDefault));
update_via_cache_ = info.update_via_cache; update_via_cache_ = info.update_via_cache;
installing_ = installing_ =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment