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

Unified Diff: chrome/browser/devtools/devtools_adb_bridge.h

Issue 12559008: DevTools: add backend for discovering connected ADB devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Offline review comments addressed Created 7 years, 9 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/adb_client_socket.cc ('k') | chrome/browser/devtools/devtools_adb_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_adb_bridge.h
diff --git a/chrome/browser/devtools/devtools_adb_bridge.h b/chrome/browser/devtools/devtools_adb_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..0df6cf91a67e6ed28f1195fd67b434be879cf879
--- /dev/null
+++ b/chrome/browser/devtools/devtools_adb_bridge.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class Thread;
+}
+
+class DevToolsAdbBridge : public base::RefCountedThreadSafe<DevToolsAdbBridge> {
+ public:
+ typedef base::Callback<void(const std::string& error,
+ const std::string& data)> Callback;
+
+ static DevToolsAdbBridge* Start();
+ void Query(const std::string query, const Callback& callback);
+ void Stop();
+
+ private:
+ friend class base::RefCountedThreadSafe<DevToolsAdbBridge>;
+
+ explicit DevToolsAdbBridge();
+ virtual ~DevToolsAdbBridge();
+
+ void StartHandlerOnFileThread();
+ void StopHandlerOnFileThread();
+
+ void ResetHandlerAndReleaseOnUIThread();
+ void ResetHandlerOnUIThread();
+
+ void QueryOnHandlerThread(const std::string query, const Callback& callback);
+ void QueryResponseOnHandlerThread(const Callback& callback,
+ const std::string& error,
+ const std::string& response);
+
+ void RespondOnUIThread(const Callback& callback,
+ const std::string& error,
+ const std::string& response);
+
+ // The thread used by the devtools to run client socket.
+ scoped_ptr<base::Thread> thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsAdbBridge);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_
« no previous file with comments | « chrome/browser/devtools/adb_client_socket.cc ('k') | chrome/browser/devtools/devtools_adb_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698