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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h

Issue 2464853002: Add crash keys to TaskQueueManager::ProcessTaskFromWorkQueue (Closed)
Patch Set: Added missing periods Created 4 years, 1 month 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_BASE_TASK_QUEUE_MANAGER_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class BLINK_PLATFORM_EXPORT TaskQueueManager 55 class BLINK_PLATFORM_EXPORT TaskQueueManager
56 : public internal::TaskQueueSelector::Observer, 56 : public internal::TaskQueueSelector::Observer,
57 public base::MessageLoop::NestingObserver { 57 public base::MessageLoop::NestingObserver {
58 public: 58 public:
59 // Create a task queue manager where |delegate| identifies the thread 59 // Create a task queue manager where |delegate| identifies the thread
60 // on which where the tasks are eventually run. Category strings must have 60 // on which where the tasks are eventually run. Category strings must have
61 // application lifetime (statics or literals). They may not include " chars. 61 // application lifetime (statics or literals). They may not include " chars.
62 TaskQueueManager(scoped_refptr<TaskQueueManagerDelegate> delegate, 62 TaskQueueManager(scoped_refptr<TaskQueueManagerDelegate> delegate,
63 const char* tracing_category, 63 const char* tracing_category,
64 const char* disabled_by_default_tracing_category, 64 const char* disabled_by_default_tracing_category,
65 const char* disabled_by_default_verbose_tracing_category); 65 const char* disabled_by_default_verbose_tracing_category,
66 bool set_crash_keys = false);
66 ~TaskQueueManager() override; 67 ~TaskQueueManager() override;
67 68
68 // Requests that a task to process work is posted on the main task runner. 69 // Requests that a task to process work is posted on the main task runner.
69 // These tasks are de-duplicated in two buckets: main-thread and all other 70 // These tasks are de-duplicated in two buckets: main-thread and all other
70 // threads. This distinction is done to reduce the overehead from locks, we 71 // threads. This distinction is done to reduce the overehead from locks, we
71 // assume the main-thread path will be hot. 72 // assume the main-thread path will be hot.
72 void MaybeScheduleImmediateWork(const tracked_objects::Location& from_here); 73 void MaybeScheduleImmediateWork(const tracked_objects::Location& from_here);
73 74
74 // Requests that a delayed task to process work is posted on the main task 75 // Requests that a delayed task to process work is posted on the main task
75 // runner. These delayed tasks are de-duplicated. Must be called on the thread 76 // runner. These delayed tasks are de-duplicated. Must be called on the thread
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 bool task_was_run_on_quiescence_monitored_queue_; 235 bool task_was_run_on_quiescence_monitored_queue_;
235 236
236 // To reduce locking overhead we track pending calls to DoWork separately for 237 // To reduce locking overhead we track pending calls to DoWork separately for
237 // the main thread and other threads. 238 // the main thread and other threads.
238 std::set<base::TimeTicks> main_thread_pending_wakeups_; 239 std::set<base::TimeTicks> main_thread_pending_wakeups_;
239 240
240 // Protects |other_thread_pending_wakeup_|. 241 // Protects |other_thread_pending_wakeup_|.
241 mutable base::Lock other_thread_lock_; 242 mutable base::Lock other_thread_lock_;
242 bool other_thread_pending_wakeup_; 243 bool other_thread_pending_wakeup_;
243 244
245 bool set_crash_keys_;
246
244 int work_batch_size_; 247 int work_batch_size_;
245 size_t task_count_; 248 size_t task_count_;
246 249
247 base::ObserverList<base::MessageLoop::TaskObserver> task_observers_; 250 base::ObserverList<base::MessageLoop::TaskObserver> task_observers_;
248 251
249 base::ObserverList<TaskTimeObserver> task_time_observers_; 252 base::ObserverList<TaskTimeObserver> task_time_observers_;
250 253
251 const char* tracing_category_; 254 const char* tracing_category_;
252 const char* disabled_by_default_tracing_category_; 255 const char* disabled_by_default_tracing_category_;
253 const char* disabled_by_default_verbose_tracing_category_; 256 const char* disabled_by_default_verbose_tracing_category_;
254 257
255 internal::TaskQueueImpl* currently_executing_task_queue_; // NOT OWNED 258 internal::TaskQueueImpl* currently_executing_task_queue_; // NOT OWNED
256 259
257 Observer* observer_; // NOT OWNED 260 Observer* observer_; // NOT OWNED
258 scoped_refptr<DeletionSentinel> deletion_sentinel_; 261 scoped_refptr<DeletionSentinel> deletion_sentinel_;
259 base::WeakPtrFactory<TaskQueueManager> weak_factory_; 262 base::WeakPtrFactory<TaskQueueManager> weak_factory_;
260 263
261 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); 264 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager);
262 }; 265 };
263 266
264 } // namespace scheduler 267 } // namespace scheduler
265 } // namespace blink 268 } // namespace blink
266 269
267 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_ H_ 270 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698