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

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

Issue 976353002: DevTools: land service worker handler (patch 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@worker2
Patch Set: review comments addressed 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_
7
8 #include <set>
9
10 #include "content/browser/devtools/protocol/devtools_protocol_handler.h"
11 #include "content/browser/devtools/worker_devtools_manager.h"
12 #include "content/public/browser/devtools_agent_host.h"
13 #include "content/public/browser/devtools_agent_host_client.h"
14
15 namespace content {
16 namespace devtools {
17 namespace service_worker {
18
19 class ServiceWorkerHandler : public DevToolsAgentHostClient,
20 public WorkerDevToolsManager::Observer {
21 public:
22 typedef DevToolsProtocolClient::Response Response;
23
24 ServiceWorkerHandler();
25 ~ServiceWorkerHandler() override;
26
27 void SetClient(scoped_ptr<DevToolsProtocolClient> client);
28 void Detached();
29
30 // Protocol 'service worker' domain implementation.
31 Response Enable();
32 Response Disable();
33 Response SendMessage(const std::string& worker_id,
34 const std::string& message);
35 Response Attach(const std::string& worker_id);
36 Response Detach(const std::string& worker_id);
37
38 // WorkerDevToolsManager::Observer implementation.
39 void WorkerCreated(DevToolsAgentHost* host) override;
40 void WorkerDestroyed(DevToolsAgentHost* host) override;
41
42 private:
43 // DevToolsAgentHostClient overrides.
44 void DispatchProtocolMessage(DevToolsAgentHost* agent_host,
45 const std::string& message) override;
46 void AgentHostClosed(DevToolsAgentHost* agent_host,
47 bool replaced_with_another_client) override;
48
49 scoped_ptr<DevToolsProtocolClient> client_;
50 using AttachedHosts = std::map<std::string,
51 scoped_refptr<DevToolsAgentHost>>;
52 AttachedHosts attached_hosts_;
53
54 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler);
55 };
56
57 } // namespace service_worker
58 } // namespace devtools
59 } // namespace content
60
61 #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