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

Unified Diff: ios/chrome/browser/application_context_impl.cc

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: Address nits Created 4 years, 4 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 | « google_apis/gcm/engine/unregistration_request_unittest.cc ('k') | net/test/gtest_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/application_context_impl.cc
diff --git a/ios/chrome/browser/application_context_impl.cc b/ios/chrome/browser/application_context_impl.cc
index 4f7ace27c42356a3cf80bf31b99e06da561a19dd..567118744663ea4b607061db25517decb5b97e3c 100644
--- a/ios/chrome/browser/application_context_impl.cc
+++ b/ios/chrome/browser/application_context_impl.cc
@@ -338,6 +338,19 @@ void ApplicationContextImpl::CreateGCMDriver() {
base::FilePath store_path;
CHECK(PathService::Get(ios::DIR_GLOBAL_GCM_STORE, &store_path));
+
+// These strings must never change during the lifetime of a Chrome install,
+// since e.g. to unregister an Instance ID token the same category must be
+// passed to FCM as was originally passed when registering it.
+#if defined(GOOGLE_CHROME_BUILD)
+ std::string channel = ::GetChannelString();
+ if (channel.empty())
+ channel = "stable";
+ std::string product_category_for_subtypes = "com.chrome." + channel + ".ios";
+#else
+ std::string product_category_for_subtypes = "org.chromium.unknown.ios";
+#endif
+
base::SequencedWorkerPool* worker_pool = web::WebThread::GetBlockingPool();
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
@@ -347,6 +360,7 @@ void ApplicationContextImpl::CreateGCMDriver() {
gcm_driver_ = gcm::CreateGCMDriverDesktop(
base::WrapUnique(new gcm::GCMClientFactory), GetLocalState(), store_path,
GetSystemURLRequestContext(), ::GetChannel(),
+ product_category_for_subtypes,
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
blocking_task_runner);
« no previous file with comments | « google_apis/gcm/engine/unregistration_request_unittest.cc ('k') | net/test/gtest_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698