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