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

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

Issue 1520253002: Remove ScopedVector from http_auth_handler_mock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | net/http/http_auth_handler_mock.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_auth_handler_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698