diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 19:41:58 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 19:41:58 +0000 |
commit | dc8b223f8c602c2acfdf41c228706fd7bf768de7 (patch) | |
tree | 60d7cb92c8a74135539d543b94548d2ef17a3b26 /net/http/url_security_manager_win.cc | |
parent | 9d64903037b85944ba90241a77875d1df68ee7fb (diff) | |
download | chromium_src-dc8b223f8c602c2acfdf41c228706fd7bf768de7.zip chromium_src-dc8b223f8c602c2acfdf41c228706fd7bf768de7.tar.gz chromium_src-dc8b223f8c602c2acfdf41c228706fd7bf768de7.tar.bz2 |
Lazy initialization of URLSecurityManager to reduce start-up time.
This addresses XP perf bot regressions:
http://build.chromium.org/buildbot/perf/xp-release-dual-core/startup/report.html?history=50&rev=44850&graph=warm
http://build.chromium.org/buildbot/perf/xp-release-single-core/startup/report.html?history=80&rev=44930&graph=warm
Had to remove const-ness from URLSecurityManager pointers.
BUG=None.
TEST=None.
Review URL: http://codereview.chromium.org/2110016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/url_security_manager_win.cc')
-rw-r--r-- | net/http/url_security_manager_win.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/http/url_security_manager_win.cc b/net/http/url_security_manager_win.cc index b563b35..4eaef78 100644 --- a/net/http/url_security_manager_win.cc +++ b/net/http/url_security_manager_win.cc @@ -29,7 +29,7 @@ class URLSecurityManagerWin : public URLSecurityManager { URLSecurityManagerWin(); // URLSecurityManager methods: - virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const; + virtual bool CanUseDefaultCredentials(const GURL& auth_origin); private: ScopedComPtr<IInternetSecurityManager> security_manager_; @@ -38,18 +38,19 @@ class URLSecurityManagerWin : public URLSecurityManager { }; URLSecurityManagerWin::URLSecurityManagerWin() { - HRESULT hr = CoInternetCreateSecurityManager(NULL, - security_manager_.Receive(), - NULL); - DCHECK(SUCCEEDED(hr)); } bool URLSecurityManagerWin::CanUseDefaultCredentials( - const GURL& auth_origin) const { + const GURL& auth_origin) { if (!security_manager_) { - NOTREACHED(); // The code in the constructor failed. - return false; + HRESULT hr = CoInternetCreateSecurityManager(NULL, + security_manager_.Receive(), + NULL); + if (FAILED(hr) || !security_manager_) { + LOG(ERROR) << "Unable to create the Windows Security Manager instance"; + return false; + } } std::wstring url_w = ASCIIToWide(auth_origin.spec()); |