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 26 matching lines...) Expand all Loading... |
37 #include "content/renderer/devtools/devtools_agent.h" | 37 #include "content/renderer/devtools/devtools_agent.h" |
38 #include "content/renderer/render_thread_impl.h" | 38 #include "content/renderer/render_thread_impl.h" |
39 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" | 39 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" |
40 #include "content/renderer/service_worker/service_worker_type_util.h" | 40 #include "content/renderer/service_worker/service_worker_type_util.h" |
41 #include "ipc/ipc_message.h" | 41 #include "ipc/ipc_message.h" |
42 #include "ipc/ipc_message_macros.h" | 42 #include "ipc/ipc_message_macros.h" |
43 #include "third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h
" | 43 #include "third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h
" |
44 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 44 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
45 #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" | 45 #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" |
46 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 46 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
47 #include "third_party/WebKit/public/platform/WebServiceWorkerClientQueryOptions.
h" | |
48 #include "third_party/WebKit/public/platform/WebServiceWorkerRequest.h" | |
49 #include "third_party/WebKit/public/platform/WebServiceWorkerResponse.h" | |
50 #include "third_party/WebKit/public/platform/WebString.h" | 47 #include "third_party/WebKit/public/platform/WebString.h" |
51 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi
stration.h" | 48 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi
stration.h" |
52 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onData.h" | 49 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onData.h" |
| 50 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerClientQueryOptions.h" |
| 51 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRequest.h" |
| 52 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponse.h" |
53 #include "third_party/WebKit/public/web/WebDataSource.h" | 53 #include "third_party/WebKit/public/web/WebDataSource.h" |
54 #include "third_party/WebKit/public/web/WebServiceWorkerContextClient.h" | 54 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo
ntextClient.h" |
55 #include "third_party/WebKit/public/web/WebServiceWorkerContextProxy.h" | 55 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo
ntextProxy.h" |
56 #include "third_party/WebKit/public/web/WebServiceWorkerNetworkProvider.h" | 56 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerNe
tworkProvider.h" |
57 | 57 |
58 namespace content { | 58 namespace content { |
59 | 59 |
60 namespace { | 60 namespace { |
61 | 61 |
62 // For now client must be a per-thread instance. | 62 // For now client must be a per-thread instance. |
63 base::LazyInstance<base::ThreadLocalPointer<ServiceWorkerContextClient>>:: | 63 base::LazyInstance<base::ThreadLocalPointer<ServiceWorkerContextClient>>:: |
64 Leaky g_worker_client_tls = LAZY_INSTANCE_INITIALIZER; | 64 Leaky g_worker_client_tls = LAZY_INSTANCE_INITIALIZER; |
65 | 65 |
66 void CallWorkerContextDestroyedOnMainThread(int embedded_worker_id) { | 66 void CallWorkerContextDestroyedOnMainThread(int embedded_worker_id) { |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 } | 967 } |
968 | 968 |
969 base::WeakPtr<ServiceWorkerContextClient> | 969 base::WeakPtr<ServiceWorkerContextClient> |
970 ServiceWorkerContextClient::GetWeakPtr() { | 970 ServiceWorkerContextClient::GetWeakPtr() { |
971 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 971 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
972 DCHECK(context_); | 972 DCHECK(context_); |
973 return context_->weak_factory.GetWeakPtr(); | 973 return context_->weak_factory.GetWeakPtr(); |
974 } | 974 } |
975 | 975 |
976 } // namespace content | 976 } // namespace content |
OLD | NEW |