| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 base::WeakPtrFactory<blink::WebServiceWorkerContextProxy> proxy_weak_factory; | 208 base::WeakPtrFactory<blink::WebServiceWorkerContextProxy> proxy_weak_factory; |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 ServiceWorkerContextClient* | 211 ServiceWorkerContextClient* |
| 212 ServiceWorkerContextClient::ThreadSpecificInstance() { | 212 ServiceWorkerContextClient::ThreadSpecificInstance() { |
| 213 return g_worker_client_tls.Pointer()->Get(); | 213 return g_worker_client_tls.Pointer()->Get(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 ServiceWorkerContextClient::ServiceWorkerContextClient( | 216 ServiceWorkerContextClient::ServiceWorkerContextClient( |
| 217 int embedded_worker_id, | 217 int embedded_worker_id, |
| 218 int64 service_worker_version_id, | 218 int64_t service_worker_version_id, |
| 219 const GURL& service_worker_scope, | 219 const GURL& service_worker_scope, |
| 220 const GURL& script_url, | 220 const GURL& script_url, |
| 221 int worker_devtools_agent_route_id) | 221 int worker_devtools_agent_route_id) |
| 222 : embedded_worker_id_(embedded_worker_id), | 222 : embedded_worker_id_(embedded_worker_id), |
| 223 service_worker_version_id_(service_worker_version_id), | 223 service_worker_version_id_(service_worker_version_id), |
| 224 service_worker_scope_(service_worker_scope), | 224 service_worker_scope_(service_worker_scope), |
| 225 script_url_(script_url), | 225 script_url_(script_url), |
| 226 worker_devtools_agent_route_id_(worker_devtools_agent_route_id), | 226 worker_devtools_agent_route_id_(worker_devtools_agent_route_id), |
| 227 sender_(ChildThreadImpl::current()->thread_safe_sender()), | 227 sender_(ChildThreadImpl::current()->thread_safe_sender()), |
| 228 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 228 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 } | 981 } |
| 982 | 982 |
| 983 base::WeakPtr<ServiceWorkerContextClient> | 983 base::WeakPtr<ServiceWorkerContextClient> |
| 984 ServiceWorkerContextClient::GetWeakPtr() { | 984 ServiceWorkerContextClient::GetWeakPtr() { |
| 985 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 985 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 986 DCHECK(context_); | 986 DCHECK(context_); |
| 987 return context_->weak_factory.GetWeakPtr(); | 987 return context_->weak_factory.GetWeakPtr(); |
| 988 } | 988 } |
| 989 | 989 |
| 990 } // namespace content | 990 } // namespace content |
| OLD | NEW |