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

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

Issue 1231613005: Hook up the Push API with GCM's new ability to own encryption keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-encryption
Patch Set: Created 5 years, 5 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 17c0784247e1a10e989a1d5d981e72b0735e42c3..dc2bcc7e0555f38b9fece2005db4084e71068e14 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -9,11 +9,15 @@
#include "base/logging.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_constants.h"
#include "components/gcm_driver/gcm_driver.h"
#include "components/pref_registry/pref_registry_syncable.h"
#if defined(OS_ANDROID)
+#include "base/sequenced_task_runner.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "components/gcm_driver/gcm_driver_android.h"
+#include "content/public/browser/browser_thread.h"
#else
#include "base/bind.h"
#include "base/files/file_path.h"
@@ -23,7 +27,6 @@
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
-#include "chrome/common/chrome_constants.h"
#include "components/gcm_driver/gcm_channel_status_syncer.h"
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_driver_desktop.h"
@@ -153,7 +156,16 @@ GCMProfileService::GCMProfileService(Profile* profile)
}
debug_instance = this;
- driver_.reset(new GCMDriverAndroid);
+ 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));
+
+ driver_.reset(new GCMDriverAndroid(
+ profile_->GetPath().Append(chrome::kGCMStoreDirname),
+ blocking_task_runner));
}
#else
GCMProfileService::GCMProfileService(
« no previous file with comments | « chrome/browser/services/gcm/fake_gcm_profile_service.cc ('k') | chrome/test/data/push_messaging/push_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698