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

Side by Side Diff: content/browser/devtools/protocol/service_worker_handler.h

Issue 1029553002: [DevTools] Introduce Unregister/Start/Stop/Inspect buttons to ServiceWorkersView [1/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indent Created 5 years, 9 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
« no previous file with comments | « no previous file | content/browser/devtools/protocol/service_worker_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 30 matching lines...) Expand all
41 void SetClient(scoped_ptr<Client> client); 41 void SetClient(scoped_ptr<Client> client);
42 void UpdateHosts(); 42 void UpdateHosts();
43 void Detached(); 43 void Detached();
44 44
45 // Protocol 'service worker' domain implementation. 45 // Protocol 'service worker' domain implementation.
46 Response Enable(); 46 Response Enable();
47 Response Disable(); 47 Response Disable();
48 Response SendMessage(const std::string& worker_id, 48 Response SendMessage(const std::string& worker_id,
49 const std::string& message); 49 const std::string& message);
50 Response Stop(const std::string& worker_id); 50 Response Stop(const std::string& worker_id);
51 Response Unregister(const std::string& scope_url);
52 Response StartWorker(const std::string& scope_url);
53 Response StopWorker(const std::string& version_id);
54 Response InspectWorker(const std::string& version_id);
51 55
52 // WorkerDevToolsManager::Observer implementation. 56 // WorkerDevToolsManager::Observer implementation.
53 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; 57 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override;
54 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; 58 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override;
55 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; 59 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override;
56 60
57 private: 61 private:
58 // DevToolsAgentHostClient overrides. 62 // DevToolsAgentHostClient overrides.
59 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, 63 void DispatchProtocolMessage(DevToolsAgentHost* agent_host,
60 const std::string& message) override; 64 const std::string& message) override;
61 void AgentHostClosed(DevToolsAgentHost* agent_host, 65 void AgentHostClosed(DevToolsAgentHost* agent_host,
62 bool replaced_with_another_client) override; 66 bool replaced_with_another_client) override;
63 67
64 void ReportWorkerCreated(ServiceWorkerDevToolsAgentHost* host); 68 void ReportWorkerCreated(ServiceWorkerDevToolsAgentHost* host);
65 void ReportWorkerTerminated(ServiceWorkerDevToolsAgentHost* host); 69 void ReportWorkerTerminated(ServiceWorkerDevToolsAgentHost* host);
66 70
67 void OnWorkerRegistrationUpdated( 71 void OnWorkerRegistrationUpdated(
68 const std::vector<ServiceWorkerRegistrationInfo>& registrations); 72 const std::vector<ServiceWorkerRegistrationInfo>& registrations);
69 void OnWorkerVersionUpdated( 73 void OnWorkerVersionUpdated(
70 const std::vector<ServiceWorkerVersionInfo>& registrations); 74 const std::vector<ServiceWorkerVersionInfo>& registrations);
71 75
76 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id);
77
72 scoped_refptr<ServiceWorkerContextWrapper> context_; 78 scoped_refptr<ServiceWorkerContextWrapper> context_;
73 scoped_ptr<Client> client_; 79 scoped_ptr<Client> client_;
74 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; 80 ServiceWorkerDevToolsAgentHost::Map attached_hosts_;
75 bool enabled_; 81 bool enabled_;
76 std::set<GURL> urls_; 82 std::set<GURL> urls_;
77 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; 83 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_;
78 RenderFrameHostImpl* render_frame_host_; 84 RenderFrameHostImpl* render_frame_host_;
79 85
80 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; 86 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_;
81 87
82 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); 88 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler);
83 }; 89 };
84 90
85 } // namespace service_worker 91 } // namespace service_worker
86 } // namespace devtools 92 } // namespace devtools
87 } // namespace content 93 } // namespace content
88 94
89 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ 95 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/protocol/service_worker_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698