| Index: chrome/browser/profiles/profile_manager.cc
|
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
|
| index dbd03de133ba15f7c1654671880abc8d805d1f93..c30950a52ddb73253d471c5420dd65f3b0a36ae5 100644
|
| --- a/chrome/browser/profiles/profile_manager.cc
|
| +++ b/chrome/browser/profiles/profile_manager.cc
|
| @@ -32,45 +32,12 @@
|
| #include "net/url_request/url_request_context.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
| #include "net/url_request/url_request_job.h"
|
| -#include "net/url_request/url_request_job_tracker.h"
|
|
|
| #if defined(OS_CHROMEOS)
|
| #include "chrome/browser/chromeos/cros/cros_library.h"
|
| #include "chrome/browser/chromeos/cros/cryptohome_library.h"
|
| #endif
|
|
|
| -namespace {
|
| -
|
| -void SuspendURLRequestJobs() {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - for (net::URLRequestJobTracker::JobIterator i =
|
| - net::g_url_request_job_tracker.begin();
|
| - i != net::g_url_request_job_tracker.end(); ++i)
|
| - (*i)->Kill();
|
| -}
|
| -
|
| -void SuspendRequestContext(
|
| - net::URLRequestContextGetter* request_context_getter) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -
|
| - scoped_refptr<net::URLRequestContext> request_context =
|
| - request_context_getter->GetURLRequestContext();
|
| -
|
| - request_context->http_transaction_factory()->Suspend(true);
|
| -}
|
| -
|
| -void ResumeRequestContext(
|
| - net::URLRequestContextGetter* request_context_getter) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -
|
| - scoped_refptr<net::URLRequestContext> request_context =
|
| - request_context_getter->GetURLRequestContext();
|
| - request_context->http_transaction_factory()->Suspend(false);
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -
|
| bool ProfileManagerObserver::DeleteAfterCreation() {
|
| return false;
|
| }
|
| @@ -111,7 +78,6 @@ Profile* ProfileManager::GetDefaultProfile() {
|
| }
|
|
|
| ProfileManager::ProfileManager() : logged_in_(false) {
|
| - base::SystemMonitor::Get()->AddObserver(this);
|
| BrowserList::AddObserver(this);
|
| #if defined(OS_CHROMEOS)
|
| registrar_.Add(
|
| @@ -122,9 +88,6 @@ ProfileManager::ProfileManager() : logged_in_(false) {
|
| }
|
|
|
| ProfileManager::~ProfileManager() {
|
| - base::SystemMonitor* system_monitor = base::SystemMonitor::Get();
|
| - if (system_monitor)
|
| - system_monitor->RemoveObserver(this);
|
| BrowserList::RemoveObserver(this);
|
| }
|
|
|
| @@ -347,49 +310,6 @@ Profile* ProfileManager::GetProfileByPath(const FilePath& path) const {
|
| return (iter == profiles_info_.end()) ? NULL : iter->second->profile.get();
|
| }
|
|
|
| -void ProfileManager::OnSuspend() {
|
| - DCHECK(CalledOnValidThread());
|
| -
|
| - bool posted = BrowserThread::PostTask(
|
| - BrowserThread::IO, FROM_HERE,
|
| - NewRunnableFunction(&SuspendURLRequestJobs));
|
| - DCHECK(posted);
|
| -
|
| - scoped_refptr<net::URLRequestContextGetter> request_context;
|
| - std::vector<Profile*> profiles(GetLoadedProfiles());
|
| - for (size_t i = 0; i < profiles.size(); ++i) {
|
| - request_context = profiles[i]->GetRequestContext();
|
| - posted = BrowserThread::PostTask(
|
| - BrowserThread::IO, FROM_HERE,
|
| - NewRunnableFunction(&SuspendRequestContext, request_context));
|
| - DCHECK(posted);
|
| - request_context = profiles[i]->GetRequestContextForMedia();
|
| - posted = BrowserThread::PostTask(
|
| - BrowserThread::IO, FROM_HERE,
|
| - NewRunnableFunction(&SuspendRequestContext, request_context));
|
| - DCHECK(posted);
|
| - }
|
| -}
|
| -
|
| -void ProfileManager::OnResume() {
|
| - DCHECK(CalledOnValidThread());
|
| -
|
| - scoped_refptr<net::URLRequestContextGetter> request_context;
|
| - std::vector<Profile*> profiles(GetLoadedProfiles());
|
| - for (size_t i = 0; i < profiles.size(); ++i) {
|
| - request_context = profiles[i]->GetRequestContext();
|
| - bool posted = BrowserThread::PostTask(
|
| - BrowserThread::IO, FROM_HERE,
|
| - NewRunnableFunction(&ResumeRequestContext, request_context));
|
| - DCHECK(posted);
|
| - request_context = profiles[i]->GetRequestContextForMedia();
|
| - posted = BrowserThread::PostTask(
|
| - BrowserThread::IO, FROM_HERE,
|
| - NewRunnableFunction(&ResumeRequestContext, request_context));
|
| - DCHECK(posted);
|
| - }
|
| -}
|
| -
|
| void ProfileManager::Observe(
|
| NotificationType type,
|
| const NotificationSource& source,
|
|
|