Chromium Code Reviews| Index: content/browser/devtools/protocol/service_worker_handler.h |
| diff --git a/content/browser/devtools/protocol/service_worker_handler.h b/content/browser/devtools/protocol/service_worker_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb370847d264b06f829c90d641184969daa5a87f |
| --- /dev/null |
| +++ b/content/browser/devtools/protocol/service_worker_handler.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
| +#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
| + |
| +#include <set> |
| + |
| +#include "content/browser/devtools/protocol/devtools_protocol_handler.h" |
| + |
|
dgozman
2015/03/05 20:17:06
nit: remove blank line
pfeldman
2015/03/05 20:26:26
Done.
|
| +#include "content/browser/devtools/worker_devtools_manager.h" |
| +#include "content/public/browser/devtools_agent_host.h" |
| +#include "content/public/browser/devtools_agent_host_client.h" |
| + |
| +namespace content { |
| +namespace devtools { |
| +namespace service_worker { |
| + |
| +class ServiceWorkerHandler : public DevToolsAgentHostClient, |
| + public WorkerDevToolsManager::Observer { |
| + public: |
| + typedef DevToolsProtocolClient::Response Response; |
| + |
| + ServiceWorkerHandler(); |
| + ~ServiceWorkerHandler() override; |
| + |
| + void SetClient(scoped_ptr<DevToolsProtocolClient> client); |
| + void Detached(); |
| + |
| + // Protocol 'worker domain' implementation. |
|
dgozman
2015/03/05 20:17:06
worker -> service worker
pfeldman
2015/03/05 20:26:26
Done.
|
| + Response Enable(); |
| + Response Disable(); |
| + Response SendMessage(const std::string& worker_id, |
| + const std::string& message); |
| + Response Attach(const std::string& worker_id); |
| + Response Detach(const std::string& worker_id); |
| + |
| + // WorkerDevToolsManager::Observer implementation. |
| + void WorkerCreated(scoped_refptr<DevToolsAgentHost> host) override; |
| + void WorkerDestroyed(scoped_refptr<DevToolsAgentHost> host) override; |
| + |
| + private: |
| + // DevToolsProtocolClient overrides. |
|
dgozman
2015/03/05 20:17:06
DevToolsAgentHostClient
pfeldman
2015/03/05 20:26:26
Done.
|
| + void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
| + const std::string& message) override; |
| + void AgentHostClosed(DevToolsAgentHost* agent_host, |
| + bool replaced_with_another_client) override; |
| + |
| + scoped_ptr<DevToolsProtocolClient> client_; |
| + using AttachedHosts = std::map<std::string, |
| + scoped_refptr<DevToolsAgentHost>>; |
| + AttachedHosts attached_hosts_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); |
| +}; |
| + |
| +} // namespace worker |
|
dgozman
2015/03/05 20:17:06
service_worker
pfeldman
2015/03/05 20:26:26
Done.
|
| +} // namespace devtools |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |