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

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

Issue 2878113002: mus: Embedder can request and observe BeginFrame for embedded client. (Closed)
Patch Set: . Created 3 years, 7 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) { 648 void RenderWidgetHostViewAura::SetNeedsBeginFrames(bool needs_begin_frames) {
649 needs_begin_frames_ = needs_begin_frames; 649 needs_begin_frames_ = needs_begin_frames;
650 UpdateNeedsBeginFramesInternal(); 650 UpdateNeedsBeginFramesInternal();
651 } 651 }
652 652
653 void RenderWidgetHostViewAura::OnSetNeedsFlushInput() { 653 void RenderWidgetHostViewAura::OnSetNeedsFlushInput() {
654 needs_flush_input_ = true; 654 needs_flush_input_ = true;
655 UpdateNeedsBeginFramesInternal(); 655 UpdateNeedsBeginFramesInternal();
656 } 656 }
657 657
658 void RenderWidgetHostViewAura::OnBeginFrame( 658 void RenderWidgetHostViewAura::OnBeginFrame(const cc::BeginFrameArgs& args) {
659 const cc::BeginFrameArgs& args) {
660 needs_flush_input_ = false; 659 needs_flush_input_ = false;
661 host_->FlushInput(); 660 host_->FlushInput();
662 UpdateNeedsBeginFramesInternal(); 661 UpdateNeedsBeginFramesInternal();
663 host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args)); 662 if (!IsMus())
663 host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args));
664 } 664 }
665 665
666 RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() { 666 RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() {
667 RenderViewHost* rvh = RenderViewHost::From(host_); 667 RenderViewHost* rvh = RenderViewHost::From(host_);
668 if (!rvh) 668 if (!rvh)
669 return nullptr; 669 return nullptr;
670 FrameTreeNode* focused_frame = 670 FrameTreeNode* focused_frame =
671 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame(); 671 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame();
672 if (!focused_frame) 672 if (!focused_frame)
673 return nullptr; 673 return nullptr;
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 2380
2381 void RenderWidgetHostViewAura::SetPopupChild( 2381 void RenderWidgetHostViewAura::SetPopupChild(
2382 RenderWidgetHostViewAura* popup_child_host_view) { 2382 RenderWidgetHostViewAura* popup_child_host_view) {
2383 popup_child_host_view_ = popup_child_host_view; 2383 popup_child_host_view_ = popup_child_host_view;
2384 event_handler_->SetPopupChild( 2384 event_handler_->SetPopupChild(
2385 popup_child_host_view, 2385 popup_child_host_view,
2386 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2386 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2387 } 2387 }
2388 2388
2389 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { 2389 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() {
2390 if (!delegated_frame_host_) 2390 bool needs_begin_frames = needs_begin_frames_ || needs_flush_input_;
2391 if (delegated_frame_host_) {
2392 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames);
2391 return; 2393 return;
2392 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || 2394 }
2393 needs_flush_input_); 2395 if (!IsMus())
2396 return;
2397 window()->SetNeedsBeginFrames(
2398 needs_begin_frames_ || needs_flush_input_,
2399 base::Bind(&RenderWidgetHostViewAura::OnBeginFrame,
2400 weak_ptr_factory_.GetWeakPtr(), cc::BeginFrameArgs()));
Fady Samuel 2017/05/12 22:42:55 Maybe propagate the BeginFrameArgs from viz?
sadrul 2017/05/13 03:01:38 I considered doing that. The reasons I didn't are
2394 } 2401 }
2395 2402
2396 } // namespace content 2403 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698