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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 PluginInstance* plugin_instance = | 62 PluginInstance* plugin_instance = |
63 ResourceHelper::GetPluginInstance(resource); | 63 ResourceHelper::GetPluginInstance(resource); |
64 if (!plugin_instance) | 64 if (!plugin_instance) |
65 return NULL; | 65 return NULL; |
66 return plugin_instance->container()->element().document().frame(); | 66 return plugin_instance->container()->element().document().frame(); |
67 } | 67 } |
68 | 68 |
69 } // namespace | 69 } // namespace |
70 | 70 |
71 PPB_Transport_Impl::PPB_Transport_Impl(PP_Instance instance) | 71 PPB_Transport_Impl::PPB_Transport_Impl(PP_Instance instance) |
72 : Resource(instance), | 72 : Resource(::ppapi::OBJECT_IS_IMPL, instance), |
73 type_(PP_TRANSPORTTYPE_DATAGRAM), | 73 type_(PP_TRANSPORTTYPE_DATAGRAM), |
74 started_(false), | 74 started_(false), |
75 writable_(false) { | 75 writable_(false) { |
76 } | 76 } |
77 | 77 |
78 PPB_Transport_Impl::~PPB_Transport_Impl() { | 78 PPB_Transport_Impl::~PPB_Transport_Impl() { |
79 } | 79 } |
80 | 80 |
81 // static | 81 // static |
82 PP_Resource PPB_Transport_Impl::Create(PP_Instance instance, | 82 PP_Resource PPB_Transport_Impl::Create(PP_Instance instance, |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 TrackedCallback::ClearAndRun(&recv_callback_, MapNetError(result)); | 395 TrackedCallback::ClearAndRun(&recv_callback_, MapNetError(result)); |
396 } | 396 } |
397 | 397 |
398 void PPB_Transport_Impl::OnWritten(int result) { | 398 void PPB_Transport_Impl::OnWritten(int result) { |
399 DCHECK(TrackedCallback::IsPending(send_callback_)); | 399 DCHECK(TrackedCallback::IsPending(send_callback_)); |
400 TrackedCallback::ClearAndRun(&send_callback_, MapNetError(result)); | 400 TrackedCallback::ClearAndRun(&send_callback_, MapNetError(result)); |
401 } | 401 } |
402 | 402 |
403 } // namespace ppapi | 403 } // namespace ppapi |
404 } // namespace webkit | 404 } // namespace webkit |
OLD | NEW |