Chromium Code Reviews| Index: content/renderer/pepper/pepper_video_destination_host.cc | 
| diff --git a/content/renderer/pepper/pepper_video_destination_host.cc b/content/renderer/pepper/pepper_video_destination_host.cc | 
| index 5254374b1b0fbc5d7777af479cfb94dbac5091ca..c1e306a60e02433caa67fec311ebb51b0977828f 100644 | 
| --- a/content/renderer/pepper/pepper_video_destination_host.cc | 
| +++ b/content/renderer/pepper/pepper_video_destination_host.cc | 
| @@ -4,6 +4,8 @@ | 
| #include "content/renderer/pepper/pepper_video_destination_host.h" | 
| +#include <string> | 
| 
 
bbudge
2014/10/08 17:23:23
nit: this is included in the header now.
 
perkj_chrome
2014/10/08 18:37:37
Done.
 
 | 
| + | 
| #include "base/time/time.h" | 
| #include "content/public/renderer/renderer_ppapi_host.h" | 
| #include "content/renderer/pepper/ppb_image_data_impl.h" | 
| @@ -50,11 +52,9 @@ int32_t PepperVideoDestinationHost::OnHostMsgOpen( | 
| if (!gurl.is_valid()) | 
| return PP_ERROR_BADARGUMENT; | 
| - FrameWriterInterface* frame_writer = NULL; | 
| if (!VideoDestinationHandler::Open( | 
| - NULL /* registry */, gurl.spec(), &frame_writer)) | 
| + NULL /* registry */, gurl.spec(), &frame_writer_)) | 
| return PP_ERROR_FAILED; | 
| - frame_writer_.reset(frame_writer); | 
| ReplyMessageContext reply_context = context->MakeReplyMessageContext(); | 
| reply_context.params.set_result(PP_OK); | 
| @@ -66,6 +66,7 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame( | 
| HostMessageContext* context, | 
| const ppapi::HostResource& image_data_resource, | 
| PP_TimeTicks timestamp) { | 
| + TRACE_EVENT0("video", "PepperVideoDestinationHost::OnHostMsgPutFrame"); | 
| ppapi::thunk::EnterResourceNoLock<ppapi::thunk::PPB_ImageData_API> enter( | 
| image_data_resource.host_resource(), true); | 
| if (enter.failed()) | 
| @@ -77,7 +78,7 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame( | 
| image_data_impl->format())) | 
| return PP_ERROR_BADARGUMENT; | 
| - if (!frame_writer_.get()) | 
| + if (frame_writer_.is_null()) | 
| return PP_ERROR_FAILED; | 
| // Convert PP_TimeTicks (a double, in seconds) to a TimeDelta (int64, | 
| @@ -87,14 +88,14 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame( | 
| base::Time::FromDoubleT(timestamp) - base::Time(); | 
| int64_t timestamp_ns = | 
| time_delta.InMicroseconds() * base::Time::kNanosecondsPerMicrosecond; | 
| - frame_writer_->PutFrame(image_data_impl, timestamp_ns); | 
| + frame_writer_.Run(image_data_impl, timestamp_ns); | 
| return PP_OK; | 
| } | 
| int32_t PepperVideoDestinationHost::OnHostMsgClose( | 
| HostMessageContext* context) { | 
| - frame_writer_.reset(NULL); | 
| + frame_writer_.Reset(); | 
| return PP_OK; | 
| } |