| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "webkit/glue/plugins/pepper_transport.h" | 5 #include "webkit/glue/plugins/pepper_transport.h" |
| 6 | 6 |
| 7 #include "base/singleton.h" | 7 #include "base/singleton.h" |
| 8 #include "base/thread_local.h" | 8 #include "base/thread_local.h" |
| 9 #include "third_party/ppapi/c/dev/ppb_transport_dev.h" | 9 #include "third_party/ppapi/c/dev/ppb_transport_dev.h" |
| 10 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 10 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
| 11 #include "webkit/glue/plugins/pepper_plugin_module.h" | 11 #include "webkit/glue/plugins/pepper_plugin_module.h" |
| 12 | 12 |
| 13 namespace pepper { | 13 namespace pepper { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // Creates a new transport object with the specified name | 17 // Creates a new transport object with the specified name |
| 18 // using the specified protocol. | 18 // using the specified protocol. |
| 19 PP_Resource CreateTransport(PP_Module module, | 19 PP_Resource CreateTransport(PP_Module module, |
| 20 const char* name, | 20 const char* name, |
| 21 const char* proto) { | 21 const char* proto) { |
| 22 // TODO(juberti): implement me | 22 // TODO(juberti): implement me |
| 23 PP_Resource p(NULL); | 23 PP_Resource p(0); |
| 24 return p; | 24 return p; |
| 25 } | 25 } |
| 26 | 26 |
| 27 // Returns whether or not resource is Transport | 27 // Returns whether or not resource is Transport |
| 28 bool IsTransport(PP_Resource resource) { | 28 bool IsTransport(PP_Resource resource) { |
| 29 return !!Resource::GetAs<Transport>(resource); | 29 return !!Resource::GetAs<Transport>(resource); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Returns whether the transport is currently writable | 32 // Returns whether the transport is currently writable |
| 33 // (i.e. can send data to the remote peer) | 33 // (i.e. can send data to the remote peer) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 61 PP_CompletionCallback cb) { | 61 PP_CompletionCallback cb) { |
| 62 // TODO(juberti): implement me | 62 // TODO(juberti): implement me |
| 63 return 0; | 63 return 0; |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 // Provides an ICE candidate address that was received | 67 // Provides an ICE candidate address that was received |
| 68 // from the remote peer. | 68 // from the remote peer. |
| 69 int32_t ReceiveRemoteAddress(PP_Resource transport, | 69 int32_t ReceiveRemoteAddress(PP_Resource transport, |
| 70 PP_Var address) { | 70 PP_Var address) { |
| 71 // TODO(juberti): impelement me | 71 // TODO(juberti): implement me |
| 72 return 0; | 72 return 0; |
| 73 } | 73 } |
| 74 | 74 |
| 75 | 75 |
| 76 // Like recv(), receives data. Returns PP_ERROR_WOULDBLOCK | 76 // Like recv(), receives data. Returns PP_ERROR_WOULDBLOCK |
| 77 // if there is currently no data to receive. | 77 // if there is currently no data to receive. |
| 78 int32_t Recv(PP_Resource transport, | 78 int32_t Recv(PP_Resource transport, |
| 79 void* data, | 79 void* data, |
| 80 uint32_t len, | 80 uint32_t len, |
| 81 PP_CompletionCallback cb) { | 81 PP_CompletionCallback cb) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool Transport::Init(const char* name, | 132 bool Transport::Init(const char* name, |
| 133 const char* proto) { | 133 const char* proto) { |
| 134 // TODO(juberti): impl | 134 // TODO(juberti): impl |
| 135 return false; | 135 return false; |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace pepper | 138 } // namespace pepper |
| 139 | 139 |
| OLD | NEW |