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

Side by Side Diff: ppapi/proxy/video_encoder_resource.cc

Issue 2254973004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « ppapi/proxy/flash_font_file_resource.cc ('k') | ppapi/proxy/vpn_provider_resource.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ppapi/proxy/video_encoder_resource.h" 5 #include "ppapi/proxy/video_encoder_resource.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (error) { 344 if (error) {
345 NotifyError(error); 345 NotifyError(error);
346 return; 346 return;
347 } 347 }
348 348
349 base::SharedMemoryHandle buffer_handle; 349 base::SharedMemoryHandle buffer_handle;
350 params.TakeSharedMemoryHandleAtIndex(0, &buffer_handle); 350 params.TakeSharedMemoryHandleAtIndex(0, &buffer_handle);
351 351
352 if (!buffer_manager_.SetBuffers( 352 if (!buffer_manager_.SetBuffers(
353 frame_count, frame_length, 353 frame_count, frame_length,
354 base::WrapUnique(new base::SharedMemory(buffer_handle, false)), 354 base::MakeUnique<base::SharedMemory>(buffer_handle, false), true)) {
355 true)) {
356 NotifyError(PP_ERROR_FAILED); 355 NotifyError(PP_ERROR_FAILED);
357 return; 356 return;
358 } 357 }
359 358
360 if (TrackedCallback::IsPending(get_video_frame_callback_)) 359 if (TrackedCallback::IsPending(get_video_frame_callback_))
361 TryWriteVideoFrame(); 360 TryWriteVideoFrame();
362 } 361 }
363 362
364 void VideoEncoderResource::OnPluginMsgEncodeReply( 363 void VideoEncoderResource::OnPluginMsgEncodeReply(
365 PP_Resource video_frame, 364 PP_Resource video_frame,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 for (VideoFrameMap::iterator it = video_frames_.begin(); 476 for (VideoFrameMap::iterator it = video_frames_.begin();
478 it != video_frames_.end(); ++it) { 477 it != video_frames_.end(); ++it) {
479 it->second->Invalidate(); 478 it->second->Invalidate();
480 it->second = nullptr; 479 it->second = nullptr;
481 } 480 }
482 video_frames_.clear(); 481 video_frames_.clear();
483 } 482 }
484 483
485 } // namespace proxy 484 } // namespace proxy
486 } // namespace ppapi 485 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/flash_font_file_resource.cc ('k') | ppapi/proxy/vpn_provider_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698