OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "chrome/browser/profile_manager.h" | 7 #include "chrome/browser/profile_manager.h" |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return *i; | 214 return *i; |
215 } | 215 } |
216 | 216 |
217 return NULL; | 217 return NULL; |
218 } | 218 } |
219 | 219 |
220 void ProfileManager::OnSuspend() { | 220 void ProfileManager::OnSuspend() { |
221 DCHECK(CalledOnValidThread()); | 221 DCHECK(CalledOnValidThread()); |
222 | 222 |
223 for (const_iterator i(begin()); i != end(); ++i) { | 223 for (const_iterator i(begin()); i != end(); ++i) { |
224 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 224 ChromeThread::PostTask( |
225 NewRunnableFunction(&ProfileManager::SuspendProfile, *i)); | 225 ChromeThread::IO, FROM_HERE, |
| 226 NewRunnableFunction(&ProfileManager::SuspendProfile, *i)); |
226 } | 227 } |
227 } | 228 } |
228 | 229 |
229 void ProfileManager::OnResume() { | 230 void ProfileManager::OnResume() { |
230 DCHECK(CalledOnValidThread()); | 231 DCHECK(CalledOnValidThread()); |
231 for (const_iterator i(begin()); i != end(); ++i) { | 232 for (const_iterator i(begin()); i != end(); ++i) { |
232 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 233 ChromeThread::PostTask( |
233 NewRunnableFunction(&ProfileManager::ResumeProfile, *i)); | 234 ChromeThread::IO, FROM_HERE, |
| 235 NewRunnableFunction(&ProfileManager::ResumeProfile, *i)); |
234 } | 236 } |
235 } | 237 } |
236 | 238 |
237 void ProfileManager::SuspendProfile(Profile* profile) { | 239 void ProfileManager::SuspendProfile(Profile* profile) { |
238 DCHECK(profile); | 240 DCHECK(profile); |
239 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 241 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
240 | 242 |
241 for (URLRequestJobTracker::JobIterator i = g_url_request_job_tracker.begin(); | 243 for (URLRequestJobTracker::JobIterator i = g_url_request_job_tracker.begin(); |
242 i != g_url_request_job_tracker.end(); ++i) | 244 i != g_url_request_job_tracker.end(); ++i) |
243 (*i)->Kill(); | 245 (*i)->Kill(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 312 |
311 return profile; | 313 return profile; |
312 } | 314 } |
313 | 315 |
314 // static | 316 // static |
315 std::wstring ProfileManager::CanonicalizeID(const std::wstring& id) { | 317 std::wstring ProfileManager::CanonicalizeID(const std::wstring& id) { |
316 std::wstring no_whitespace; | 318 std::wstring no_whitespace; |
317 TrimWhitespace(id, TRIM_ALL, &no_whitespace); | 319 TrimWhitespace(id, TRIM_ALL, &no_whitespace); |
318 return StringToLowerASCII(no_whitespace); | 320 return StringToLowerASCII(no_whitespace); |
319 } | 321 } |
OLD | NEW |