OLD | NEW |
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 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
10 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "net/http/http_auth_handler.h" | 13 #include "net/http/http_auth_handler.h" |
13 #include "net/http/http_auth_handler_factory.h" | 14 #include "net/http/http_auth_handler_factory.h" |
14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 | 18 |
18 class HostResolver; | 19 class HostResolver; |
19 | 20 |
20 // MockAuthHandler is used in tests to reliably trigger edge cases. | 21 // MockAuthHandler is used in tests to reliably trigger edge cases. |
(...skipping 23 matching lines...) Expand all Loading... |
44 // HttpAuthHandlerFactory: | 45 // HttpAuthHandlerFactory: |
45 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 46 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
46 HttpAuth::Target target, | 47 HttpAuth::Target target, |
47 const GURL& origin, | 48 const GURL& origin, |
48 CreateReason reason, | 49 CreateReason reason, |
49 int nonce_count, | 50 int nonce_count, |
50 const BoundNetLog& net_log, | 51 const BoundNetLog& net_log, |
51 scoped_ptr<HttpAuthHandler>* handler) override; | 52 scoped_ptr<HttpAuthHandler>* handler) override; |
52 | 53 |
53 private: | 54 private: |
54 ScopedVector<HttpAuthHandler> handlers_[HttpAuth::AUTH_NUM_TARGETS]; | 55 std::vector<scoped_ptr<HttpAuthHandler>> |
| 56 handlers_[HttpAuth::AUTH_NUM_TARGETS]; |
55 bool do_init_from_challenge_; | 57 bool do_init_from_challenge_; |
56 }; | 58 }; |
57 | 59 |
58 HttpAuthHandlerMock(); | 60 HttpAuthHandlerMock(); |
59 | 61 |
60 ~HttpAuthHandlerMock() override; | 62 ~HttpAuthHandlerMock() override; |
61 | 63 |
62 void SetResolveExpectation(Resolve resolve); | 64 void SetResolveExpectation(Resolve resolve); |
63 | 65 |
64 virtual bool NeedsCanonicalName(); | 66 virtual bool NeedsCanonicalName(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool connection_based_; | 116 bool connection_based_; |
115 bool allows_default_credentials_; | 117 bool allows_default_credentials_; |
116 bool allows_explicit_credentials_; | 118 bool allows_explicit_credentials_; |
117 GURL request_url_; | 119 GURL request_url_; |
118 base::WeakPtrFactory<HttpAuthHandlerMock> weak_factory_; | 120 base::WeakPtrFactory<HttpAuthHandlerMock> weak_factory_; |
119 }; | 121 }; |
120 | 122 |
121 } // namespace net | 123 } // namespace net |
122 | 124 |
123 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ | 125 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ |
OLD | NEW |