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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 8 years, 4 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: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 2eefd0670edbc69df96796eeda0d7b2ef7730152..6812c6fedb238cbc5b508d10f004d5d5f47a293f 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -79,9 +79,27 @@ 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(),
+ it2 = session_storage_map2.begin();
+ it1 != session_storage_map1.end() &&
+ it2 != session_storage_map2.end();
+ ++it1, ++it2) {
+ if (it1->first != it2->first || it1->second != it2->second) {
+ is_session_storage_the_same = false;
+ break;
+ }
+ }
+ }
+ histogram->AddBoolean(is_session_storage_the_same);
}
} // namespace
« no previous file with comments | « chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698