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

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

Issue 2791223002: Notify Blink to suppress frame requests during BeginMainFrame (Closed)
Patch Set: DCHECK update 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
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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 bool RenderWidget::IsClosing() const { 935 bool RenderWidget::IsClosing() const {
936 return host_closing_; 936 return host_closing_;
937 } 937 }
938 938
939 void RenderWidget::RequestScheduleAnimation() { 939 void RenderWidget::RequestScheduleAnimation() {
940 scheduleAnimation(); 940 scheduleAnimation();
941 } 941 }
942 942
943 void RenderWidget::UpdateVisualState() { 943 void RenderWidget::UpdateVisualState() {
944 GetWebWidget()->updateAllLifecyclePhases(); 944 GetWebWidget()->updateAllLifecyclePhases();
945 GetWebWidget()->setSuppressFrameRequestsWorkaroundFor704763Only(false);
945 946
946 if (time_to_first_active_paint_recorded_) 947 if (time_to_first_active_paint_recorded_)
947 return; 948 return;
948 949
949 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); 950 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
950 if (!render_thread_impl->NeedsToRecordFirstActivePaint()) 951 if (!render_thread_impl->NeedsToRecordFirstActivePaint())
951 return; 952 return;
952 953
953 time_to_first_active_paint_recorded_ = true; 954 time_to_first_active_paint_recorded_ = true;
954 base::TimeDelta sample = base::TimeTicks::Now() - was_shown_time_; 955 base::TimeDelta sample = base::TimeTicks::Now() - was_shown_time_;
955 UMA_HISTOGRAM_TIMES("PurgeAndSuspend.Experimental.TimeToFirstActivePaint", 956 UMA_HISTOGRAM_TIMES("PurgeAndSuspend.Experimental.TimeToFirstActivePaint",
956 sample); 957 sample);
957 } 958 }
958 959
959 void RenderWidget::WillBeginCompositorFrame() { 960 void RenderWidget::WillBeginCompositorFrame() {
960 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); 961 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame");
961 962
963 GetWebWidget()->setSuppressFrameRequestsWorkaroundFor704763Only(true);
964
962 // The UpdateTextInputState can result in further layout and possibly 965 // The UpdateTextInputState can result in further layout and possibly
963 // enable GPU acceleration so they need to be called before any painting 966 // enable GPU acceleration so they need to be called before any painting
964 // is done. 967 // is done.
965 UpdateTextInputState(); 968 UpdateTextInputState();
966 UpdateSelectionBounds(); 969 UpdateSelectionBounds();
967 970
968 for (auto& observer : render_frame_proxies_) 971 for (auto& observer : render_frame_proxies_)
969 observer.WillBeginCompositorFrame(); 972 observer.WillBeginCompositorFrame();
970 } 973 }
971 974
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2338 // browser side (https://crbug.com/669219). 2341 // browser side (https://crbug.com/669219).
2339 // If there is no WebFrameWidget, then there will be no 2342 // If there is no WebFrameWidget, then there will be no
2340 // InputMethodControllers for a WebLocalFrame. 2343 // InputMethodControllers for a WebLocalFrame.
2341 return nullptr; 2344 return nullptr;
2342 } 2345 }
2343 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2346 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2344 ->getActiveWebInputMethodController(); 2347 ->getActiveWebInputMethodController();
2345 } 2348 }
2346 2349
2347 } // namespace content 2350 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698