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

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

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: explicit Created 3 years, 9 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_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 aura::WindowPortMus::Get(window_)->Embed( 1915 aura::WindowPortMus::Get(window_)->Embed(
1916 std::move(window_tree_client), 1916 std::move(window_tree_client),
1917 ui::mojom::kEmbedFlagEmbedderInterceptsEvents, 1917 ui::mojom::kEmbedFlagEmbedderInterceptsEvents,
1918 base::Bind(&EmbedCallback)); 1918 base::Bind(&EmbedCallback));
1919 } 1919 }
1920 1920
1921 void RenderWidgetHostViewAura::CreateDelegatedFrameHostClient() { 1921 void RenderWidgetHostViewAura::CreateDelegatedFrameHostClient() {
1922 if (IsMus()) 1922 if (IsMus())
1923 return; 1923 return;
1924 1924
1925 // GuestViews have two RenderWidgetHostViews and so we need to make sure
1926 // we don't have FrameSinkId collisions.
1927 // The FrameSinkId generated here must be unique with FrameSinkId allocated
1928 // in ContextFactoryPrivate.
1929 // TODO(crbug.com/685777): Centralize allocation in one place for easier
1930 // maintenance.
1931 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
1932 cc::FrameSinkId frame_sink_id = 1925 cc::FrameSinkId frame_sink_id =
1933 is_guest_view_hack_ 1926 host_->AllocateFrameSinkId(is_guest_view_hack_);
1934 ? factory->GetContextFactoryPrivate()->AllocateFrameSinkId() 1927
1935 : cc::FrameSinkId(
1936 base::checked_cast<uint32_t>(host_->GetProcess()->GetID()),
1937 base::checked_cast<uint32_t>(host_->GetRoutingID()));
1938 // Tests may set |delegated_frame_host_client_|. 1928 // Tests may set |delegated_frame_host_client_|.
1939 if (!delegated_frame_host_client_) { 1929 if (!delegated_frame_host_client_) {
1940 delegated_frame_host_client_ = 1930 delegated_frame_host_client_ =
1941 base::MakeUnique<DelegatedFrameHostClientAura>(this); 1931 base::MakeUnique<DelegatedFrameHostClientAura>(this);
1942 } 1932 }
1943 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>( 1933 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>(
1944 frame_sink_id, delegated_frame_host_client_.get()); 1934 frame_sink_id, delegated_frame_host_client_.get());
1945 1935
1946 // Let the page-level input event router know about our surface ID 1936 // Let the page-level input event router know about our surface ID
1947 // namespace for surface-based hit testing. 1937 // namespace for surface-based hit testing.
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 2370
2381 void RenderWidgetHostViewAura::SetPopupChild( 2371 void RenderWidgetHostViewAura::SetPopupChild(
2382 RenderWidgetHostViewAura* popup_child_host_view) { 2372 RenderWidgetHostViewAura* popup_child_host_view) {
2383 popup_child_host_view_ = popup_child_host_view; 2373 popup_child_host_view_ = popup_child_host_view;
2384 event_handler_->SetPopupChild( 2374 event_handler_->SetPopupChild(
2385 popup_child_host_view, 2375 popup_child_host_view,
2386 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2376 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2387 } 2377 }
2388 2378
2389 } // namespace content 2379 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698