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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 292813007: Remove dependency on content::BrowserThread from GCMDriver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use SequencedTaskRunner Created 6 years, 7 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/services/gcm/gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 39283d9f31fbc060d24e3db7cb7c7c464518735a..eeda16cd66252e45f17b0fd67a73456c4019a3e6 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -19,6 +19,7 @@
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/signin/core/browser/signin_manager.h"
+#include "content/public/browser/browser_thread.h"
#include "google_apis/gaia/identity_provider.h"
#include "net/url_request/url_request_context_getter.h"
@@ -81,6 +82,13 @@ GCMProfileService::GCMProfileService(
: profile_(profile) {
DCHECK(!profile->IsOffTheRecord());
+ scoped_refptr<base::SequencedWorkerPool> worker_pool(
+ content::BrowserThread::GetBlockingPool());
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
+ worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
+ worker_pool->GetSequenceToken(),
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
+
#if defined(OS_ANDROID)
LoginUIService* login_ui_service = NULL;
#else
@@ -94,7 +102,12 @@ GCMProfileService::GCMProfileService(
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_),
login_ui_service)),
profile_->GetPath().Append(chrome::kGCMStoreDirname),
- profile_->GetRequestContext()));
+ profile_->GetRequestContext(),
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::UI),
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::IO),
+ blocking_task_runner));
}
GCMProfileService::GCMProfileService() : profile_(NULL) {

Powered by Google App Engine
This is Rietveld 408576698