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

Unified Diff: net/http/http_auth_controller.h

Issue 3039028: Make HttpAuthController not reference counted. (Closed)
Patch Set: Created 10 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 | net/http/http_auth_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_controller.h
diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h
index 9bc8d59d5ee039b8725680be0eb843d0ad00194d..8499809b104cce4498abd5e429fe08ee375de2c8 100644
--- a/net/http/http_auth_controller.h
+++ b/net/http/http_auth_controller.h
@@ -25,13 +25,15 @@ class HttpNetworkSession;
class HttpRequestHeaders;
struct HttpRequestInfo;
-class HttpAuthController : public base::RefCounted<HttpAuthController> {
+class HttpAuthController {
public:
// The arguments are self explanatory except possibly for |auth_url|, which
// should be both the auth target and auth path in a single url argument.
HttpAuthController(HttpAuth::Target target, const GURL& auth_url,
scoped_refptr<HttpNetworkSession> session);
+ ~HttpAuthController();
+
// Generate an authentication token for |target| if necessary. The return
// value is a net error code. |OK| will be returned both in the case that
// a token is correctly generated synchronously, as well as when no tokens
@@ -53,9 +55,12 @@ class HttpAuthController : public base::RefCounted<HttpAuthController> {
bool establishing_tunnel,
const BoundNetLog& net_log);
- // Store the supplied credentials and prepare to restart the auth.
- virtual void ResetAuth(const std::wstring& username,
- const std::wstring& password);
+ // Store the supplied credentials.
+ virtual void SetCredentials(const std::wstring& username,
+ const std::wstring& password);
+
+ // Prepare to restart the auth.
+ virtual void PrepareForAuthRestart();
virtual bool HaveAuthHandler() const {
return handler_.get() != NULL;
@@ -65,6 +70,10 @@ class HttpAuthController : public base::RefCounted<HttpAuthController> {
return handler_.get() && !identity_.invalid;
}
+ virtual HttpAuth::Identity AuthIdentity() {
+ return identity_;
+ }
+
virtual scoped_refptr<AuthChallengeInfo> auth_info() {
return auth_info_;
}
@@ -72,10 +81,6 @@ class HttpAuthController : public base::RefCounted<HttpAuthController> {
virtual bool IsAuthSchemeDisabled(const std::string& scheme) const;
virtual void DisableAuthScheme(const std::string& scheme);
- protected: // So that we can mock this object.
- friend class base::RefCounted<HttpAuthController>;
- virtual ~HttpAuthController();
-
private:
// Searches the auth cache for an entry that encompasses the request's path.
// If such an entry is found, updates |identity_| and |handler_| with the
@@ -142,6 +147,8 @@ class HttpAuthController : public base::RefCounted<HttpAuthController> {
CompletionCallbackImpl<HttpAuthController> io_callback_;
CompletionCallback* user_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(HttpAuthController);
};
} // namespace net
« no previous file with comments | « no previous file | net/http/http_auth_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698