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

Side by Side Diff: chrome/browser/debugger/devtools_http_protocol_handler.cc

Issue 3043020: DevTools: close remote debugging connection on IO thread when inspected tab closes. (Closed)
Patch Set: Created 10 years, 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698