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

Side by Side Diff: net/http/http_auth_handler_mock.h

Issue 8990001: base::Bind: Convert most of net/http. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang. Created 9 years 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 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
6 #define NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ 6 #define NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 HttpAuthHandlerMock(); 60 HttpAuthHandlerMock();
61 61
62 virtual ~HttpAuthHandlerMock(); 62 virtual ~HttpAuthHandlerMock();
63 63
64 void SetResolveExpectation(Resolve resolve); 64 void SetResolveExpectation(Resolve resolve);
65 65
66 virtual bool NeedsCanonicalName(); 66 virtual bool NeedsCanonicalName();
67 67
68 virtual int ResolveCanonicalName(HostResolver* host_resolver, 68 virtual int ResolveCanonicalName(HostResolver* host_resolver,
69 OldCompletionCallback* callback); 69 const CompletionCallback& callback);
70 70
71 71
72 void SetGenerateExpectation(bool async, int rv); 72 void SetGenerateExpectation(bool async, int rv);
73 73
74 void set_connection_based(bool connection_based) { 74 void set_connection_based(bool connection_based) {
75 connection_based_ = connection_based; 75 connection_based_ = connection_based;
76 } 76 }
77 77
78 void set_allows_default_credentials(bool allows_default_credentials) { 78 void set_allows_default_credentials(bool allows_default_credentials) {
79 allows_default_credentials_ = allows_default_credentials; 79 allows_default_credentials_ = allows_default_credentials;
(...skipping 12 matching lines...) Expand all
92 HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; 92 HttpAuth::ChallengeTokenizer* challenge) OVERRIDE;
93 virtual bool NeedsIdentity() OVERRIDE; 93 virtual bool NeedsIdentity() OVERRIDE;
94 virtual bool AllowsDefaultCredentials() OVERRIDE; 94 virtual bool AllowsDefaultCredentials() OVERRIDE;
95 virtual bool AllowsExplicitCredentials() OVERRIDE; 95 virtual bool AllowsExplicitCredentials() OVERRIDE;
96 96
97 protected: 97 protected:
98 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; 98 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) OVERRIDE;
99 99
100 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, 100 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
101 const HttpRequestInfo* request, 101 const HttpRequestInfo* request,
102 OldCompletionCallback* callback, 102 const CompletionCallback& callback,
103 std::string* auth_token) OVERRIDE; 103 std::string* auth_token) OVERRIDE;
104 104
105 private: 105 private:
106 void OnResolveCanonicalName(); 106 void OnResolveCanonicalName();
107 107
108 void OnGenerateAuthToken(); 108 void OnGenerateAuthToken();
109 109
110 Resolve resolve_; 110 Resolve resolve_;
111 OldCompletionCallback* user_callback_; 111 CompletionCallback callback_;
112 base::WeakPtrFactory<HttpAuthHandlerMock> ptr_factory_; 112 base::WeakPtrFactory<HttpAuthHandlerMock> weak_factory_;
113 bool generate_async_; 113 bool generate_async_;
114 int generate_rv_; 114 int generate_rv_;
115 std::string* auth_token_; 115 std::string* auth_token_;
116 bool first_round_; 116 bool first_round_;
117 bool connection_based_; 117 bool connection_based_;
118 bool allows_default_credentials_; 118 bool allows_default_credentials_;
119 bool allows_explicit_credentials_; 119 bool allows_explicit_credentials_;
120 GURL request_url_; 120 GURL request_url_;
121 }; 121 };
122 122
123 } // namespace net 123 } // namespace net
124 124
125 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ 125 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698