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

Side by Side Diff: content/public/test/test_browser_thread.cc

Issue 2873333004: Rename TaskRunner::RunsTasksOnCurrentThread() in //content (Closed)
Patch Set: Created 3 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/public/test/test_browser_thread.h" 5 #include "content/public/test/test_browser_thread.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // |impl_| have triggered the shutdown phase for its BrowserThread::ID. This 52 // |impl_| have triggered the shutdown phase for its BrowserThread::ID. This
53 // either happens when the thread is stopped (if real) or destroyed (when fake 53 // either happens when the thread is stopped (if real) or destroyed (when fake
54 // -- i.e. using an externally provided MessageLoop). 54 // -- i.e. using an externally provided MessageLoop).
55 impl_.reset(); 55 impl_.reset();
56 56
57 // Resets BrowserThreadImpl's globals so that |impl_| is no longer bound to 57 // Resets BrowserThreadImpl's globals so that |impl_| is no longer bound to
58 // |identifier_|. This is fine since the underlying MessageLoop has already 58 // |identifier_|. This is fine since the underlying MessageLoop has already
59 // been flushed and deleted in Stop(). In the case of an externally provided 59 // been flushed and deleted in Stop(). In the case of an externally provided
60 // MessageLoop however, this means that TaskRunners obtained through 60 // MessageLoop however, this means that TaskRunners obtained through
61 // |BrowserThreadImpl::GetTaskRunnerForThread(identifier_)| will no longer 61 // |BrowserThreadImpl::GetTaskRunnerForThread(identifier_)| will no longer
62 // recognize their BrowserThreadImpl for RunsTasksOnCurrentThread(). This 62 // recognize their BrowserThreadImpl for RunsTasksInCurrentSequence(). This
63 // happens most often when such verifications are made from 63 // happens most often when such verifications are made from
64 // MessageLoop::DestructionObservers. Callers that care to work around that 64 // MessageLoop::DestructionObservers. Callers that care to work around that
65 // should instead use this shutdown sequence: 65 // should instead use this shutdown sequence:
66 // 1) TestBrowserThread::Stop() 66 // 1) TestBrowserThread::Stop()
67 // 2) ~MessageLoop() 67 // 2) ~MessageLoop()
68 // 3) ~TestBrowserThread() 68 // 3) ~TestBrowserThread()
69 // (~TestBrowserThreadBundle() does this). 69 // (~TestBrowserThreadBundle() does this).
70 BrowserThreadImpl::ResetGlobalsForTesting(identifier_); 70 BrowserThreadImpl::ResetGlobalsForTesting(identifier_);
71 } 71 }
72 72
(...skipping 13 matching lines...) Expand all
86 86
87 void TestBrowserThread::Stop() { 87 void TestBrowserThread::Stop() {
88 impl_->Stop(); 88 impl_->Stop();
89 } 89 }
90 90
91 bool TestBrowserThread::IsRunning() { 91 bool TestBrowserThread::IsRunning() {
92 return impl_->IsRunning(); 92 return impl_->IsRunning();
93 } 93 }
94 94
95 } // namespace content 95 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_database_observer_impl.cc ('k') | content/renderer/media/media_permission_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698