OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/debugger/devtools_http_protocol_handler.h" | 5 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // An internal implementation of DevToolsClientHost that delegates | 31 // An internal implementation of DevToolsClientHost that delegates |
32 // messages sent for DevToolsClient to a DebuggerShell instance. | 32 // messages sent for DevToolsClient to a DebuggerShell instance. |
33 class DevToolsClientHostImpl : public DevToolsClientHost { | 33 class DevToolsClientHostImpl : public DevToolsClientHost { |
34 public: | 34 public: |
35 explicit DevToolsClientHostImpl(HttpListenSocket* socket) | 35 explicit DevToolsClientHostImpl(HttpListenSocket* socket) |
36 : socket_(socket) {} | 36 : socket_(socket) {} |
37 ~DevToolsClientHostImpl() {} | 37 ~DevToolsClientHostImpl() {} |
38 | 38 |
39 // DevToolsClientHost interface | 39 // DevToolsClientHost interface |
40 virtual void InspectedTabClosing() { | 40 virtual void InspectedTabClosing() { |
41 socket_->Close(); | 41 ChromeThread::PostTask( |
| 42 ChromeThread::IO, |
| 43 FROM_HERE, |
| 44 NewRunnableMethod(socket_, |
| 45 &HttpListenSocket::Close)); |
42 } | 46 } |
43 | 47 |
44 virtual void SendMessageToClient(const IPC::Message& msg) { | 48 virtual void SendMessageToClient(const IPC::Message& msg) { |
45 IPC_BEGIN_MESSAGE_MAP(DevToolsClientHostImpl, msg) | 49 IPC_BEGIN_MESSAGE_MAP(DevToolsClientHostImpl, msg) |
46 IPC_MESSAGE_HANDLER(DevToolsClientMsg_RpcMessage, OnRpcMessage); | 50 IPC_MESSAGE_HANDLER(DevToolsClientMsg_RpcMessage, OnRpcMessage); |
47 IPC_MESSAGE_UNHANDLED_ERROR() | 51 IPC_MESSAGE_UNHANDLED_ERROR() |
48 IPC_END_MESSAGE_MAP() | 52 IPC_END_MESSAGE_MAP() |
49 } | 53 } |
50 | 54 |
51 void NotifyCloseListener() { | 55 void NotifyCloseListener() { |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 TabStripModel* model = (*it)->tabstrip_model(); | 417 TabStripModel* model = (*it)->tabstrip_model(); |
414 for (int i = 0, size = model->count(); i < size; ++i) { | 418 for (int i = 0, size = model->count(); i < size; ++i) { |
415 NavigationController& controller = | 419 NavigationController& controller = |
416 model->GetTabContentsAt(i)->controller(); | 420 model->GetTabContentsAt(i)->controller(); |
417 if (controller.session_id().id() == session_id) | 421 if (controller.session_id().id() == session_id) |
418 return controller.tab_contents(); | 422 return controller.tab_contents(); |
419 } | 423 } |
420 } | 424 } |
421 return NULL; | 425 return NULL; |
422 } | 426 } |
OLD | NEW |