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

Unified Diff: chrome/browser/devtools/device/devtools_device_discovery.cc

Issue 2437633003: [DevTools] Switch remote locations to Target domain. (Closed)
Patch Set: removed dispose Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/device/devtools_device_discovery.cc
diff --git a/chrome/browser/devtools/device/devtools_device_discovery.cc b/chrome/browser/devtools/device/devtools_device_discovery.cc
index 9436d34b6e1e6232d9caf0c96d817af49c50d127..aefd6c1fc026ccd73a2dd9df0179e92320a5273b 100644
--- a/chrome/browser/devtools/device/devtools_device_discovery.cc
+++ b/chrome/browser/devtools/device/devtools_device_discovery.cc
@@ -270,6 +270,7 @@ void AgentHostDelegate::Attach(content::DevToolsExternalAgentProxy* proxy) {
void AgentHostDelegate::Detach() {
web_socket_.reset();
+ proxy_->ConnectionClosed();
proxy_ = nullptr;
}
@@ -617,36 +618,3 @@ void DevToolsDeviceDiscovery::ReceivedDeviceList(
// |callback_| should be run last as it may destroy |this|.
callback_.Run(complete_devices);
}
-
-namespace {
-
-class OnceWrapper {
- public:
- OnceWrapper(AndroidDeviceManager* device_manager,
- const DevToolsDeviceDiscovery::DeviceListCallback& callback)
- : callback_(callback) {
- discovery_.reset(new DevToolsDeviceDiscovery(device_manager,
- base::Bind(&OnceWrapper::Callback, base::Unretained(this))));
- discovery_->SetScheduler(base::Bind(&OnceWrapper::NoOp));
- }
-
- private:
- static void NoOp(const base::Closure&) {}
-
- void Callback(const DevToolsDeviceDiscovery::CompleteDevices& devices) {
- callback_.Run(devices);
- delete this;
- }
-
- std::unique_ptr<DevToolsDeviceDiscovery> discovery_;
- const DevToolsDeviceDiscovery::DeviceListCallback callback_;
-};
-
-} // namespace
-
-// static
-void DevToolsDeviceDiscovery::DiscoverOnce(
- AndroidDeviceManager* device_manager,
- const DeviceListCallback& callback) {
- new OnceWrapper(device_manager, callback);
-}
« no previous file with comments | « chrome/browser/devtools/device/devtools_device_discovery.h ('k') | chrome/browser/devtools/devtools_network_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698