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

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

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix content shell Created 8 years, 5 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_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index 28dad8f8ddd82fd9bb6b52a1e07a65718b4fdc76..5ef65eabfdd6771b5c6168c983f96fa273f31291 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -93,7 +93,12 @@ void AddPreviewUsageForHistogram(TemplateURLID template_url_id,
}
SessionStorageNamespace* GetSessionStorageNamespace(TabContents* tab) {
- return tab->web_contents()->GetController().GetSessionStorageNamespace();
+ // TODO(ajwong): This is wrong. This whole chunk of code was going to be
+ // removed by:
+ // http://codereview.chromium.org/10732002/
+ // but instead I will whack it in a followup CL.
Charlie Reis 2012/08/02 23:06:47 Not sure we need to mention the obsolete CL. Inst
sreeram 2012/08/02 23:44:43 That CL got rolled over into http://codereview.chr
awong 2012/08/03 00:31:04 Updated comment to refer to sreeram's new CL. Hope
+ return tab->web_contents()->GetController()
+ .GetSessionStorageNamespaceMap().find("")->second;
}
} // namespace
@@ -850,6 +855,8 @@ TabContents* InstantLoader::ReleasePreviewContents(
type == INSTANT_COMMIT_DESTROY ? PREVIEW_DELETED : PREVIEW_COMMITTED,
group_);
if (type != INSTANT_COMMIT_DESTROY) {
+ // This tracks the number of times a committed preview page destroys the
+ // Session Storage for the tab.
base::Histogram* histogram = base::LinearHistogram::FactoryGet(
"Instant.SessionStorageNamespace" + group_, 1, 2, 3,
base::Histogram::kUmaTargetedHistogramFlag);
@@ -1143,7 +1150,7 @@ void InstantLoader::SetupPreviewContents(TabContents* tab_contents) {
void InstantLoader::CreatePreviewContents(TabContents* tab_contents) {
WebContents* new_contents = WebContents::Create(
- tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL);
+ tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL);
preview_contents_.reset(new TabContents(new_contents));
AddPreviewUsageForHistogram(template_url_id_, PREVIEW_CREATED, group_);
session_storage_namespace_ = GetSessionStorageNamespace(tab_contents);

Powered by Google App Engine
This is Rietveld 408576698