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 #include "net/http/url_security_manager.h" | 5 #include "net/http/url_security_manager.h" |
6 | 6 |
7 #include <urlmon.h> | 7 #include <urlmon.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return false; | 97 return false; |
98 default: | 98 default: |
99 NOTREACHED(); | 99 NOTREACHED(); |
100 return false; | 100 return false; |
101 } | 101 } |
102 } | 102 } |
103 // TODO(cbentzel): Could CanDelegate use the security zone as well? | 103 // TODO(cbentzel): Could CanDelegate use the security zone as well? |
104 | 104 |
105 bool URLSecurityManagerWin::EnsureSystemSecurityManager() { | 105 bool URLSecurityManagerWin::EnsureSystemSecurityManager() { |
106 if (!security_manager_.Get()) { | 106 if (!security_manager_.Get()) { |
107 HRESULT hr = CoInternetCreateSecurityManager(NULL, | 107 HRESULT hr = CoInternetCreateSecurityManager( |
108 security_manager_.Receive(), | 108 NULL, security_manager_.GetAddressOf(), NULL); |
109 NULL); | |
110 if (FAILED(hr) || !security_manager_.Get()) { | 109 if (FAILED(hr) || !security_manager_.Get()) { |
111 LOG(ERROR) << "Unable to create the Windows Security Manager instance"; | 110 LOG(ERROR) << "Unable to create the Windows Security Manager instance"; |
112 return false; | 111 return false; |
113 } | 112 } |
114 } | 113 } |
115 return true; | 114 return true; |
116 } | 115 } |
117 | 116 |
118 // static | 117 // static |
119 URLSecurityManager* URLSecurityManager::Create() { | 118 URLSecurityManager* URLSecurityManager::Create() { |
120 return new URLSecurityManagerWin; | 119 return new URLSecurityManagerWin; |
121 } | 120 } |
122 | 121 |
123 } // namespace net | 122 } // namespace net |
OLD | NEW |