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

Unified Diff: chrome/browser/task_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, 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_manager.cc
===================================================================
--- chrome/browser/task_manager.cc (revision 30650)
+++ chrome/browser/task_manager.cc (working copy)
@@ -13,8 +13,8 @@
#include "base/string_util.h"
#include "base/thread.h"
#include "chrome/browser/browser_list.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_window.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/net/url_request_tracking.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
@@ -436,10 +436,10 @@
// Register jobs notifications so we can compute network usage (it must be
// done from the IO thread).
- base::Thread* thread = g_browser_process->io_thread();
- if (thread)
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &TaskManagerModel::RegisterForJobDoneNotifications));
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ this, &TaskManagerModel::RegisterForJobDoneNotifications));
// Notify resource providers that we are updating.
for (ResourceProviderList::iterator iter = providers_.begin();
@@ -459,10 +459,10 @@
}
// Unregister jobs notification (must be done from the IO thread).
- base::Thread* thread = g_browser_process->io_thread();
- if (thread)
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &TaskManagerModel::UnregisterForJobDoneNotifications));
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ this, &TaskManagerModel::UnregisterForJobDoneNotifications));
}
void TaskManagerModel::AddResourceProvider(
« no previous file with comments | « chrome/browser/tab_contents/web_contents_unittest.cc ('k') | chrome/browser/task_manager_resource_providers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698