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

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

Issue 2711113003: Track whether a given user session has completed initialization, and use (Closed)
Patch Set: Added tests. Created 3 years, 10 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
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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); 635 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk");
636 content::BrowserContext::GetDefaultStoragePartition(this)-> 636 content::BrowserContext::GetDefaultStoragePartition(this)->
637 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); 637 GetDOMStorageContext()->SetSaveSessionStorageOnDisk();
638 638
639 // The DomDistillerViewerSource is not a normal WebUI so it must be registered 639 // The DomDistillerViewerSource is not a normal WebUI so it must be registered
640 // as a URLDataSource early. 640 // as a URLDataSource early.
641 dom_distiller::RegisterViewerSource(this); 641 dom_distiller::RegisterViewerSource(this);
642 642
643 #if defined(OS_CHROMEOS) 643 #if defined(OS_CHROMEOS)
644 // Finished profile initialization - let the UserManager know so it can
645 // mark the session as initialized. Need to do this before we restart below
646 // so we don't get in a weird state where we restart before the session is
647 // marked as initialized and so try to initialize it again.
648 if (!chromeos::ProfileHelper::IsSigninProfile(this)) {
649 chromeos::ProfileHelper* profile_helper = chromeos::ProfileHelper::Get();
650 user_manager::UserManager::Get()->OnSessionInitialized(
651 profile_helper->GetUserByProfile(this));
652 }
653
644 if (chromeos::UserSessionManager::GetInstance() 654 if (chromeos::UserSessionManager::GetInstance()
645 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) { 655 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) {
646 return; 656 return;
647 } 657 }
648 #endif 658 #endif
649 659
650 if (delegate_) { 660 if (delegate_) {
651 TRACE_EVENT0("browser", "ProfileImpl::DoFileInit:DelegateOnProfileCreated") 661 TRACE_EVENT0("browser", "ProfileImpl::DoFileInit:DelegateOnProfileCreated")
652 delegate_->OnProfileCreated(this, true, IsNewProfile()); 662 delegate_->OnProfileCreated(this, true, IsNewProfile());
653 } 663 }
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1299 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1290 domain_reliability::DomainReliabilityService* service = 1300 domain_reliability::DomainReliabilityService* service =
1291 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1301 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1292 GetForBrowserContext(this); 1302 GetForBrowserContext(this);
1293 if (!service) 1303 if (!service)
1294 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); 1304 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>();
1295 1305
1296 return service->CreateMonitor( 1306 return service->CreateMonitor(
1297 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 1307 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
1298 } 1308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698