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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 561943002: Reland: Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS test failures Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 void BrowserProcessImpl::CreateGCMDriver() { 1128 void BrowserProcessImpl::CreateGCMDriver() {
1129 DCHECK(!gcm_driver_); 1129 DCHECK(!gcm_driver_);
1130 1130
1131 #if defined(OS_ANDROID) 1131 #if defined(OS_ANDROID)
1132 gcm_driver_.reset(new gcm::GCMDriverAndroid); 1132 gcm_driver_.reset(new gcm::GCMDriverAndroid);
1133 #else 1133 #else
1134 base::FilePath store_path; 1134 base::FilePath store_path;
1135 CHECK(PathService::Get(chrome::DIR_GLOBAL_GCM_STORE, &store_path)); 1135 CHECK(PathService::Get(chrome::DIR_GLOBAL_GCM_STORE, &store_path));
1136 gcm_driver_ = gcm::CreateGCMDriverDesktop( 1136 gcm_driver_ = gcm::CreateGCMDriverDesktop(
1137 make_scoped_ptr(new gcm::GCMClientFactory), 1137 make_scoped_ptr(new gcm::GCMClientFactory),
1138 local_state(),
1138 store_path, 1139 store_path,
1139 system_request_context()); 1140 system_request_context());
1140 // Sign-in is not required for device-level GCM usage. So we just call 1141 // Sign-in is not required for device-level GCM usage. So we just call
1141 // OnSignedIn to assume always signed-in. Note that GCM will not be started 1142 // OnSignedIn to assume always signed-in. Note that GCM will not be started
1142 // at this point since no one has asked for it yet. 1143 // at this point since no one has asked for it yet.
1143 // TODO(jianli): To be removed when sign-in enforcement is dropped. 1144 // TODO(jianli): To be removed when sign-in enforcement is dropped.
1144 gcm_driver_->OnSignedIn(); 1145 gcm_driver_->OnSignedIn();
1145 #endif // defined(OS_ANDROID) 1146 #endif // defined(OS_ANDROID)
1146 } 1147 }
1147 1148
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 } 1219 }
1219 1220
1220 void BrowserProcessImpl::OnAutoupdateTimer() { 1221 void BrowserProcessImpl::OnAutoupdateTimer() {
1221 if (CanAutorestartForUpdate()) { 1222 if (CanAutorestartForUpdate()) {
1222 DLOG(WARNING) << "Detected update. Restarting browser."; 1223 DLOG(WARNING) << "Detected update. Restarting browser.";
1223 RestartBackgroundInstance(); 1224 RestartBackgroundInstance();
1224 } 1225 }
1225 } 1226 }
1226 1227
1227 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1228 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698