| 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/plugins/ppapi/ppb_transport_impl.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 "ppapi/c/dev/ppb_transport_dev.h" | 9 #include "ppapi/c/dev/ppb_transport_dev.h" |
| 10 #include "webkit/glue/plugins/pepper_common.h" | 10 #include "webkit/plugins/ppapi/common.h" |
| 11 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 11 #include "webkit/plugins/ppapi/plugin_instance.h" |
| 12 #include "webkit/glue/plugins/pepper_plugin_module.h" | 12 #include "webkit/plugins/ppapi/plugin_module.h" |
| 13 | 13 |
| 14 namespace pepper { | 14 namespace webkit { |
| 15 namespace plugins { |
| 16 namespace ppapi { |
| 15 | 17 |
| 16 namespace { | 18 namespace { |
| 17 | 19 |
| 18 // Creates a new transport object with the specified name | 20 // Creates a new transport object with the specified name |
| 19 // using the specified protocol. | 21 // using the specified protocol. |
| 20 PP_Resource CreateTransport(PP_Module module, | 22 PP_Resource CreateTransport(PP_Module module, |
| 21 const char* name, | 23 const char* name, |
| 22 const char* proto) { | 24 const char* proto) { |
| 23 // TODO(juberti): implement me | 25 // TODO(juberti): implement me |
| 24 PP_Resource p(0); | 26 PP_Resource p(0); |
| 25 return p; | 27 return p; |
| 26 } | 28 } |
| 27 | 29 |
| 28 // Returns whether or not resource is Transport | 30 // Returns whether or not resource is PPB_Transport_Impl |
| 29 PP_Bool IsTransport(PP_Resource resource) { | 31 PP_Bool IsTransport(PP_Resource resource) { |
| 30 return BoolToPPBool(!!Resource::GetAs<Transport>(resource)); | 32 return BoolToPPBool(!!Resource::GetAs<PPB_Transport_Impl>(resource)); |
| 31 } | 33 } |
| 32 | 34 |
| 33 // Returns whether the transport is currently writable | 35 // Returns whether the transport is currently writable |
| 34 // (i.e. can send data to the remote peer) | 36 // (i.e. can send data to the remote peer) |
| 35 PP_Bool IsWritable(PP_Resource transport) { | 37 PP_Bool IsWritable(PP_Resource transport) { |
| 36 // TODO(juberti): impelement me | 38 // TODO(juberti): impelement me |
| 37 return PP_FALSE; | 39 return PP_FALSE; |
| 38 } | 40 } |
| 39 | 41 |
| 40 | 42 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 &Connect, | 112 &Connect, |
| 111 &GetNextAddress, | 113 &GetNextAddress, |
| 112 &ReceiveRemoteAddress, | 114 &ReceiveRemoteAddress, |
| 113 &Recv, | 115 &Recv, |
| 114 &Send, | 116 &Send, |
| 115 &Close, | 117 &Close, |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 } // namespace | 120 } // namespace |
| 119 | 121 |
| 120 Transport::Transport(PluginModule* module) | 122 PPB_Transport_Impl::PPB_Transport_Impl(PluginModule* module) |
| 121 : Resource(module) { | 123 : Resource(module) { |
| 122 // TODO(juberti): impl | 124 // TODO(juberti): impl |
| 123 } | 125 } |
| 124 | 126 |
| 125 const PPB_Transport_Dev* Transport::GetInterface() { | 127 const PPB_Transport_Dev* PPB_Transport_Impl::GetInterface() { |
| 126 return &ppb_transport; | 128 return &ppb_transport; |
| 127 } | 129 } |
| 128 | 130 |
| 129 Transport::~Transport() { | 131 PPB_Transport_Impl::~PPB_Transport_Impl() { |
| 130 // TODO(juberti): teardown | 132 // TODO(juberti): teardown |
| 131 } | 133 } |
| 132 | 134 |
| 133 bool Transport::Init(const char* name, | 135 PPB_Transport_Impl* PPB_Transport_Impl::AsTransport() { |
| 134 const char* proto) { | 136 return this; |
| 137 } |
| 138 |
| 139 bool PPB_Transport_Impl::Init(const char* name, const char* proto) { |
| 135 // TODO(juberti): impl | 140 // TODO(juberti): impl |
| 136 return false; | 141 return false; |
| 137 } | 142 } |
| 138 | 143 |
| 139 } // namespace pepper | 144 } // namespace ppapi |
| 145 } // namespace plugins |
| 146 } // namespace webkit |
| 140 | 147 |
| OLD | NEW |