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

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

Issue 7864005: Don't leak SSPILibraryDefault objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and update copyright header Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_auth_handler_ntlm_win.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_NTLM_H_ 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_
6 #define NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 virtual ~Factory(); 43 virtual ~Factory();
44 44
45 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, 45 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge,
46 HttpAuth::Target target, 46 HttpAuth::Target target,
47 const GURL& origin, 47 const GURL& origin,
48 CreateReason reason, 48 CreateReason reason,
49 int digest_nonce_count, 49 int digest_nonce_count,
50 const BoundNetLog& net_log, 50 const BoundNetLog& net_log,
51 scoped_ptr<HttpAuthHandler>* handler); 51 scoped_ptr<HttpAuthHandler>* handler);
52 #if defined(NTLM_SSPI) 52 #if defined(NTLM_SSPI)
53 // Set the SSPILibrary to use. Typically the only callers which need to 53 // Set the SSPILibrary to use. Typically the only callers which need to use
54 // use this are unit tests which pass in a mocked-out version of the 54 // this are unit tests which pass in a mocked-out version of the SSPI
55 // SSPI library. 55 // library. After the call |sspi_library| will be owned by this Factory and
56 // The caller is responsible for managing the lifetime of |*sspi_library|, 56 // will be destroyed when the Factory is destroyed.
57 // and the lifetime must exceed that of this Factory object and all
58 // HttpAuthHandler's that this Factory object creates.
59 void set_sspi_library(SSPILibrary* sspi_library) { 57 void set_sspi_library(SSPILibrary* sspi_library) {
60 sspi_library_ = sspi_library; 58 sspi_library_.reset(sspi_library);
61 } 59 }
62 #endif // defined(NTLM_SSPI) 60 #endif // defined(NTLM_SSPI)
63 private: 61 private:
64 #if defined(NTLM_SSPI) 62 #if defined(NTLM_SSPI)
65 ULONG max_token_length_; 63 ULONG max_token_length_;
66 bool first_creation_; 64 bool first_creation_;
67 bool is_unsupported_; 65 bool is_unsupported_;
68 SSPILibrary* sspi_library_; 66 scoped_ptr<SSPILibrary> sspi_library_;
69 #endif // defined(NTLM_SSPI) 67 #endif // defined(NTLM_SSPI)
70 }; 68 };
71 69
72 #if defined(NTLM_PORTABLE) 70 #if defined(NTLM_PORTABLE)
73 // A function that generates n random bytes in the output buffer. 71 // A function that generates n random bytes in the output buffer.
74 typedef void (*GenerateRandomProc)(uint8* output, size_t n); 72 typedef void (*GenerateRandomProc)(uint8* output, size_t n);
75 73
76 // A function that returns the local host name. Returns an empty string if 74 // A function that returns the local host name. Returns an empty string if
77 // the local host name is not available. 75 // the local host name is not available.
78 typedef std::string (*HostNameProc)(); 76 typedef std::string (*HostNameProc)();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 std::string auth_data_; 166 std::string auth_data_;
169 167
170 #if defined(NTLM_SSPI) 168 #if defined(NTLM_SSPI)
171 URLSecurityManager* url_security_manager_; 169 URLSecurityManager* url_security_manager_;
172 #endif 170 #endif
173 }; 171 };
174 172
175 } // namespace net 173 } // namespace net
176 174
177 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ 175 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_auth_handler_ntlm_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698