Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: content/browser/devtools/service_worker_devtools_manager.cc

Issue 1221643014: Service Worker: Migrate to version_uuid and surface ServiceWorker.id. (Chromium 2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/devtools/service_worker_devtools_manager.h" 5 #include "content/browser/devtools/service_worker_devtools_manager.h"
6 6
7 #include "content/browser/devtools/service_worker_devtools_agent_host.h" 7 #include "content/browser/devtools/service_worker_devtools_agent_host.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/render_process_host.h" 9 #include "content/public/browser/render_process_host.h"
10 #include "content/public/browser/worker_service.h" 10 #include "content/public/browser/worker_service.h"
11 #include "ipc/ipc_listener.h" 11 #include "ipc/ipc_listener.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::ServiceWorkerIdentifier( 15 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::ServiceWorkerIdentifier(
16 const ServiceWorkerContextCore* context, 16 const ServiceWorkerContextCore* context,
17 base::WeakPtr<ServiceWorkerContextCore> context_weak, 17 base::WeakPtr<ServiceWorkerContextCore> context_weak,
18 int64 version_id, 18 std::string version_uuid,
19 const GURL& url) 19 const GURL& url)
20 : context_(context), 20 : context_(context),
21 context_weak_(context_weak), 21 context_weak_(context_weak),
22 version_id_(version_id), 22 version_uuid_(version_uuid),
23 url_(url) { 23 url_(url) {
24 } 24 }
25 25
26 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::ServiceWorkerIdentifier( 26 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::ServiceWorkerIdentifier(
27 const ServiceWorkerIdentifier& other) 27 const ServiceWorkerIdentifier& other)
28 : context_(other.context_), 28 : context_(other.context_),
29 context_weak_(other.context_weak_), 29 context_weak_(other.context_weak_),
30 version_id_(other.version_id_), 30 version_uuid_(other.version_uuid_),
31 url_(other.url_) { 31 url_(other.url_) {
32 } 32 }
33 33
34 ServiceWorkerDevToolsManager:: 34 ServiceWorkerDevToolsManager::
35 ServiceWorkerIdentifier::~ServiceWorkerIdentifier() { 35 ServiceWorkerIdentifier::~ServiceWorkerIdentifier() {
36 } 36 }
37 37
38 bool ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::Matches( 38 bool ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::Matches(
39 const ServiceWorkerIdentifier& other) const { 39 const ServiceWorkerIdentifier& other) const {
40 return context_ == other.context_ && version_id_ == other.version_id_; 40 return context_ == other.context_ && version_uuid_ == other.version_uuid_;
41 } 41 }
42 42
43 // static 43 // static
44 ServiceWorkerDevToolsManager* ServiceWorkerDevToolsManager::GetInstance() { 44 ServiceWorkerDevToolsManager* ServiceWorkerDevToolsManager::GetInstance() {
45 DCHECK_CURRENTLY_ON(BrowserThread::UI); 45 DCHECK_CURRENTLY_ON(BrowserThread::UI);
46 return Singleton<ServiceWorkerDevToolsManager>::get(); 46 return Singleton<ServiceWorkerDevToolsManager>::get();
47 } 47 }
48 48
49 DevToolsAgentHostImpl* 49 DevToolsAgentHostImpl*
50 ServiceWorkerDevToolsManager::GetDevToolsAgentHostForWorker( 50 ServiceWorkerDevToolsManager::GetDevToolsAgentHostForWorker(
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 break; 175 break;
176 } 176 }
177 return it; 177 return it;
178 } 178 }
179 179
180 void ServiceWorkerDevToolsManager::ResetForTesting() { 180 void ServiceWorkerDevToolsManager::ResetForTesting() {
181 workers_.clear(); 181 workers_.clear();
182 } 182 }
183 183
184 } // namespace content 184 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/service_worker_devtools_manager.h ('k') | content/browser/service_worker/embedded_worker_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698