OLD | NEW |
---|---|
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/embedded_worker_devtools_agent_host.h" | 5 #include "content/browser/devtools/embedded_worker_devtools_agent_host.h" |
6 | 6 |
7 #include "content/browser/devtools/devtools_manager_impl.h" | 7 #include "content/browser/devtools/devtools_manager_impl.h" |
8 #include "content/browser/devtools/devtools_protocol.h" | 8 #include "content/browser/devtools/devtools_protocol.h" |
9 #include "content/browser/devtools/devtools_protocol_constants.h" | 9 #include "content/browser/devtools/devtools_protocol_constants.h" |
10 #include "content/common/devtools_messages.h" | 10 #include "content/common/devtools_messages.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 worker_id_(worker_id) { | 31 worker_id_(worker_id) { |
32 if (debug_service_worker_on_start) | 32 if (debug_service_worker_on_start) |
33 state_ = WORKER_PAUSED_FOR_DEBUG_ON_START; | 33 state_ = WORKER_PAUSED_FOR_DEBUG_ON_START; |
34 WorkerCreated(); | 34 WorkerCreated(); |
35 } | 35 } |
36 | 36 |
37 bool EmbeddedWorkerDevToolsAgentHost::IsWorker() const { | 37 bool EmbeddedWorkerDevToolsAgentHost::IsWorker() const { |
38 return true; | 38 return true; |
39 } | 39 } |
40 | 40 |
41 std::string EmbeddedWorkerDevToolsAgentHost::GetType() { | |
42 return shared_worker_ ? kAgentHostTypeWorker : kAgentHostTypeServiceWorker; | |
43 } | |
44 | |
45 std::string EmbeddedWorkerDevToolsAgentHost::GetTitle() { | |
46 return ""; | |
yurys
2014/08/13 07:33:46
shared_worker_ has both name and url so you should
vkuzkokov
2014/08/13 08:21:06
Implemented GetTitle() and GetURL() for shared wor
| |
47 } | |
48 | |
49 GURL EmbeddedWorkerDevToolsAgentHost::GetURL() { | |
50 return GURL(); | |
51 } | |
52 | |
53 bool EmbeddedWorkerDevToolsAgentHost::Activate() { | |
54 return false; | |
55 } | |
56 | |
57 bool EmbeddedWorkerDevToolsAgentHost::Close() { | |
58 return false; | |
yurys
2014/08/13 07:33:46
I guess we can easily implement this method.
vkuzkokov
2014/08/13 08:21:06
Easily - for shared workers. For service workers i
| |
59 } | |
60 | |
41 void EmbeddedWorkerDevToolsAgentHost::SendMessageToAgent( | 61 void EmbeddedWorkerDevToolsAgentHost::SendMessageToAgent( |
42 IPC::Message* message_raw) { | 62 IPC::Message* message_raw) { |
43 scoped_ptr<IPC::Message> message(message_raw); | 63 scoped_ptr<IPC::Message> message(message_raw); |
44 if (state_ != WORKER_INSPECTED) | 64 if (state_ != WORKER_INSPECTED) |
45 return; | 65 return; |
46 if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) { | 66 if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) { |
47 message->set_routing_id(worker_id_.second); | 67 message->set_routing_id(worker_id_.second); |
48 host->Send(message.release()); | 68 host->Send(message.release()); |
49 } | 69 } |
50 } | 70 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( | 170 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( |
151 this, message); | 171 this, message); |
152 } | 172 } |
153 | 173 |
154 void EmbeddedWorkerDevToolsAgentHost::OnSaveAgentRuntimeState( | 174 void EmbeddedWorkerDevToolsAgentHost::OnSaveAgentRuntimeState( |
155 const std::string& state) { | 175 const std::string& state) { |
156 saved_agent_state_ = state; | 176 saved_agent_state_ = state; |
157 } | 177 } |
158 | 178 |
159 } // namespace content | 179 } // namespace content |
OLD | NEW |