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

Side by Side Diff: chrome/browser/devtools/devtools_adb_bridge.cc

Issue 13305002: Remove redundant DevToolsManager methods and clean up its clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/devtools/devtools_adb_bridge.h" 5 #include "chrome/browser/devtools/devtools_adb_bridge.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 return; 322 return;
323 CloseConnection(result, true); 323 CloseConnection(result, true);
324 } 324 }
325 325
326 void OnFrameRead(const std::string& message) { 326 void OnFrameRead(const std::string& message) {
327 scoped_ptr<base::Value> value(base::JSONReader::Read(message)); 327 scoped_ptr<base::Value> value(base::JSONReader::Read(message));
328 DictionaryValue* dvalue; 328 DictionaryValue* dvalue;
329 if (!value || !value->GetAsDictionary(&dvalue)) 329 if (!value || !value->GetAsDictionary(&dvalue))
330 return; 330 return;
331 331
332 content::DevToolsManager* manager = content::DevToolsManager::GetInstance(); 332 content::DevToolsManager::GetInstance()->
333 content::DevToolsClientHost* client_host = 333 DispatchOnInspectorFrontend(proxy_->GetAgentHost(), message);
334 manager->GetDevToolsClientHostFor(proxy_->GetAgentHost());
335 if (client_host)
336 client_host->DispatchOnInspectorFrontend(message);
337 } 334 }
338 335
339 void OnSocketClosed(int result) { 336 void OnSocketClosed(int result) {
340 proxy_->ConnectionClosed(); 337 proxy_->ConnectionClosed();
341 } 338 }
342 339
343 std::string id_; 340 std::string id_;
344 scoped_refptr<DevToolsAdbBridge::RefCountedAdbThread> adb_thread_; 341 scoped_refptr<DevToolsAdbBridge::RefCountedAdbThread> adb_thread_;
345 scoped_ptr<net::TCPClientSocket> socket_; 342 scoped_ptr<net::TCPClientSocket> socket_;
346 scoped_ptr<content::DevToolsExternalAgentProxy> proxy_; 343 scoped_ptr<content::DevToolsExternalAgentProxy> proxy_;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 if (!has_message_loop_) 517 if (!has_message_loop_)
521 return; 518 return;
522 519
523 scoped_refptr<AdbAttachCommand> command( 520 scoped_refptr<AdbAttachCommand> command(
524 new AdbAttachCommand(weak_factory_.GetWeakPtr(), serial, debug_url, 521 new AdbAttachCommand(weak_factory_.GetWeakPtr(), serial, debug_url,
525 frontend_url)); 522 frontend_url));
526 adb_thread_->message_loop()->PostTask( 523 adb_thread_->message_loop()->PostTask(
527 FROM_HERE, 524 FROM_HERE,
528 base::Bind(&AdbAttachCommand::Run, command)); 525 base::Bind(&AdbAttachCommand::Run, command));
529 } 526 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_sanity_browsertest.cc » ('j') | content/public/browser/devtools_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698