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

Unified Diff: components/devtools_bridge/abstract_data_channel.h

Issue 719043002: Data channel implementation for SessionDependencyFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native-factory-2
Patch Set: Created 6 years, 1 month 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 | « no previous file | components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/SessionDependencyFactoryNative.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/devtools_bridge/abstract_data_channel.h
diff --git a/components/devtools_bridge/abstract_data_channel.h b/components/devtools_bridge/abstract_data_channel.h
index a297810f17c706b04b4ab8d8ec411585869ca0c2..43acc45d2f4f625cc831749419ba8f3606ad9801 100644
--- a/components/devtools_bridge/abstract_data_channel.h
+++ b/components/devtools_bridge/abstract_data_channel.h
@@ -13,14 +13,37 @@
namespace devtools_bridge {
/**
- * WebRTC DataChannel adapter for DevTools bridge.
+ * WebRTC DataChannel adapter for DevTools bridge. Not thread safe.
*/
class AbstractDataChannel {
public:
AbstractDataChannel() {}
virtual ~AbstractDataChannel() {}
- // TODO(serya): Implement
+ /**
+ * Called on WebRTC signaling thread.
+ */
+ class Observer {
+ public:
+ Observer() {}
+ virtual ~Observer() {}
+
+ virtual void OnOpen() = 0;
+ virtual void OnClose() = 0;
+
+ virtual void OnMessage(const void* data, size_t length) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Observer);
+ };
+
+ virtual void RegisterObserver(scoped_ptr<Observer> observer) = 0;
+ virtual void UnregisterObserver() = 0;
+
+ virtual void SendBinaryMessage(void* data, size_t length) = 0;
+ virtual void SendTextMessage(void* data, size_t length) = 0;
+
+ virtual void Close() = 0;
private:
DISALLOW_COPY_AND_ASSIGN(AbstractDataChannel);
« no previous file with comments | « no previous file | components/devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/SessionDependencyFactoryNative.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698