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

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

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nit Created 4 years, 5 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 : host_(RenderWidgetHostImpl::From(widget_host)), 43 : host_(RenderWidgetHostImpl::From(widget_host)),
44 next_surface_sequence_(1u), 44 next_surface_sequence_(1u),
45 last_output_surface_id_(0), 45 last_output_surface_id_(0),
46 current_surface_scale_factor_(1.f), 46 current_surface_scale_factor_(1.f),
47 ack_pending_count_(0), 47 ack_pending_count_(0),
48 frame_connector_(nullptr), 48 frame_connector_(nullptr),
49 begin_frame_source_(nullptr), 49 begin_frame_source_(nullptr),
50 observing_begin_frame_source_(false), 50 observing_begin_frame_source_(false),
51 parent_surface_client_id_(0), 51 parent_surface_client_id_(0),
52 weak_factory_(this) { 52 weak_factory_(this) {
53 id_allocator_ = CreateSurfaceIdAllocator(); 53 id_allocator_.reset(new cc::SurfaceIdAllocator(AllocateSurfaceClientId()));
54 GetSurfaceManager()->RegisterSurfaceClientId(id_allocator_->client_id());
54 RegisterSurfaceNamespaceId(); 55 RegisterSurfaceNamespaceId();
55 56
56 host_->SetView(this); 57 host_->SetView(this);
57 } 58 }
58 59
59 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { 60 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() {
60 if (!surface_id_.is_null()) 61 if (!surface_id_.is_null())
61 surface_factory_->Destroy(surface_id_); 62 surface_factory_->Destroy(surface_id_);
63
64 if (GetSurfaceManager())
65 GetSurfaceManager()->InvalidateSurfaceClientId(id_allocator_->client_id());
62 } 66 }
63 67
64 void RenderWidgetHostViewChildFrame::SetCrossProcessFrameConnector( 68 void RenderWidgetHostViewChildFrame::SetCrossProcessFrameConnector(
65 CrossProcessFrameConnector* frame_connector) { 69 CrossProcessFrameConnector* frame_connector) {
66 if (frame_connector_ == frame_connector) 70 if (frame_connector_ == frame_connector)
67 return; 71 return;
68 72
69 if (frame_connector_) { 73 if (frame_connector_) {
70 if (parent_surface_client_id_) { 74 if (parent_surface_client_id_) {
71 GetSurfaceManager()->UnregisterSurfaceNamespaceHierarchy( 75 GetSurfaceManager()->UnregisterSurfaceNamespaceHierarchy(
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 674
671 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { 675 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const {
672 return true; 676 return true;
673 } 677 }
674 678
675 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { 679 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const {
676 return surface_id_; 680 return surface_id_;
677 }; 681 };
678 682
679 } // namespace content 683 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/surface_utils.cc ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698