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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 10735042: Revert 145969 - Removing last usage of default request context. Fixing up login_utils to not need i… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « no previous file | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/login_utils.cc
===================================================================
--- chrome/browser/chromeos/login/login_utils.cc (revision 145994)
+++ chrome/browser/chromeos/login/login_utils.cc (working copy)
@@ -73,7 +73,6 @@
#include "chromeos/dbus/session_manager_client.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_observer.h"
#include "googleurl/src/gurl.h"
#include "media/base/media_switches.h"
#include "net/base/network_change_notifier.h"
@@ -227,7 +226,6 @@
public OAuth1TokenFetcher::Delegate,
public OAuthLoginVerifier::Delegate,
public net::NetworkChangeNotifier::ConnectionTypeObserver,
- public content::NotificationObserver,
public base::SupportsWeakPtr<LoginUtilsImpl> {
public:
LoginUtilsImpl()
@@ -236,13 +234,8 @@
has_cookies_(false),
delegate_(NULL),
job_restart_request_(NULL),
- should_restore_auth_session_(false),
- url_request_context_getter_(NULL) {
+ should_restore_auth_session_(false) {
net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
- registrar_.Add(
- this,
- chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED,
- content::Source<Profile>(ProfileManager::GetDefaultProfile()));
}
virtual ~LoginUtilsImpl() {
@@ -293,11 +286,6 @@
virtual void OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
- // content::NotificationObserver overrides.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
protected:
virtual std::string GetOffTheRecordCommandLine(
const GURL& start_url,
@@ -366,12 +354,6 @@
// online state change.
bool should_restore_auth_session_;
- content::NotificationRegistrar registrar_;
-
- // This is set via a notification after the profile has initialized the
- // getter.
- net::URLRequestContextGetter* url_request_context_getter_;
-
DISALLOW_COPY_AND_ASSIGN(LoginUtilsImpl);
};
@@ -880,11 +862,9 @@
// We use a special class for this so that it can be safely leaked if we
// never connect. At shutdown the order is not well defined, and it's possible
// for the infrastructure needed to unregister might be unstable and crash.
-class WarmingObserver : public NetworkLibrary::NetworkManagerObserver,
- public content::NotificationObserver {
+class WarmingObserver : public NetworkLibrary::NetworkManagerObserver {
public:
- WarmingObserver()
- : url_request_context_getter_(NULL) {
+ WarmingObserver() {
NetworkLibrary *netlib = CrosLibrary::Get()->GetNetworkLibrary();
netlib->AddNetworkManagerObserver(this);
}
@@ -899,28 +879,11 @@
GURL(GaiaUrls::GetInstance()->client_login_url()),
chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED,
kConnectionsNeeded,
- url_request_context_getter_);
+ make_scoped_refptr(Profile::GetDefaultRequestContextDeprecated()));
netlib->RemoveNetworkManagerObserver(this);
delete this;
}
}
-
- // content::NotificationObserver overrides.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED: {
- Profile* profile = content::Source<Profile>(source).ptr();
- url_request_context_getter_ = profile->GetRequestContext();
- break;
- }
- default:
- NOTREACHED();
- }
-}
- private:
- net::URLRequestContextGetter* url_request_context_getter_;
};
void LoginUtilsImpl::PrewarmAuthentication() {
@@ -931,7 +894,7 @@
GURL(GaiaUrls::GetInstance()->client_login_url()),
chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED,
kConnectionsNeeded,
- url_request_context_getter_);
+ make_scoped_refptr(Profile::GetDefaultRequestContextDeprecated()));
} else {
new WarmingObserver();
}
@@ -1145,20 +1108,6 @@
}
}
-void LoginUtilsImpl::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED: {
- Profile* profile = content::Source<Profile>(source).ptr();
- url_request_context_getter_ = profile->GetRequestContext();
- break;
- }
- default:
- NOTREACHED();
- }
-}
-
// static
LoginUtils* LoginUtils::Get() {
return LoginUtilsWrapper::GetInstance()->get();
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698