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

Side by Side Diff: chrome/browser/profile_manager.cc

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/browser_render_process_host.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 (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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698