| 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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "content/renderer/devtools/devtools_agent.h" | 36 #include "content/renderer/devtools/devtools_agent.h" |
| 37 #include "content/renderer/render_thread_impl.h" | 37 #include "content/renderer/render_thread_impl.h" |
| 38 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 38 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
| 39 #include "content/renderer/service_worker/service_worker_type_util.h" | 39 #include "content/renderer/service_worker/service_worker_type_util.h" |
| 40 #include "ipc/ipc_message.h" | 40 #include "ipc/ipc_message.h" |
| 41 #include "ipc/ipc_message_macros.h" | 41 #include "ipc/ipc_message_macros.h" |
| 42 #include "third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h
" | 42 #include "third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h
" |
| 43 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 43 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
| 44 #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" | 44 #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" |
| 45 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 45 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
| 46 #include "third_party/WebKit/public/platform/WebServiceWorkerClientQueryOptions.
h" | |
| 47 #include "third_party/WebKit/public/platform/WebServiceWorkerRequest.h" | |
| 48 #include "third_party/WebKit/public/platform/WebServiceWorkerResponse.h" | |
| 49 #include "third_party/WebKit/public/platform/WebString.h" | 46 #include "third_party/WebKit/public/platform/WebString.h" |
| 50 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi
stration.h" | 47 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi
stration.h" |
| 51 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onData.h" | 48 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onData.h" |
| 49 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerClientQueryOptions.h" |
| 50 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRequest.h" |
| 51 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponse.h" |
| 52 #include "third_party/WebKit/public/web/WebDataSource.h" | 52 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 53 #include "third_party/WebKit/public/web/WebServiceWorkerContextClient.h" | 53 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo
ntextClient.h" |
| 54 #include "third_party/WebKit/public/web/WebServiceWorkerContextProxy.h" | 54 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo
ntextProxy.h" |
| 55 #include "third_party/WebKit/public/web/WebServiceWorkerNetworkProvider.h" | 55 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerNe
tworkProvider.h" |
| 56 | 56 |
| 57 namespace content { | 57 namespace content { |
| 58 | 58 |
| 59 namespace { | 59 namespace { |
| 60 | 60 |
| 61 // For now client must be a per-thread instance. | 61 // For now client must be a per-thread instance. |
| 62 base::LazyInstance<base::ThreadLocalPointer<ServiceWorkerContextClient>>:: | 62 base::LazyInstance<base::ThreadLocalPointer<ServiceWorkerContextClient>>:: |
| 63 Leaky g_worker_client_tls = LAZY_INSTANCE_INITIALIZER; | 63 Leaky g_worker_client_tls = LAZY_INSTANCE_INITIALIZER; |
| 64 | 64 |
| 65 void CallWorkerContextDestroyedOnMainThread(int embedded_worker_id) { | 65 void CallWorkerContextDestroyedOnMainThread(int embedded_worker_id) { |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 } | 952 } |
| 953 | 953 |
| 954 base::WeakPtr<ServiceWorkerContextClient> | 954 base::WeakPtr<ServiceWorkerContextClient> |
| 955 ServiceWorkerContextClient::GetWeakPtr() { | 955 ServiceWorkerContextClient::GetWeakPtr() { |
| 956 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 956 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 957 DCHECK(context_); | 957 DCHECK(context_); |
| 958 return context_->weak_factory.GetWeakPtr(); | 958 return context_->weak_factory.GetWeakPtr(); |
| 959 } | 959 } |
| 960 | 960 |
| 961 } // namespace content | 961 } // namespace content |
| OLD | NEW |