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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_DATA_CHANNEL_H_ 5 #ifndef COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_DATA_CHANNEL_H_
6 #define COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_DATA_CHANNEL_H_ 6 #define COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_DATA_CHANNEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace devtools_bridge { 13 namespace devtools_bridge {
14 14
15 /** 15 /**
16 * WebRTC DataChannel adapter for DevTools bridge. 16 * WebRTC DataChannel adapter for DevTools bridge. Not thread safe.
17 */ 17 */
18 class AbstractDataChannel { 18 class AbstractDataChannel {
19 public: 19 public:
20 AbstractDataChannel() {} 20 AbstractDataChannel() {}
21 virtual ~AbstractDataChannel() {} 21 virtual ~AbstractDataChannel() {}
22 22
23 // TODO(serya): Implement 23 /**
24 * Called on WebRTC signaling thread.
25 */
26 class Observer {
27 public:
28 Observer() {}
29 virtual ~Observer() {}
30
31 virtual void OnOpen() = 0;
32 virtual void OnClose() = 0;
33
34 virtual void OnMessage(const void* data, size_t length) = 0;
35
36 private:
37 DISALLOW_COPY_AND_ASSIGN(Observer);
38 };
39
40 virtual void RegisterObserver(scoped_ptr<Observer> observer) = 0;
41 virtual void UnregisterObserver() = 0;
42
43 virtual void SendBinaryMessage(void* data, size_t length) = 0;
44 virtual void SendTextMessage(void* data, size_t length) = 0;
45
46 virtual void Close() = 0;
24 47
25 private: 48 private:
26 DISALLOW_COPY_AND_ASSIGN(AbstractDataChannel); 49 DISALLOW_COPY_AND_ASSIGN(AbstractDataChannel);
27 }; 50 };
28 51
29 } // namespace devtools_bridge 52 } // namespace devtools_bridge
30 53
31 #endif // COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_DATA_CHANNEL_H_ 54 #endif // COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_DATA_CHANNEL_H_
OLDNEW
« 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