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

Unified Diff: webkit/plugins/ppapi/ppb_transport_impl.h

Issue 6478018: Basic implementation of Pepper Transport API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 10 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 | « webkit/glue/webkit_glue.gypi ('k') | webkit/plugins/ppapi/ppb_transport_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_transport_impl.h
diff --git a/webkit/plugins/ppapi/ppb_transport_impl.h b/webkit/plugins/ppapi/ppb_transport_impl.h
index 96169c717b3604da5745e0f9706ffb3c711fdd24..e631ce62039425a46e8f599a13da31f81983aded 100644
--- a/webkit/plugins/ppapi/ppb_transport_impl.h
+++ b/webkit/plugins/ppapi/ppb_transport_impl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -7,27 +7,69 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
-#include "ppapi/c/pp_instance.h"
-#include "webkit/plugins/ppapi/plugin_delegate.h"
+#include "ppapi/c/dev/ppb_transport_dev.h"
+#include "third_party/libjingle/source/talk/base/sigslot.h"
+#include "third_party/libjingle/source/talk/p2p/base/candidate.h"
+#include "webkit/plugins/ppapi/callbacks.h"
#include "webkit/plugins/ppapi/resource.h"
-struct PPB_Transport_Dev;
+namespace talk_base {
+class NetworkManager;
+} // namespace talk_base
+
+namespace cricket {
+class HttpPortAllocator;
+class P2PTransportChannel;
+class TransportChannel;
+class TransportChannelImpl;
+} // namespace cricket
namespace webkit {
namespace ppapi {
-class PPB_Transport_Impl : public Resource {
+class PPB_Transport_Impl : public Resource, public sigslot::has_slots<> {
public:
+ static const PPB_Transport_Dev* GetInterface();
+
explicit PPB_Transport_Impl(PluginInstance* instance);
virtual ~PPB_Transport_Impl();
- static const PPB_Transport_Dev* GetInterface();
+ bool Init(const char* name, const char* proto);
+
+ // Resource override.
virtual PPB_Transport_Impl* AsPPB_Transport_Impl();
- bool Init(const char* name,
- const char* proto);
+ bool IsWritable() const;
+ int32_t Connect(PP_CompletionCallback cb);
+ int32_t GetNextAddress(PP_Var* address, PP_CompletionCallback cb);
+ int32_t ReceiveRemoteAddress(PP_Var address);
+ int32_t Recv(void* data, uint32_t len, PP_CompletionCallback cb);
+ int32_t Send(const void* data, uint32_t len, PP_CompletionCallback cb);
+ int32_t Close();
private:
+ void OnRequestSignaling();
+ void OnCandidateReady(cricket::TransportChannelImpl* channel,
+ const cricket::Candidate& candidate);
+ void OnWriteableState(cricket::TransportChannel*);
+ void OnReadPacket(cricket::TransportChannel*, const char*, size_t);
+
+ bool Serialize(const cricket::Candidate& candidate, PP_Var* address);
+ bool Deserialize(PP_Var address, cricket::Candidate* candidate);
+
+ scoped_ptr<talk_base::NetworkManager> network_manager_;
+ scoped_ptr<cricket::HttpPortAllocator> allocator_;
+ scoped_ptr<cricket::P2PTransportChannel> channel_;
+ std::list<cricket::Candidate> local_candidates_;
+
+ scoped_refptr<TrackedCompletionCallback> connect_callback_;
+
+ scoped_refptr<TrackedCompletionCallback> next_address_callback_;
+
+ scoped_refptr<TrackedCompletionCallback> recv_callback_;
+ void* recv_buffer_;
+ uint32_t recv_buffer_size_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_Transport_Impl);
};
@@ -35,4 +77,3 @@ class PPB_Transport_Impl : public Resource {
} // namespace webkit
#endif // WEBKIT_PLUGINS_PPAPI_PPB_TRANSPORT_IMPL_H_
-
« no previous file with comments | « webkit/glue/webkit_glue.gypi ('k') | webkit/plugins/ppapi/ppb_transport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698