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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 6260002: Fix chromium-os:10777 and other sync related crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 1241
1242 TokenService* ProfileImpl::GetTokenService() { 1242 TokenService* ProfileImpl::GetTokenService() {
1243 if (!token_service_.get()) { 1243 if (!token_service_.get()) {
1244 token_service_.reset(new TokenService()); 1244 token_service_.reset(new TokenService());
1245 } 1245 }
1246 return token_service_.get(); 1246 return token_service_.get();
1247 } 1247 }
1248 1248
1249 ProfileSyncService* ProfileImpl::GetProfileSyncService() { 1249 ProfileSyncService* ProfileImpl::GetProfileSyncService() {
1250 #if defined(OS_CHROMEOS) 1250 #if defined(OS_CHROMEOS)
1251 // If kLoginManager is specified, we shouldn't call this unless login has 1251 if (!sync_service_.get()) {
akalin 2011/01/13 04:15:02 Hmm. I'd rather callers explicitly check HasProfi
stevenjb 2011/01/13 18:00:49 Originally I added checks in the settings code, bu
1252 // completed and specified cros_user. Guard with if (HasProfileSyncService()) 1252 // In ChromeOS, we only want to initialize sync services explicitly from
1253 // where this might legitimately get called before login has completed. 1253 // the login code. Use HasProfileSyncService() to guard against this.
1254 if (!sync_service_.get() && 1254 return NULL;
1255 CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) {
1256 LOG(FATAL) << "GetProfileSyncService() called before login complete.";
1257 } 1255 }
1258 #endif 1256 #endif
1259 return GetProfileSyncService(""); 1257 return GetProfileSyncService("");
1260 } 1258 }
1261 1259
1262 ProfileSyncService* ProfileImpl::GetProfileSyncService( 1260 ProfileSyncService* ProfileImpl::GetProfileSyncService(
1263 const std::string& cros_user) { 1261 const std::string& cros_user) {
1264 1262
1265 if (!ProfileSyncService::IsSyncEnabled()) 1263 if (!ProfileSyncService::IsSyncEnabled())
1266 return NULL; 1264 return NULL;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1362 }
1365 1363
1366 PrerenderManager* ProfileImpl::GetPrerenderManager() { 1364 PrerenderManager* ProfileImpl::GetPrerenderManager() {
1367 CommandLine* cl = CommandLine::ForCurrentProcess(); 1365 CommandLine* cl = CommandLine::ForCurrentProcess();
1368 if (!cl->HasSwitch(switches::kEnablePagePrerender)) 1366 if (!cl->HasSwitch(switches::kEnablePagePrerender))
1369 return NULL; 1367 return NULL;
1370 if (!prerender_manager_) 1368 if (!prerender_manager_)
1371 prerender_manager_ = new PrerenderManager(this); 1369 prerender_manager_ = new PrerenderManager(this);
1372 return prerender_manager_; 1370 return prerender_manager_;
1373 } 1371 }
OLDNEW
« chrome/browser/dom_ui/dom_ui.h ('K') | « chrome/browser/dom_ui/options/sync_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698