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

Unified Diff: chrome/browser/devtools/device/devtools_android_bridge.h

Issue 286993003: Fixed case when DevtoolsAdbBridge may start few polling loops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed explicit timeouts. Created 6 years, 7 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
« no previous file with comments | « chrome/browser/devtools/device/DEPS ('k') | chrome/browser/devtools/device/devtools_android_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/device/devtools_android_bridge.h
diff --git a/chrome/browser/devtools/device/devtools_android_bridge.h b/chrome/browser/devtools/device/devtools_android_bridge.h
index 6a0f781e8138db2e0c4df7204a4de1a33537ee0f..5d523a6e98a619a72fba9f31f5b06c8b63f4507e 100644
--- a/chrome/browser/devtools/device/devtools_android_bridge.h
+++ b/chrome/browser/devtools/device/devtools_android_bridge.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/cancelable_callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_change_registrar.h"
@@ -39,6 +40,8 @@ class DevToolsAndroidBridge
DevToolsAndroidBridge,
content::BrowserThread::DeleteOnUIThread> {
public:
+ static const int kAdbPollingIntervalMs;
+
typedef base::Callback<void(int result,
const std::string& response)> Callback;
@@ -242,6 +245,11 @@ class DevToolsAndroidBridge
device_providers_ = device_providers;
}
+ void set_device_count_request_scheduler_for_test(
+ base::Callback<void(base::Closure)> scheduler) {
+ device_count_request_scheduler_for_test_ = scheduler;
+ }
+
static bool HasDevToolsWindow(const std::string& agent_id);
private:
@@ -277,9 +285,14 @@ class DevToolsAndroidBridge
void CreatedDeviceManager(scoped_refptr<AndroidDeviceManager> device_manager);
void RequestDeviceList();
void ReceivedDeviceList(RemoteDevices* devices);
+ void StartDeviceListPollingLoop();
+ void StopDeviceListPollingLoop();
void RequestDeviceCount();
void ReceivedDeviceCount(int count);
+ void StartDeviceCountPollingLoop();
+ void StopDeviceCountPollingLoop();
+ void ScheduleDeviceCountRequest(base::Closure callback);
void CreateDeviceProviders();
@@ -289,12 +302,18 @@ class DevToolsAndroidBridge
typedef std::vector<DeviceListListener*> DeviceListListeners;
DeviceListListeners device_list_listeners_;
+ base::CancelableCallback<void()> request_device_list_bound_;
+ base::CancelableCallback<void(RemoteDevices* devices_ptr)>
+ received_device_list_bound_;
typedef std::vector<DeviceCountListener*> DeviceCountListeners;
DeviceCountListeners device_count_listeners_;
+ base::CancelableCallback<void()> request_device_count_bound_;
+ base::CancelableCallback<void(int)> received_device_count_bound_;
AndroidDeviceManager::DeviceProviders device_providers_;
PrefChangeRegistrar pref_change_registrar_;
+ base::Callback<void(base::Closure)> device_count_request_scheduler_for_test_;
DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge);
};
« no previous file with comments | « chrome/browser/devtools/device/DEPS ('k') | chrome/browser/devtools/device/devtools_android_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698