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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h

Issue 2890173002: EQT: Record the max queueing time from navigation start to navigation away (Closed)
Patch Set: flush hist in OnCommitProvitionalLoad Created 3 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_
7 7
8 #include "base/atomicops.h" 8 #include "base/atomicops.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/single_sample_metrics.h"
12 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
13 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
14 #include "base/trace_event/trace_log.h" 15 #include "base/trace_event/trace_log.h"
15 #include "device/base/synchronization/shared_memory_seqlock_buffer.h" 16 #include "device/base/synchronization/shared_memory_seqlock_buffer.h"
16 #include "platform/scheduler/base/pollable_thread_safe_flag.h" 17 #include "platform/scheduler/base/pollable_thread_safe_flag.h"
17 #include "platform/scheduler/base/queueing_time_estimator.h" 18 #include "platform/scheduler/base/queueing_time_estimator.h"
18 #include "platform/scheduler/base/task_time_observer.h" 19 #include "platform/scheduler/base/task_time_observer.h"
19 #include "platform/scheduler/base/thread_load_tracker.h" 20 #include "platform/scheduler/base/thread_load_tracker.h"
20 #include "platform/scheduler/child/idle_canceled_delayed_task_sweeper.h" 21 #include "platform/scheduler/child/idle_canceled_delayed_task_sweeper.h"
21 #include "platform/scheduler/child/idle_helper.h" 22 #include "platform/scheduler/child/idle_helper.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void DidHandleInputEventOnMainThread(const WebInputEvent& web_input_event, 102 void DidHandleInputEventOnMainThread(const WebInputEvent& web_input_event,
102 WebInputEventResult result) override; 103 WebInputEventResult result) override;
103 void DidAnimateForInputOnCompositorThread() override; 104 void DidAnimateForInputOnCompositorThread() override;
104 void OnRendererBackgrounded() override; 105 void OnRendererBackgrounded() override;
105 void OnRendererForegrounded() override; 106 void OnRendererForegrounded() override;
106 void SuspendRenderer() override; 107 void SuspendRenderer() override;
107 void ResumeRenderer() override; 108 void ResumeRenderer() override;
108 void AddPendingNavigation(NavigatingFrameType type) override; 109 void AddPendingNavigation(NavigatingFrameType type) override;
109 void RemovePendingNavigation(NavigatingFrameType type) override; 110 void RemovePendingNavigation(NavigatingFrameType type) override;
110 void OnNavigationStarted() override; 111 void OnNavigationStarted() override;
112 void OnCommitProvisionalLoad() override;
111 bool IsHighPriorityWorkAnticipated() override; 113 bool IsHighPriorityWorkAnticipated() override;
112 bool ShouldYieldForHighPriorityWork() override; 114 bool ShouldYieldForHighPriorityWork() override;
113 bool CanExceedIdleDeadlineIfRequired() const override; 115 bool CanExceedIdleDeadlineIfRequired() const override;
114 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; 116 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
115 void RemoveTaskObserver( 117 void RemoveTaskObserver(
116 base::MessageLoop::TaskObserver* task_observer) override; 118 base::MessageLoop::TaskObserver* task_observer) override;
117 void Shutdown() override; 119 void Shutdown() override;
118 void SuspendTimerQueue() override; 120 void SuspendTimerQueue() override;
119 void ResumeTimerQueue() override; 121 void ResumeTimerQueue() override;
120 void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) override; 122 void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) override;
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 369
368 // Helper for computing the use case. |expected_usecase_duration| will be 370 // Helper for computing the use case. |expected_usecase_duration| will be
369 // filled with the amount of time after which the use case should be updated 371 // filled with the amount of time after which the use case should be updated
370 // again. If the duration is zero, a new use case update should not be 372 // again. If the duration is zero, a new use case update should not be
371 // scheduled. Must be called with |any_thread_lock_| held. Can be called from 373 // scheduled. Must be called with |any_thread_lock_| held. Can be called from
372 // any thread. 374 // any thread.
373 UseCase ComputeCurrentUseCase( 375 UseCase ComputeCurrentUseCase(
374 base::TimeTicks now, 376 base::TimeTicks now,
375 base::TimeDelta* expected_use_case_duration) const; 377 base::TimeDelta* expected_use_case_duration) const;
376 378
379 std::unique_ptr<base::SingleSampleMetric> GetMaxQueueingTimeHistogram();
380
377 // An input event of some sort happened, the policy may need updating. 381 // An input event of some sort happened, the policy may need updating.
378 void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type, 382 void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type,
379 InputEventState input_event_state); 383 InputEventState input_event_state);
380 384
381 // Helpers for safely suspending/resuming the timer queue after a 385 // Helpers for safely suspending/resuming the timer queue after a
382 // background/foreground signal. 386 // background/foreground signal.
383 void SuspendTimerQueueWhenBackgrounded(); 387 void SuspendTimerQueueWhenBackgrounded();
384 void ResumeTimerQueueWhenForegroundedOrResumed(); 388 void ResumeTimerQueueWhenForegroundedOrResumed();
385 389
386 // The task cost estimators and the UserModel need to be reset upon page 390 // The task cost estimators and the UserModel need to be reset upon page
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 bool timer_tasks_seem_expensive; 489 bool timer_tasks_seem_expensive;
486 bool touchstart_expected_soon; 490 bool touchstart_expected_soon;
487 bool have_seen_a_begin_main_frame; 491 bool have_seen_a_begin_main_frame;
488 bool have_reported_blocking_intervention_in_current_policy; 492 bool have_reported_blocking_intervention_in_current_policy;
489 bool have_reported_blocking_intervention_since_navigation; 493 bool have_reported_blocking_intervention_since_navigation;
490 bool has_visible_render_widget_with_touch_handler; 494 bool has_visible_render_widget_with_touch_handler;
491 bool begin_frame_not_expected_soon; 495 bool begin_frame_not_expected_soon;
492 bool in_idle_period_for_testing; 496 bool in_idle_period_for_testing;
493 bool use_virtual_time; 497 bool use_virtual_time;
494 bool is_audio_playing; 498 bool is_audio_playing;
499 bool has_navigated;
500 std::unique_ptr<base::SingleSampleMetric> max_queueing_time_histogram;
Liquan (Max) Gu 2017/05/25 16:34:40 Is it better to call max_queueing_time_metric inst
tdresser 2017/05/25 19:43:38 Yup, I agree that's a better name.
Liquan (Max) Gu 2017/05/29 23:44:10 Done.
501 base::TimeDelta max_queueing_time;
495 std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned. 502 std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned.
496 RAILModeObserver* rail_mode_observer; // Not owned. 503 RAILModeObserver* rail_mode_observer; // Not owned.
497 WakeUpBudgetPool* wake_up_budget_pool; // Not owned. 504 WakeUpBudgetPool* wake_up_budget_pool; // Not owned.
498 std::array<base::TimeDelta, 505 std::array<base::TimeDelta,
499 static_cast<size_t>(TaskQueue::QueueType::COUNT)> 506 static_cast<size_t>(TaskQueue::QueueType::COUNT)>
500 unreported_task_duration; 507 unreported_task_duration;
501 base::HistogramBase* task_duration_per_queue_type_histogram; 508 base::HistogramBase* task_duration_per_queue_type_histogram;
502 }; 509 };
503 510
504 struct AnyThread { 511 struct AnyThread {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 578
572 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 579 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
573 580
574 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 581 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
575 }; 582 };
576 583
577 } // namespace scheduler 584 } // namespace scheduler
578 } // namespace blink 585 } // namespace blink
579 586
580 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU LER_IMPL_H_ 587 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU LER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698