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

Side by Side Diff: content/renderer/render_widget.cc

Issue 2813543003: Notify Blink to suppress frame requests during BeginMainFrame (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/PageAnimator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 bool RenderWidget::IsClosing() const { 934 bool RenderWidget::IsClosing() const {
935 return host_closing_; 935 return host_closing_;
936 } 936 }
937 937
938 void RenderWidget::RequestScheduleAnimation() { 938 void RenderWidget::RequestScheduleAnimation() {
939 scheduleAnimation(); 939 scheduleAnimation();
940 } 940 }
941 941
942 void RenderWidget::UpdateVisualState() { 942 void RenderWidget::UpdateVisualState() {
943 GetWebWidget()->updateAllLifecyclePhases(); 943 GetWebWidget()->updateAllLifecyclePhases();
944 GetWebWidget()->setSuppressFrameRequestsWorkaroundFor704763Only(false);
944 945
945 if (time_to_first_active_paint_recorded_) 946 if (time_to_first_active_paint_recorded_)
946 return; 947 return;
947 948
948 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); 949 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
949 if (!render_thread_impl->NeedsToRecordFirstActivePaint()) 950 if (!render_thread_impl->NeedsToRecordFirstActivePaint())
950 return; 951 return;
951 952
952 time_to_first_active_paint_recorded_ = true; 953 time_to_first_active_paint_recorded_ = true;
953 base::TimeDelta sample = base::TimeTicks::Now() - was_shown_time_; 954 base::TimeDelta sample = base::TimeTicks::Now() - was_shown_time_;
954 UMA_HISTOGRAM_TIMES("PurgeAndSuspend.Experimental.TimeToFirstActivePaint", 955 UMA_HISTOGRAM_TIMES("PurgeAndSuspend.Experimental.TimeToFirstActivePaint",
955 sample); 956 sample);
956 } 957 }
957 958
958 void RenderWidget::WillBeginCompositorFrame() { 959 void RenderWidget::WillBeginCompositorFrame() {
959 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); 960 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame");
960 961
962 GetWebWidget()->setSuppressFrameRequestsWorkaroundFor704763Only(true);
963
961 // The UpdateTextInputState can result in further layout and possibly 964 // The UpdateTextInputState can result in further layout and possibly
962 // enable GPU acceleration so they need to be called before any painting 965 // enable GPU acceleration so they need to be called before any painting
963 // is done. 966 // is done.
964 UpdateTextInputState(); 967 UpdateTextInputState();
965 UpdateSelectionBounds(); 968 UpdateSelectionBounds();
966 969
967 for (auto& observer : render_frame_proxies_) 970 for (auto& observer : render_frame_proxies_)
968 observer.WillBeginCompositorFrame(); 971 observer.WillBeginCompositorFrame();
969 } 972 }
970 973
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2323 // browser side (https://crbug.com/669219). 2326 // browser side (https://crbug.com/669219).
2324 // If there is no WebFrameWidget, then there will be no 2327 // If there is no WebFrameWidget, then there will be no
2325 // InputMethodControllers for a WebLocalFrame. 2328 // InputMethodControllers for a WebLocalFrame.
2326 return nullptr; 2329 return nullptr;
2327 } 2330 }
2328 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2331 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2329 ->getActiveWebInputMethodController(); 2332 ->getActiveWebInputMethodController();
2330 } 2333 }
2331 2334
2332 } // namespace content 2335 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/PageAnimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698