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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_child_frame.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/frame_host/render_widget_host_view_child_frame.h" 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 frame_size != current_surface_size_ || 378 frame_size != current_surface_size_ ||
379 scale_factor != current_surface_scale_factor_) { 379 scale_factor != current_surface_scale_factor_) {
380 ClearCompositorSurfaceIfNecessary(); 380 ClearCompositorSurfaceIfNecessary();
381 last_output_surface_id_ = output_surface_id; 381 last_output_surface_id_ = output_surface_id;
382 current_surface_size_ = frame_size; 382 current_surface_size_ = frame_size;
383 current_surface_scale_factor_ = scale_factor; 383 current_surface_scale_factor_ = scale_factor;
384 } 384 }
385 385
386 if (!surface_factory_) { 386 if (!surface_factory_) {
387 cc::SurfaceManager* manager = GetSurfaceManager(); 387 cc::SurfaceManager* manager = GetSurfaceManager();
388 surface_factory_ = base::WrapUnique(new cc::SurfaceFactory(manager, this)); 388 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(manager, this);
389 } 389 }
390 390
391 if (surface_id_.is_null()) { 391 if (surface_id_.is_null()) {
392 surface_id_ = id_allocator_->GenerateId(); 392 surface_id_ = id_allocator_->GenerateId();
393 surface_factory_->Create(surface_id_); 393 surface_factory_->Create(surface_id_);
394 394
395 cc::SurfaceSequence sequence = cc::SurfaceSequence( 395 cc::SurfaceSequence sequence = cc::SurfaceSequence(
396 id_allocator_->client_id(), next_surface_sequence_++); 396 id_allocator_->client_id(), next_surface_sequence_++);
397 // The renderer process will satisfy this dependency when it creates a 397 // The renderer process will satisfy this dependency when it creates a
398 // SurfaceLayer. 398 // SurfaceLayer.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 } 564 }
565 565
566 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface( 566 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface(
567 const gfx::Rect& src_subrect, 567 const gfx::Rect& src_subrect,
568 const gfx::Size& output_size, 568 const gfx::Size& output_size,
569 const ReadbackRequestCallback& callback, 569 const ReadbackRequestCallback& callback,
570 const SkColorType preferred_color_type) { 570 const SkColorType preferred_color_type) {
571 if (!IsSurfaceAvailableForCopy()) { 571 if (!IsSurfaceAvailableForCopy()) {
572 // Defer submitting the copy request until after a frame is drawn, at which 572 // Defer submitting the copy request until after a frame is drawn, at which
573 // point we should be guaranteed that the surface is available. 573 // point we should be guaranteed that the surface is available.
574 RegisterFrameSwappedCallback(base::WrapUnique(new base::Closure(base::Bind( 574 RegisterFrameSwappedCallback(base::MakeUnique<base::Closure>(base::Bind(
575 &RenderWidgetHostViewChildFrame::SubmitSurfaceCopyRequest, AsWeakPtr(), 575 &RenderWidgetHostViewChildFrame::SubmitSurfaceCopyRequest, AsWeakPtr(),
576 src_subrect, output_size, callback, preferred_color_type)))); 576 src_subrect, output_size, callback, preferred_color_type)));
577 return; 577 return;
578 } 578 }
579 579
580 SubmitSurfaceCopyRequest(src_subrect, output_size, callback, 580 SubmitSurfaceCopyRequest(src_subrect, output_size, callback,
581 preferred_color_type); 581 preferred_color_type);
582 } 582 }
583 583
584 void RenderWidgetHostViewChildFrame::SubmitSurfaceCopyRequest( 584 void RenderWidgetHostViewChildFrame::SubmitSurfaceCopyRequest(
585 const gfx::Rect& src_subrect, 585 const gfx::Rect& src_subrect,
586 const gfx::Size& output_size, 586 const gfx::Size& output_size,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 709
710 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { 710 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const {
711 return true; 711 return true;
712 } 712 }
713 713
714 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { 714 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const {
715 return surface_id_; 715 return surface_id_;
716 }; 716 };
717 717
718 } // namespace content 718 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.cc ('k') | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698