Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/service_worker/service_worker_context_client.h" | 5 #include "content/renderer/service_worker/service_worker_context_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 #include "content/child/service_worker/service_worker_provider_context.h" | 24 #include "content/child/service_worker/service_worker_provider_context.h" |
| 25 #include "content/child/service_worker/service_worker_registration_handle_refere nce.h" | 25 #include "content/child/service_worker/service_worker_registration_handle_refere nce.h" |
| 26 #include "content/child/service_worker/web_service_worker_impl.h" | 26 #include "content/child/service_worker/web_service_worker_impl.h" |
| 27 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 27 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
| 28 #include "content/child/service_worker/web_service_worker_registration_impl.h" | 28 #include "content/child/service_worker/web_service_worker_registration_impl.h" |
| 29 #include "content/child/thread_safe_sender.h" | 29 #include "content/child/thread_safe_sender.h" |
| 30 #include "content/child/webmessageportchannel_impl.h" | 30 #include "content/child/webmessageportchannel_impl.h" |
| 31 #include "content/common/devtools_messages.h" | 31 #include "content/common/devtools_messages.h" |
| 32 #include "content/common/message_port_messages.h" | 32 #include "content/common/message_port_messages.h" |
| 33 #include "content/common/service_worker/embedded_worker_messages.h" | 33 #include "content/common/service_worker/embedded_worker_messages.h" |
| 34 #include "content/common/service_worker/fetch_event_dispatcher.mojom.h" | |
| 34 #include "content/common/service_worker/service_worker_messages.h" | 35 #include "content/common/service_worker/service_worker_messages.h" |
| 35 #include "content/public/common/push_event_payload.h" | 36 #include "content/public/common/push_event_payload.h" |
| 36 #include "content/public/common/referrer.h" | 37 #include "content/public/common/referrer.h" |
| 37 #include "content/public/renderer/content_renderer_client.h" | 38 #include "content/public/renderer/content_renderer_client.h" |
| 38 #include "content/public/renderer/document_state.h" | 39 #include "content/public/renderer/document_state.h" |
| 39 #include "content/renderer/background_sync/background_sync_client_impl.h" | 40 #include "content/renderer/background_sync/background_sync_client_impl.h" |
| 40 #include "content/renderer/devtools/devtools_agent.h" | 41 #include "content/renderer/devtools/devtools_agent.h" |
| 41 #include "content/renderer/render_thread_impl.h" | 42 #include "content/renderer/render_thread_impl.h" |
| 42 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 43 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
| 43 #include "content/renderer/service_worker/service_worker_type_util.h" | 44 #include "content/renderer/service_worker/service_worker_type_util.h" |
| 44 #include "ipc/ipc_message.h" | 45 #include "ipc/ipc_message.h" |
| 45 #include "ipc/ipc_message_macros.h" | 46 #include "ipc/ipc_message_macros.h" |
| 46 #include "mojo/public/cpp/bindings/interface_request.h" | 47 #include "mojo/public/cpp/bindings/interface_request.h" |
| 48 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 47 #include "services/shell/public/cpp/interface_provider.h" | 49 #include "services/shell/public/cpp/interface_provider.h" |
| 48 #include "services/shell/public/cpp/interface_registry.h" | 50 #include "services/shell/public/cpp/interface_registry.h" |
| 49 #include "third_party/WebKit/public/platform/URLConversion.h" | 51 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 50 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 52 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
| 51 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 53 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
| 52 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 54 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 53 #include "third_party/WebKit/public/platform/WebString.h" | 55 #include "third_party/WebKit/public/platform/WebString.h" |
| 54 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi stration.h" | 56 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi stration.h" |
| 55 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onData.h" | 57 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onData.h" |
| 56 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerClientQueryOptions.h" | 58 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerClientQueryOptions.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 using ClaimClientsCallbacksMap = | 175 using ClaimClientsCallbacksMap = |
| 174 IDMap<blink::WebServiceWorkerClientsClaimCallbacks, IDMapOwnPointer>; | 176 IDMap<blink::WebServiceWorkerClientsClaimCallbacks, IDMapOwnPointer>; |
| 175 using ClientCallbacksMap = | 177 using ClientCallbacksMap = |
| 176 IDMap<blink::WebServiceWorkerClientCallbacks, IDMapOwnPointer>; | 178 IDMap<blink::WebServiceWorkerClientCallbacks, IDMapOwnPointer>; |
| 177 using SkipWaitingCallbacksMap = | 179 using SkipWaitingCallbacksMap = |
| 178 IDMap<blink::WebServiceWorkerSkipWaitingCallbacks, IDMapOwnPointer>; | 180 IDMap<blink::WebServiceWorkerSkipWaitingCallbacks, IDMapOwnPointer>; |
| 179 using SyncEventCallbacksMap = | 181 using SyncEventCallbacksMap = |
| 180 IDMap<const base::Callback<void(blink::mojom::ServiceWorkerEventStatus, | 182 IDMap<const base::Callback<void(blink::mojom::ServiceWorkerEventStatus, |
| 181 base::Time /* dispatch_event_time */)>, | 183 base::Time /* dispatch_event_time */)>, |
| 182 IDMapOwnPointer>; | 184 IDMapOwnPointer>; |
| 185 using FetchEventCallbacksMap = | |
| 186 IDMap<const base::Callback<void(blink::mojom::ServiceWorkerEventStatus, | |
| 187 base::Time /* dispatch_event_time */)>, | |
| 188 IDMapOwnPointer>; | |
| 183 | 189 |
| 184 explicit WorkerContextData(ServiceWorkerContextClient* owner) | 190 explicit WorkerContextData(ServiceWorkerContextClient* owner) |
| 185 : weak_factory(owner), proxy_weak_factory(owner->proxy_) {} | 191 : weak_factory(owner), proxy_weak_factory(owner->proxy_) {} |
| 186 | 192 |
| 187 ~WorkerContextData() { | 193 ~WorkerContextData() { |
| 188 DCHECK(thread_checker.CalledOnValidThread()); | 194 DCHECK(thread_checker.CalledOnValidThread()); |
| 189 } | 195 } |
| 190 | 196 |
| 191 // Pending callbacks for GetClientDocuments(). | 197 // Pending callbacks for GetClientDocuments(). |
| 192 ClientsCallbacksMap clients_callbacks; | 198 ClientsCallbacksMap clients_callbacks; |
| 193 | 199 |
| 194 // Pending callbacks for OpenWindow() and FocusClient(). | 200 // Pending callbacks for OpenWindow() and FocusClient(). |
| 195 ClientCallbacksMap client_callbacks; | 201 ClientCallbacksMap client_callbacks; |
| 196 | 202 |
| 197 // Pending callbacks for SkipWaiting(). | 203 // Pending callbacks for SkipWaiting(). |
| 198 SkipWaitingCallbacksMap skip_waiting_callbacks; | 204 SkipWaitingCallbacksMap skip_waiting_callbacks; |
| 199 | 205 |
| 200 // Pending callbacks for ClaimClients(). | 206 // Pending callbacks for ClaimClients(). |
| 201 ClaimClientsCallbacksMap claim_clients_callbacks; | 207 ClaimClientsCallbacksMap claim_clients_callbacks; |
| 202 | 208 |
| 203 // Pending callbacks for Background Sync Events | 209 // Pending callbacks for Background Sync Events |
| 204 SyncEventCallbacksMap sync_event_callbacks; | 210 SyncEventCallbacksMap sync_event_callbacks; |
| 205 | 211 |
| 212 // Pending callbacks for Fetch Events | |
| 213 FetchEventCallbacksMap fetch_event_callbacks; | |
| 214 | |
| 206 shell::InterfaceRegistry interface_registry; | 215 shell::InterfaceRegistry interface_registry; |
| 207 shell::InterfaceProvider remote_interfaces; | 216 shell::InterfaceProvider remote_interfaces; |
| 208 | 217 |
| 209 base::ThreadChecker thread_checker; | 218 base::ThreadChecker thread_checker; |
| 210 base::WeakPtrFactory<ServiceWorkerContextClient> weak_factory; | 219 base::WeakPtrFactory<ServiceWorkerContextClient> weak_factory; |
| 211 base::WeakPtrFactory<blink::WebServiceWorkerContextProxy> proxy_weak_factory; | 220 base::WeakPtrFactory<blink::WebServiceWorkerContextProxy> proxy_weak_factory; |
| 212 }; | 221 }; |
| 213 | 222 |
| 223 class ServiceWorkerContextClient::FetchEventDispatcherImpl | |
| 224 : public NON_EXPORTED_BASE(mojom::FetchEventDispatcher) { | |
| 225 public: | |
| 226 static void Create(mojom::FetchEventDispatcherRequest request) { | |
| 227 mojo::MakeStrongBinding(base::WrapUnique(new FetchEventDispatcherImpl), | |
|
shimazu
2016/09/23 03:26:11
MakeUnique<> might be better according to this:
h
horo
2016/09/23 05:57:56
Done.
| |
| 228 std::move(request)); | |
| 229 } | |
| 230 | |
| 231 FetchEventDispatcherImpl() {} | |
| 232 | |
| 233 ~FetchEventDispatcherImpl() override {} | |
| 234 | |
| 235 void DispatchFetchEvent(int response_id, | |
| 236 const ServiceWorkerFetchRequest& request, | |
| 237 const DispatchFetchEventCallback& callback) override { | |
| 238 ServiceWorkerContextClient* client = | |
| 239 ServiceWorkerContextClient::ThreadSpecificInstance(); | |
| 240 if (!client) { | |
| 241 callback.Run(blink::mojom::ServiceWorkerEventStatus::ABORTED, | |
| 242 base::Time::Now()); | |
| 243 return; | |
| 244 } | |
| 245 client->DispatchFetchEvent(response_id, request, callback); | |
| 246 } | |
| 247 | |
| 248 private: | |
| 249 DISALLOW_COPY_AND_ASSIGN(FetchEventDispatcherImpl); | |
| 250 }; | |
| 251 | |
| 214 ServiceWorkerContextClient* | 252 ServiceWorkerContextClient* |
| 215 ServiceWorkerContextClient::ThreadSpecificInstance() { | 253 ServiceWorkerContextClient::ThreadSpecificInstance() { |
| 216 return g_worker_client_tls.Pointer()->Get(); | 254 return g_worker_client_tls.Pointer()->Get(); |
| 217 } | 255 } |
| 218 | 256 |
| 219 ServiceWorkerContextClient::ServiceWorkerContextClient( | 257 ServiceWorkerContextClient::ServiceWorkerContextClient( |
| 220 int embedded_worker_id, | 258 int embedded_worker_id, |
| 221 int64_t service_worker_version_id, | 259 int64_t service_worker_version_id, |
| 222 const GURL& service_worker_scope, | 260 const GURL& service_worker_scope, |
| 223 const GURL& script_url, | 261 const GURL& script_url, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 245 void ServiceWorkerContextClient::OnMessageReceived( | 283 void ServiceWorkerContextClient::OnMessageReceived( |
| 246 int thread_id, | 284 int thread_id, |
| 247 int embedded_worker_id, | 285 int embedded_worker_id, |
| 248 const IPC::Message& message) { | 286 const IPC::Message& message) { |
| 249 CHECK_EQ(embedded_worker_id_, embedded_worker_id); | 287 CHECK_EQ(embedded_worker_id_, embedded_worker_id); |
| 250 bool handled = true; | 288 bool handled = true; |
| 251 IPC_BEGIN_MESSAGE_MAP(ServiceWorkerContextClient, message) | 289 IPC_BEGIN_MESSAGE_MAP(ServiceWorkerContextClient, message) |
| 252 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ActivateEvent, OnActivateEvent) | 290 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ActivateEvent, OnActivateEvent) |
| 253 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ExtendableMessageEvent, | 291 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ExtendableMessageEvent, |
| 254 OnExtendableMessageEvent) | 292 OnExtendableMessageEvent) |
| 255 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FetchEvent, OnFetchEvent) | |
| 256 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_InstallEvent, OnInstallEvent) | 293 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_InstallEvent, OnInstallEvent) |
| 257 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationClickEvent, | 294 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationClickEvent, |
| 258 OnNotificationClickEvent) | 295 OnNotificationClickEvent) |
| 259 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationCloseEvent, | 296 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationCloseEvent, |
| 260 OnNotificationCloseEvent) | 297 OnNotificationCloseEvent) |
| 261 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEvent) | 298 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEvent) |
| 262 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClient, OnDidGetClient) | 299 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClient, OnDidGetClient) |
| 263 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClients, OnDidGetClients) | 300 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClients, OnDidGetClients) |
| 264 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, | 301 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, |
| 265 OnOpenWindowResponse) | 302 OnOpenWindowResponse) |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 ServiceWorkerRegistrationObjectInfo registration_info; | 415 ServiceWorkerRegistrationObjectInfo registration_info; |
| 379 ServiceWorkerVersionAttributes version_attrs; | 416 ServiceWorkerVersionAttributes version_attrs; |
| 380 provider_context_->GetAssociatedRegistration(®istration_info, | 417 provider_context_->GetAssociatedRegistration(®istration_info, |
| 381 &version_attrs); | 418 &version_attrs); |
| 382 DCHECK_NE(registration_info.registration_id, | 419 DCHECK_NE(registration_info.registration_id, |
| 383 kInvalidServiceWorkerRegistrationId); | 420 kInvalidServiceWorkerRegistrationId); |
| 384 | 421 |
| 385 // Register Mojo interfaces. | 422 // Register Mojo interfaces. |
| 386 context_->interface_registry.AddInterface( | 423 context_->interface_registry.AddInterface( |
| 387 base::Bind(&BackgroundSyncClientImpl::Create)); | 424 base::Bind(&BackgroundSyncClientImpl::Create)); |
| 425 context_->interface_registry.AddInterface( | |
| 426 base::Bind(&FetchEventDispatcherImpl::Create)); | |
| 388 | 427 |
| 389 SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs); | 428 SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs); |
| 390 | 429 |
| 391 Send(new EmbeddedWorkerHostMsg_WorkerThreadStarted( | 430 Send(new EmbeddedWorkerHostMsg_WorkerThreadStarted( |
| 392 embedded_worker_id_, WorkerThread::GetCurrentId(), | 431 embedded_worker_id_, WorkerThread::GetCurrentId(), |
| 393 provider_context_->provider_id())); | 432 provider_context_->provider_id())); |
| 394 | 433 |
| 395 TRACE_EVENT_ASYNC_STEP_INTO0( | 434 TRACE_EVENT_ASYNC_STEP_INTO0( |
| 396 "ServiceWorker", | 435 "ServiceWorker", |
| 397 "ServiceWorkerContextClient::StartingWorkerContext", | 436 "ServiceWorkerContextClient::StartingWorkerContext", |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 545 web_response.cacheStorageCacheName().utf8(), cors_exposed_header_names); | 584 web_response.cacheStorageCacheName().utf8(), cors_exposed_header_names); |
| 546 Send(new ServiceWorkerHostMsg_FetchEventResponse( | 585 Send(new ServiceWorkerHostMsg_FetchEventResponse( |
| 547 GetRoutingID(), response_id, SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, | 586 GetRoutingID(), response_id, SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, |
| 548 response, base::Time::FromDoubleT(event_dispatch_time))); | 587 response, base::Time::FromDoubleT(event_dispatch_time))); |
| 549 } | 588 } |
| 550 | 589 |
| 551 void ServiceWorkerContextClient::didHandleFetchEvent( | 590 void ServiceWorkerContextClient::didHandleFetchEvent( |
| 552 int event_finish_id, | 591 int event_finish_id, |
| 553 blink::WebServiceWorkerEventResult result, | 592 blink::WebServiceWorkerEventResult result, |
| 554 double event_dispatch_time) { | 593 double event_dispatch_time) { |
| 555 Send(new ServiceWorkerHostMsg_FetchEventFinished( | 594 const FetchCallback* callback = |
| 556 GetRoutingID(), event_finish_id, result, | 595 context_->fetch_event_callbacks.Lookup(event_finish_id); |
| 557 base::Time::FromDoubleT(event_dispatch_time))); | 596 if (!callback) |
| 597 return; | |
| 598 callback->Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED, | |
| 599 base::Time::FromDoubleT(event_dispatch_time)); | |
| 600 context_->fetch_event_callbacks.Remove(event_finish_id); | |
| 558 } | 601 } |
| 559 | 602 |
| 560 void ServiceWorkerContextClient::didHandleNotificationClickEvent( | 603 void ServiceWorkerContextClient::didHandleNotificationClickEvent( |
| 561 int request_id, | 604 int request_id, |
| 562 blink::WebServiceWorkerEventResult result, | 605 blink::WebServiceWorkerEventResult result, |
| 563 double event_dispatch_time) { | 606 double event_dispatch_time) { |
| 564 Send(new ServiceWorkerHostMsg_NotificationClickEventFinished( | 607 Send(new ServiceWorkerHostMsg_NotificationClickEventFinished( |
| 565 GetRoutingID(), request_id, result, | 608 GetRoutingID(), request_id, result, |
| 566 base::Time::FromDoubleT(event_dispatch_time))); | 609 base::Time::FromDoubleT(event_dispatch_time))); |
| 567 } | 610 } |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 787 request_id, params.message, params.source_origin, ports, | 830 request_id, params.message, params.source_origin, ports, |
| 788 WebServiceWorkerImpl::CreateHandle(worker)); | 831 WebServiceWorkerImpl::CreateHandle(worker)); |
| 789 } | 832 } |
| 790 | 833 |
| 791 void ServiceWorkerContextClient::OnInstallEvent(int request_id) { | 834 void ServiceWorkerContextClient::OnInstallEvent(int request_id) { |
| 792 TRACE_EVENT0("ServiceWorker", | 835 TRACE_EVENT0("ServiceWorker", |
| 793 "ServiceWorkerContextClient::OnInstallEvent"); | 836 "ServiceWorkerContextClient::OnInstallEvent"); |
| 794 proxy_->dispatchInstallEvent(request_id); | 837 proxy_->dispatchInstallEvent(request_id); |
| 795 } | 838 } |
| 796 | 839 |
| 797 void ServiceWorkerContextClient::OnFetchEvent( | 840 void ServiceWorkerContextClient::DispatchFetchEvent( |
| 798 int response_id, | 841 int response_id, |
| 799 int event_finish_id, | 842 const ServiceWorkerFetchRequest& request, |
| 800 const ServiceWorkerFetchRequest& request) { | 843 const FetchCallback& callback) { |
| 801 blink::WebServiceWorkerRequest webRequest; | 844 blink::WebServiceWorkerRequest webRequest; |
| 802 TRACE_EVENT0("ServiceWorker", | 845 TRACE_EVENT0("ServiceWorker", |
| 803 "ServiceWorkerContextClient::OnFetchEvent"); | 846 "ServiceWorkerContextClient::DispatchFetchEvent"); |
| 847 int event_finish_id = | |
| 848 context_->fetch_event_callbacks.Add(new FetchCallback(callback)); | |
| 849 | |
| 804 webRequest.setURL(blink::WebURL(request.url)); | 850 webRequest.setURL(blink::WebURL(request.url)); |
| 805 webRequest.setMethod(blink::WebString::fromUTF8(request.method)); | 851 webRequest.setMethod(blink::WebString::fromUTF8(request.method)); |
| 806 for (ServiceWorkerHeaderMap::const_iterator it = request.headers.begin(); | 852 for (ServiceWorkerHeaderMap::const_iterator it = request.headers.begin(); |
| 807 it != request.headers.end(); | 853 it != request.headers.end(); |
| 808 ++it) { | 854 ++it) { |
| 809 webRequest.setHeader(blink::WebString::fromUTF8(it->first), | 855 webRequest.setHeader(blink::WebString::fromUTF8(it->first), |
| 810 blink::WebString::fromUTF8(it->second)); | 856 blink::WebString::fromUTF8(it->second)); |
| 811 } | 857 } |
| 812 if (!request.blob_uuid.empty()) { | 858 if (!request.blob_uuid.empty()) { |
| 813 webRequest.setBlob(blink::WebString::fromUTF8(request.blob_uuid), | 859 webRequest.setBlob(blink::WebString::fromUTF8(request.blob_uuid), |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1055 } | 1101 } |
| 1056 | 1102 |
| 1057 base::WeakPtr<ServiceWorkerContextClient> | 1103 base::WeakPtr<ServiceWorkerContextClient> |
| 1058 ServiceWorkerContextClient::GetWeakPtr() { | 1104 ServiceWorkerContextClient::GetWeakPtr() { |
| 1059 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1105 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1060 DCHECK(context_); | 1106 DCHECK(context_); |
| 1061 return context_->weak_factory.GetWeakPtr(); | 1107 return context_->weak_factory.GetWeakPtr(); |
| 1062 } | 1108 } |
| 1063 | 1109 |
| 1064 } // namespace content | 1110 } // namespace content |
| OLD | NEW |