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

Side by Side Diff: base/message_loop/message_loop.cc

Issue 2419803002: Disallow task observers on some BrowserThreads. (Closed)
Patch Set: Created 4 years, 2 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 | « base/message_loop/message_loop.h ('k') | content/browser/browser_thread_impl.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 bool MessageLoop::NestableTasksAllowed() const { 271 bool MessageLoop::NestableTasksAllowed() const {
272 return nestable_tasks_allowed_; 272 return nestable_tasks_allowed_;
273 } 273 }
274 274
275 bool MessageLoop::IsNested() { 275 bool MessageLoop::IsNested() {
276 return run_loop_->run_depth_ > 1; 276 return run_loop_->run_depth_ > 1;
277 } 277 }
278 278
279 void MessageLoop::AddTaskObserver(TaskObserver* task_observer) { 279 void MessageLoop::AddTaskObserver(TaskObserver* task_observer) {
280 DCHECK_EQ(this, current()); 280 DCHECK_EQ(this, current());
281 CHECK(allow_task_observers_);
281 task_observers_.AddObserver(task_observer); 282 task_observers_.AddObserver(task_observer);
282 } 283 }
283 284
284 void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) { 285 void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) {
285 DCHECK_EQ(this, current()); 286 DCHECK_EQ(this, current());
287 CHECK(allow_task_observers_);
286 task_observers_.RemoveObserver(task_observer); 288 task_observers_.RemoveObserver(task_observer);
287 } 289 }
288 290
289 bool MessageLoop::is_running() const { 291 bool MessageLoop::is_running() const {
290 DCHECK_EQ(this, current()); 292 DCHECK_EQ(this, current());
291 return run_loop_ != NULL; 293 return run_loop_ != NULL;
292 } 294 }
293 295
294 bool MessageLoop::HasHighResolutionTasks() { 296 bool MessageLoop::HasHighResolutionTasks() {
295 return incoming_task_queue_->HasHighResolutionTasks(); 297 return incoming_task_queue_->HasHighResolutionTasks();
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 persistent, 654 persistent,
653 mode, 655 mode,
654 controller, 656 controller,
655 delegate); 657 delegate);
656 } 658 }
657 #endif 659 #endif
658 660
659 #endif // !defined(OS_NACL_SFI) 661 #endif // !defined(OS_NACL_SFI)
660 662
661 } // namespace base 663 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_loop.h ('k') | content/browser/browser_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698