OLD | NEW |
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 "chrome/test/base/testing_io_thread_state.h" | 5 #include "chrome/test/base/testing_io_thread_state.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/time/tick_clock.h" | 9 #include "base/time/tick_clock.h" |
10 #include "chrome/browser/io_thread.h" | 10 #include "chrome/browser/io_thread.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 io_thread_state_.reset(); | 73 io_thread_state_.reset(); |
74 | 74 |
75 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
76 chromeos::NetworkHandler::Shutdown(); | 76 chromeos::NetworkHandler::Shutdown(); |
77 chromeos::DBusThreadManager::Shutdown(); | 77 chromeos::DBusThreadManager::Shutdown(); |
78 #endif | 78 #endif |
79 } | 79 } |
80 | 80 |
81 void TestingIOThreadState::Initialize(const base::Closure& done) { | 81 void TestingIOThreadState::Initialize(const base::Closure& done) { |
82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 82 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
83 | 83 |
84 io_thread_state_->SetGlobalsForTesting(new IOThread::Globals()); | 84 io_thread_state_->SetGlobalsForTesting(new IOThread::Globals()); |
85 | 85 |
86 done.Run(); | 86 done.Run(); |
87 } | 87 } |
88 | 88 |
89 void TestingIOThreadState::Shutdown(const base::Closure& done) { | 89 void TestingIOThreadState::Shutdown(const base::Closure& done) { |
90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 90 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
91 | 91 |
92 delete io_thread_state_->globals(); | 92 delete io_thread_state_->globals(); |
93 io_thread_state_->SetGlobalsForTesting(NULL); | 93 io_thread_state_->SetGlobalsForTesting(NULL); |
94 done.Run(); | 94 done.Run(); |
95 } | 95 } |
96 | 96 |
97 } // namespace chrome | 97 } // namespace chrome |
OLD | NEW |