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

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: style fixes. 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_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index 41c9c856daa4abdaf84ed53a3b6c399b34c49ead..3fa6b74521287eec115d0dbff2b5612fbd1914b7 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 because it assumes a default
+ // SessionStorageNamespace for a TabContents.
+ //
+ // http://crbug.com/140612
+ return tab->web_contents()->GetController()
+ .GetDefaultSessionStorageNamespace();
}
} // namespace
@@ -851,6 +856,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);
@@ -1144,7 +1151,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