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

Side by Side Diff: webkit/glue/p2p_transport.h

Issue 6676101: Add P2PTransport interface in webkit_glue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_GLUE_P2P_TRANSPORT_H_
6 #define WEBKIT_GLUE_P2P_TRANSPORT_H_
7
8 #include <string>
9
10 namespace webkit_glue {
11
12 // Interface for P2P transport.
13 class P2PTransport {
14 public:
15 enum State {
16 STATE_NONE = 0,
17 STATE_WRITABLE = 1,
18 STATE_READABLE = 2,
19 };
20
21 class EventHandler {
22 public:
23 virtual ~EventHandler() {}
24
25 // Called for each local candidate.
26 virtual void OnCandidateReady(const std::string& address) = 0;
27
28 // Called when readable of writable state of the stream changes.
29 virtual void OnStateChange(State state) = 0;
30
31 // Callen when a message received from the peer.
32 virtual void OnMessageReceived(const char* data, size_t data_size) = 0;
brettw 2011/03/26 20:04:00 For this and the Send function below, can you clar
33 };
34
35 virtual ~P2PTransport() {}
36
37 // Initialize transport using specified configuration.
38 virtual void Init(const std::string& config,
39 EventHandler* event_handler) = 0;
40
41 // Add candidate received from the remote peer.
42 virtual void AddRemoteCandidate(const std::string& address) = 0;
43
44 // Send data to the other end.
45 virtual void Send(const char* data, int data_size) = 0;
46 };
47
48 } // namespace webkit_glue
49
50 #endif // WEBKIT_GLUE_P2P_TRANSPORT_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698