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

Side by Side Diff: content/renderer/pepper/pepper_video_source_host.cc

Issue 16256018: Update content/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrectly modified code Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/renderer/pepper/pepper_video_source_host.h" 5 #include "content/renderer/pepper/pepper_video_source_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/safe_numerics.h" 8 #include "base/safe_numerics.h"
9 #include "content/public/renderer/renderer_ppapi_host.h" 9 #include "content/public/renderer/renderer_ppapi_host.h"
10 #include "content/renderer/render_thread_impl.h" 10 #include "content/renderer/render_thread_impl.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 FROM_HERE, 43 FROM_HERE,
44 base::Bind(&FrameReceiver::OnGotFrame, 44 base::Bind(&FrameReceiver::OnGotFrame,
45 this, 45 this,
46 base::Passed(scoped_ptr<cricket::VideoFrame>(frame)))); 46 base::Passed(scoped_ptr<cricket::VideoFrame>(frame))));
47 47
48 return true; 48 return true;
49 } 49 }
50 50
51 void PepperVideoSourceHost::FrameReceiver::OnGotFrame( 51 void PepperVideoSourceHost::FrameReceiver::OnGotFrame(
52 scoped_ptr<cricket::VideoFrame> frame) { 52 scoped_ptr<cricket::VideoFrame> frame) {
53 if (host_) { 53 if (host_.get()) {
54 // Take ownership of the new frame, and possibly delete any unsent one. 54 // Take ownership of the new frame, and possibly delete any unsent one.
55 host_->last_frame_.swap(frame); 55 host_->last_frame_.swap(frame);
56 56
57 if (host_->get_frame_pending_) 57 if (host_->get_frame_pending_)
58 host_->SendGetFrameReply(); 58 host_->SendGetFrameReply();
59 } 59 }
60 } 60 }
61 61
62 PepperVideoSourceHost::PepperVideoSourceHost( 62 PepperVideoSourceHost::PepperVideoSourceHost(
63 RendererPpapiHost* host, 63 RendererPpapiHost* host,
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 void PepperVideoSourceHost::Close() { 245 void PepperVideoSourceHost::Close() {
246 if (source_handler_.get() && !stream_url_.empty()) 246 if (source_handler_.get() && !stream_url_.empty())
247 source_handler_->Close(stream_url_, frame_receiver_.get()); 247 source_handler_->Close(stream_url_, frame_receiver_.get());
248 248
249 source_handler_.reset(NULL); 249 source_handler_.reset(NULL);
250 stream_url_.clear(); 250 stream_url_.clear();
251 } 251 }
252 252
253 } // namespace content 253 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698