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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 std::string id = base::StringPrintf("%s:%s", serial_.c_str(), 518 std::string id = base::StringPrintf("%s:%s", serial_.c_str(),
519 debug_url_.c_str()); 519 debug_url_.c_str());
520 AgentHostDelegates::iterator it = g_host_delegates.Get().find(id); 520 AgentHostDelegates::iterator it = g_host_delegates.Get().find(id);
521 AgentHostDelegate* delegate; 521 AgentHostDelegate* delegate;
522 if (it != g_host_delegates.Get().end()) 522 if (it != g_host_delegates.Get().end())
523 delegate = it->second; 523 delegate = it->second;
524 else 524 else
525 delegate = new AgentHostDelegate(id, serial_, bridge->adb_thread_, 525 delegate = new AgentHostDelegate(id, serial_, bridge->adb_thread_,
526 socket); 526 socket);
527 DevToolsWindow::OpenExternalFrontend(bridge->profile_, 527 DevToolsWindow::OpenExternalFrontend(
528 frontend_url_, 528 bridge->profile_, frontend_url_, delegate->GetAgentHost().get());
529 delegate->GetAgentHost());
530 } 529 }
531 530
532 base::WeakPtr<DevToolsAdbBridge> bridge_; 531 base::WeakPtr<DevToolsAdbBridge> bridge_;
533 std::string serial_; 532 std::string serial_;
534 std::string socket_; 533 std::string socket_;
535 std::string debug_url_; 534 std::string debug_url_;
536 std::string frontend_url_; 535 std::string frontend_url_;
537 }; 536 };
538 537
539 DevToolsAdbBridge::RemotePage::RemotePage(const std::string& serial, 538 DevToolsAdbBridge::RemotePage::RemotePage(const std::string& serial,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if (!has_message_loop_) 652 if (!has_message_loop_)
654 return; 653 return;
655 654
656 scoped_refptr<AdbAttachCommand> command( 655 scoped_refptr<AdbAttachCommand> command(
657 new AdbAttachCommand(weak_factory_.GetWeakPtr(), serial, socket, 656 new AdbAttachCommand(weak_factory_.GetWeakPtr(), serial, socket,
658 debug_url, frontend_url)); 657 debug_url, frontend_url));
659 adb_thread_->message_loop()->PostTask( 658 adb_thread_->message_loop()->PostTask(
660 FROM_HERE, 659 FROM_HERE,
661 base::Bind(&AdbAttachCommand::Run, command)); 660 base::Bind(&AdbAttachCommand::Run, command));
662 } 661 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698