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

Unified Diff: chrome/browser/notifications/desktop_notification_service.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
« no previous file with comments | « chrome/browser/net/dns_master_unittest.cc ('k') | chrome/browser/printing/print_dialog_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.cc
===================================================================
--- chrome/browser/notifications/desktop_notification_service.cc (revision 30650)
+++ chrome/browser/notifications/desktop_notification_service.cc (working copy)
@@ -8,7 +8,6 @@
#include "app/resource_bundle.h"
#include "base/thread.h"
#include "chrome/browser/browser_list.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_object_proxy.h"
@@ -76,12 +75,10 @@
if (!action_taken_)
UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Ignored", 1);
- base::Thread* io_thread = g_browser_process->io_thread();
- if (io_thread && io_thread->message_loop()) {
- io_thread->message_loop()->PostTask(FROM_HERE,
- new NotificationPermissionCallbackTask(process_id_, route_id_,
- callback_context_));
- }
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ new NotificationPermissionCallbackTask(
+ process_id_, route_id_, callback_context_));
delete this;
}
@@ -181,13 +178,11 @@
prefs->ScheduleSavePersistentPrefs();
// Schedule a cache update on the IO thread.
- base::Thread* io_thread = g_browser_process->io_thread();
- if (io_thread && io_thread->message_loop()) {
- io_thread->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(prefs_cache_.get(),
- &NotificationsPrefsCache::CacheAllowedOrigin,
- origin));
- }
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ prefs_cache_.get(), &NotificationsPrefsCache::CacheAllowedOrigin,
+ origin));
}
void DesktopNotificationService::DenyPermission(const GURL& origin) {
@@ -204,13 +199,11 @@
prefs->ScheduleSavePersistentPrefs();
// Schedule a cache update on the IO thread.
- base::Thread* io_thread = g_browser_process->io_thread();
- if (io_thread && io_thread->message_loop()) {
- io_thread->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(prefs_cache_.get(),
- &NotificationsPrefsCache::CacheDeniedOrigin,
- origin));
- }
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ prefs_cache_.get(), &NotificationsPrefsCache::CacheDeniedOrigin,
+ origin));
}
void DesktopNotificationService::RequestPermission(
« no previous file with comments | « chrome/browser/net/dns_master_unittest.cc ('k') | chrome/browser/printing/print_dialog_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698