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..a35a939eaebb6131c6d6278eebe6751cf0ef27d3 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() |
+ .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); |