diff options
author | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-16 16:52:42 +0000 |
---|---|---|
committer | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-16 16:52:42 +0000 |
commit | f79f486ecd399ed82fd2cf9445f99c810bf4d7c1 (patch) | |
tree | 02c39d8c5f3e6bd08e0e3dba3c1f28ec69d18e89 | |
parent | a278e260059b68f4c4262b9f4732d9b2d6b6b1d5 (diff) | |
download | chromium_src-f79f486ecd399ed82fd2cf9445f99c810bf4d7c1.zip chromium_src-f79f486ecd399ed82fd2cf9445f99c810bf4d7c1.tar.gz chromium_src-f79f486ecd399ed82fd2cf9445f99c810bf4d7c1.tar.bz2 |
Eliminate VS2010 ifdefs for handling NULL in std::pair.
Remove lots of duplicated ifdefs, replacing them with syntax that works
on all platforms (including VS2010).
BUG=106215
Review URL: https://chromiumcodereview.appspot.com/8735002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122303 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/search_engines/template_url_service.cc | 12 | ||||
-rw-r--r-- | content/browser/browser_url_handler.cc | 8 | ||||
-rw-r--r-- | ui/views/focus/focus_manager_unittest.cc | 8 | ||||
-rw-r--r-- | ui/views/focus/focus_manager_unittest_win.cc | 8 | ||||
-rw-r--r-- | webkit/blob/deletable_file_reference.cc | 8 |
5 files changed, 7 insertions, 37 deletions
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index e89b9e3..a44c6a5 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -266,14 +266,8 @@ void TemplateURLService::FindMatchingKeywords( DCHECK(matches != NULL); DCHECK(matches->empty()); // The code for exact matches assumes this. - // 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 - const TemplateURL* null_url = nullptr; -#else - const TemplateURL* null_url = NULL; -#endif + // Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair + const TemplateURL* const kNullTemplateURL = NULL; // Find matching keyword range. Searches the element map for keywords // beginning with |prefix| and stores the endpoints of the resulting set in @@ -282,7 +276,7 @@ void TemplateURLService::FindMatchingKeywords( KeywordToTemplateMap::const_iterator> match_range( std::equal_range( keyword_to_template_map_.begin(), keyword_to_template_map_.end(), - KeywordToTemplateMap::value_type(prefix, null_url), + KeywordToTemplateMap::value_type(prefix, kNullTemplateURL), LessWithPrefix())); // Return vector of matching keywords. diff --git a/content/browser/browser_url_handler.cc b/content/browser/browser_url_handler.cc index 8bcb2d6..15f947b 100644 --- a/content/browser/browser_url_handler.cc +++ b/content/browser/browser_url_handler.cc @@ -75,14 +75,8 @@ BrowserURLHandler* BrowserURLHandler::GetInstance() { // static BrowserURLHandler::URLHandler BrowserURLHandler::null_handler() { - // 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 - return nullptr; -#else + // Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair return NULL; -#endif } BrowserURLHandler::BrowserURLHandler() { diff --git a/ui/views/focus/focus_manager_unittest.cc b/ui/views/focus/focus_manager_unittest.cc index 8945a59..38bd9e0 100644 --- a/ui/views/focus/focus_manager_unittest.cc +++ b/ui/views/focus/focus_manager_unittest.cc @@ -101,14 +101,8 @@ TEST_F(FocusManagerTest, FocusChangeListener) { TestFocusChangeListener listener; AddFocusChangeListener(&listener); - // 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 - views::View* null_view = nullptr; -#else + // Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair views::View* null_view = NULL; -#endif view1->RequestFocus(); ASSERT_EQ(1, static_cast<int>(listener.focus_changes().size())); diff --git a/ui/views/focus/focus_manager_unittest_win.cc b/ui/views/focus/focus_manager_unittest_win.cc index 0cf05e8..6f47d58 100644 --- a/ui/views/focus/focus_manager_unittest_win.cc +++ b/ui/views/focus/focus_manager_unittest_win.cc @@ -84,14 +84,8 @@ TEST_F(FocusManagerTest, FocusStoreRestore) { RunPendingMessages(); // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); - // 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 - views::View* null_view = nullptr; -#else + // Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair views::View* null_view = NULL; -#endif // Deacivate the window, it should store its focus. SimulateDeactivateWindow(); diff --git a/webkit/blob/deletable_file_reference.cc b/webkit/blob/deletable_file_reference.cc index 4a5665d..78cfafb 100644 --- a/webkit/blob/deletable_file_reference.cc +++ b/webkit/blob/deletable_file_reference.cc @@ -35,14 +35,8 @@ scoped_refptr<DeletableFileReference> DeletableFileReference::GetOrCreate( DCHECK(file_thread); typedef std::pair<DeleteableFileMap::iterator, bool> InsertResult; - // 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 - webkit_blob::DeletableFileReference* null_reference = nullptr; -#else + // Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair webkit_blob::DeletableFileReference* null_reference = NULL; -#endif InsertResult result = g_deletable_file_map.Get().insert( DeleteableFileMap::value_type(path, null_reference)); if (result.second == false) |