Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: webkit/plugins/ppapi/ppb_transport_impl.cc

Issue 7621054: Don't use a scoped_refptr for StringVar::FromPPVar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/ppb_font_impl.cc ('k') | webkit/plugins/ppapi/ppb_uma_private_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 next_address_callback_ = new TrackedCompletionCallback( 136 next_address_callback_ = new TrackedCompletionCallback(
137 instance()->module()->GetCallbackTracker(), pp_resource(), callback); 137 instance()->module()->GetCallbackTracker(), pp_resource(), callback);
138 return PP_OK_COMPLETIONPENDING; 138 return PP_OK_COMPLETIONPENDING;
139 } 139 }
140 140
141 int32_t PPB_Transport_Impl::ReceiveRemoteAddress(PP_Var address) { 141 int32_t PPB_Transport_Impl::ReceiveRemoteAddress(PP_Var address) {
142 if (!p2p_transport_.get()) 142 if (!p2p_transport_.get())
143 return PP_ERROR_FAILED; 143 return PP_ERROR_FAILED;
144 144
145 scoped_refptr<StringVar> address_str = StringVar::FromPPVar(address); 145 StringVar* address_str = StringVar::FromPPVar(address);
146 if (!address_str) 146 if (!address_str)
147 return PP_ERROR_BADARGUMENT; 147 return PP_ERROR_BADARGUMENT;
148 148
149 return p2p_transport_->AddRemoteCandidate(address_str->value()) ? 149 return p2p_transport_->AddRemoteCandidate(address_str->value()) ?
150 PP_OK : PP_ERROR_FAILED; 150 PP_OK : PP_ERROR_FAILED;
151 } 151 }
152 152
153 int32_t PPB_Transport_Impl::Recv(void* data, uint32_t len, 153 int32_t PPB_Transport_Impl::Recv(void* data, uint32_t len,
154 PP_CompletionCallback callback) { 154 PP_CompletionCallback callback) {
155 if (!p2p_transport_.get()) 155 if (!p2p_transport_.get())
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 void PPB_Transport_Impl::OnWritten(int result) { 246 void PPB_Transport_Impl::OnWritten(int result) {
247 DCHECK(send_callback_.get() && !send_callback_->completed()); 247 DCHECK(send_callback_.get() && !send_callback_->completed());
248 248
249 scoped_refptr<TrackedCompletionCallback> callback; 249 scoped_refptr<TrackedCompletionCallback> callback;
250 callback.swap(send_callback_); 250 callback.swap(send_callback_);
251 callback->Run(MapNetError(result)); 251 callback->Run(MapNetError(result));
252 } 252 }
253 253
254 } // namespace ppapi 254 } // namespace ppapi
255 } // namespace webkit 255 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_font_impl.cc ('k') | webkit/plugins/ppapi/ppb_uma_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698