diff options
author | jeanluc@chromium.org <jeanluc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-30 22:57:35 +0000 |
---|---|---|
committer | jeanluc@chromium.org <jeanluc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-30 22:57:35 +0000 |
commit | 107446884c2e92b17f494ded21b315a052e51928 (patch) | |
tree | 35ff2b61b9a8a4ae0c07bbbb30d1fcb05d364ff7 /chrome/browser/browser_url_handler.cc | |
parent | c90d849636fd9db7f79f2f2b4611f2bcff0c5700 (diff) | |
download | chromium_src-107446884c2e92b17f494ded21b315a052e51928.zip chromium_src-107446884c2e92b17f494ded21b315a052e51928.tar.gz chromium_src-107446884c2e92b17f494ded21b315a052e51928.tar.bz2 |
In Visual Studio 2010, pass a nullptr rather than NULL when building a std::pair. See http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair
BUG=71138
TEST=Successful compile
Review URL: http://codereview.chromium.org/6366023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_url_handler.cc')
-rw-r--r-- | chrome/browser/browser_url_handler.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/browser_url_handler.cc b/chrome/browser/browser_url_handler.cc index 6854556..806f1bd 100644 --- a/chrome/browser/browser_url_handler.cc +++ b/chrome/browser/browser_url_handler.cc @@ -83,13 +83,23 @@ void BrowserURLHandler::InitURLHandlers() { if (!url_handlers_.empty()) return; + // Visual Studio 2010 has problems converting NULL to the null pointer for + // std::pair. See http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair + // It will work if we pass nullptr. +#if defined(_MSC_VER) && _MSC_VER >= 1600 + URLHandler null_handler = nullptr; +#else + URLHandler null_handler = NULL; +#endif + // Add the default URL handlers. url_handlers_.push_back( - HandlerPair(&ExtensionDOMUI::HandleChromeURLOverride, NULL)); + HandlerPair(&ExtensionDOMUI::HandleChromeURLOverride, null_handler)); // about: - url_handlers_.push_back(HandlerPair(&WillHandleBrowserAboutURL, NULL)); + url_handlers_.push_back(HandlerPair(&WillHandleBrowserAboutURL, + null_handler)); // chrome: & friends. - url_handlers_.push_back(HandlerPair(&HandleDOMUI, NULL)); + url_handlers_.push_back(HandlerPair(&HandleDOMUI, null_handler)); // view-source: url_handlers_.push_back(HandlerPair(&HandleViewSource, &ReverseViewSource)); } |