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

Unified Diff: content/browser/download/download_item_impl.cc

Issue 9518008: Add a const overload to DownloadItem::GetExternalData() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const-correctness Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index dd08306e35e0f91cb76e444afd46fb453847da30..a8d1997b8e9e5c79aa16d1fbd686166bd01b4d1f 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -1131,9 +1131,16 @@ void DownloadItemImpl::MockDownloadOpenForTesting() { open_enabled_ = false; }
DownloadItem::ExternalData*
DownloadItemImpl::GetExternalData(const void* key) {
Randy Smith (Not in Mondays) 2012/03/01 21:49:05 I'd be inclined to implement this with a call to t
asanka 2012/03/02 16:09:26 Done.
- if (!ContainsKey(external_data_map_, key))
- return NULL;
- return external_data_map_[key];
+ std::map<const void*, ExternalData*>::const_iterator it =
+ external_data_map_.find(key);
+ return (it == external_data_map_.end()) ? NULL : it->second;
+}
+
+const DownloadItem::ExternalData*
+DownloadItemImpl::GetExternalData(const void* key) const {
+ std::map<const void*, ExternalData*>::const_iterator it =
+ external_data_map_.find(key);
+ return (it == external_data_map_.end()) ? NULL : it->second;
}
void DownloadItemImpl::SetExternalData(
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698