Index: chrome/browser/instant/instant_controller.cc |
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc |
index 2eefd0670edbc69df96796eeda0d7b2ef7730152..7454d817bcf3aa1af633a6cdeb57f5c4af5e4d15 100644 |
--- a/chrome/browser/instant/instant_controller.cc |
+++ b/chrome/browser/instant/instant_controller.cc |
@@ -79,9 +79,29 @@ void AddSessionStorageHistogram(InstantController::Mode mode, |
base::Histogram* histogram = base::BooleanHistogram::FactoryGet( |
"Instant.SessionStorageNamespace" + ModeToString(mode), |
base::Histogram::kUmaTargetedHistogramFlag); |
- histogram->AddBoolean( |
- tab1->web_contents()->GetController().GetSessionStorageNamespace() == |
- tab2->web_contents()->GetController().GetSessionStorageNamespace()); |
+ const content::SessionStorageNamespaceMap& session_storage_map1 = |
+ tab1->web_contents()->GetController().GetSessionStorageNamespaceMap(); |
+ const content::SessionStorageNamespaceMap& session_storage_map2 = |
+ tab2->web_contents()->GetController().GetSessionStorageNamespaceMap(); |
+ bool is_session_storage_the_same = |
+ session_storage_map1.size() == session_storage_map2.size(); |
+ if (is_session_storage_the_same) { |
+ // The size is the same, so let's check that all entries match. |
+ for (content::SessionStorageNamespaceMap::const_iterator it1 = |
+ session_storage_map1.begin(); |
+ it1 != session_storage_map1.end(); |
+ ++it1) { |
+ |
+ content::SessionStorageNamespaceMap::const_iterator it2 = |
+ session_storage_map2.find(it1->first); |
sreeram
2012/08/09 19:20:05
Since the map is a std::map, with string keys, ite
|
+ if (it2 == session_storage_map2.end() || |
+ it1->second != it2->second) { |
+ is_session_storage_the_same = false; |
+ break; |
+ } |
+ } |
+ } |
+ histogram->AddBoolean(is_session_storage_the_same); |
} |
} // namespace |