OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/plugins/ppapi/ppb_transport_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_transport_impl.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 ResourceHelper::GetPluginInstance(resource); | 60 ResourceHelper::GetPluginInstance(resource); |
61 if (!plugin_instance) | 61 if (!plugin_instance) |
62 return NULL; | 62 return NULL; |
63 return plugin_instance->container()->element().document().frame(); | 63 return plugin_instance->container()->element().document().frame(); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 PPB_Transport_Impl::PPB_Transport_Impl(PP_Instance instance) | 68 PPB_Transport_Impl::PPB_Transport_Impl(PP_Instance instance) |
69 : Resource(instance), | 69 : Resource(instance), |
| 70 type_(PP_TRANSPORTTYPE_DATAGRAM), |
70 started_(false), | 71 started_(false), |
71 writable_(false) { | 72 writable_(false) { |
72 } | 73 } |
73 | 74 |
74 PPB_Transport_Impl::~PPB_Transport_Impl() { | 75 PPB_Transport_Impl::~PPB_Transport_Impl() { |
75 } | 76 } |
76 | 77 |
77 // static | 78 // static |
78 PP_Resource PPB_Transport_Impl::Create(PP_Instance instance, | 79 PP_Resource PPB_Transport_Impl::Create(PP_Instance instance, |
79 const char* name, | 80 const char* name, |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 void PPB_Transport_Impl::OnWritten(int result) { | 414 void PPB_Transport_Impl::OnWritten(int result) { |
414 DCHECK(send_callback_.get() && !send_callback_->completed()); | 415 DCHECK(send_callback_.get() && !send_callback_->completed()); |
415 | 416 |
416 scoped_refptr<TrackedCompletionCallback> callback; | 417 scoped_refptr<TrackedCompletionCallback> callback; |
417 callback.swap(send_callback_); | 418 callback.swap(send_callback_); |
418 callback->Run(MapNetError(result)); | 419 callback->Run(MapNetError(result)); |
419 } | 420 } |
420 | 421 |
421 } // namespace ppapi | 422 } // namespace ppapi |
422 } // namespace webkit | 423 } // namespace webkit |
OLD | NEW |