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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: explicit Created 3 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 stylus_text_selector_(this), 433 stylus_text_selector_(this),
434 using_browser_compositor_(CompositorImpl::IsInitialized()), 434 using_browser_compositor_(CompositorImpl::IsInitialized()),
435 synchronous_compositor_client_(nullptr), 435 synchronous_compositor_client_(nullptr),
436 frame_evictor_(new DelegatedFrameEvictor(this)), 436 frame_evictor_(new DelegatedFrameEvictor(this)),
437 observing_root_window_(false), 437 observing_root_window_(false),
438 weak_ptr_factory_(this) { 438 weak_ptr_factory_(this) {
439 // Set the layer which will hold the content layer for this view. The content 439 // Set the layer which will hold the content layer for this view. The content
440 // layer is managed by the DelegatedFrameHost. 440 // layer is managed by the DelegatedFrameHost.
441 view_.SetLayer(cc::Layer::Create()); 441 view_.SetLayer(cc::Layer::Create());
442 if (using_browser_compositor_) { 442 if (using_browser_compositor_) {
443 // This FrameSinkId must be unique with ContextProviderFactory's FrameSinkId 443 cc::FrameSinkId frame_sink_id =
444 // allocation. 444 host_->AllocateFrameSinkId(false /* is_guest_view_hack */);
445 // TODO(crbug.com/685777): Centralize allocation in one place for easier
446 // maintenance.
447 cc::FrameSinkId frame_sink_id = cc::FrameSinkId(
448 base::checked_cast<uint32_t>(host_->GetProcess()->GetID()),
449 base::checked_cast<uint32_t>(host_->GetRoutingID()));
450 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( 445 delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid(
451 &view_, cached_background_color_, this, frame_sink_id)); 446 &view_, cached_background_color_, this, frame_sink_id));
452 } 447 }
453 448
454 host_->SetView(this); 449 host_->SetView(this);
455 SetContentViewCore(content_view_core); 450 SetContentViewCore(content_view_core);
456 451
457 CreateOverscrollControllerIfPossible(); 452 CreateOverscrollControllerIfPossible();
458 453
459 if (GetTextInputManager()) 454 if (GetTextInputManager())
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); 1969 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor();
1975 if (!compositor) 1970 if (!compositor)
1976 return; 1971 return;
1977 1972
1978 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( 1973 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>(
1979 overscroll_refresh_handler, compositor, 1974 overscroll_refresh_handler, compositor,
1980 ui::GetScaleFactorForNativeView(GetNativeView())); 1975 ui::GetScaleFactorForNativeView(GetNativeView()));
1981 } 1976 }
1982 1977
1983 } // namespace content 1978 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698