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

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 10837230: Move StoragePartition into content/public and remove BrowserContext::GetDOMStorageContext(). (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/navigation_controller_impl.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" // Temporary 9 #include "base/string_number_conversions.h" // Temporary
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "content/browser/browser_url_handler_impl.h" 13 #include "content/browser/browser_url_handler_impl.h"
14 #include "content/browser/child_process_security_policy_impl.h" 14 #include "content/browser/child_process_security_policy_impl.h"
15 #include "content/browser/dom_storage/dom_storage_context_impl.h" 15 #include "content/browser/dom_storage/dom_storage_context_impl.h"
16 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 16 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
17 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary 17 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary
18 #include "content/browser/site_instance_impl.h" 18 #include "content/browser/site_instance_impl.h"
19 #include "content/browser/web_contents/debug_urls.h" 19 #include "content/browser/web_contents/debug_urls.h"
20 #include "content/browser/web_contents/interstitial_page_impl.h" 20 #include "content/browser/web_contents/interstitial_page_impl.h"
21 #include "content/browser/web_contents/navigation_entry_impl.h" 21 #include "content/browser/web_contents/navigation_entry_impl.h"
22 #include "content/browser/web_contents/web_contents_impl.h" 22 #include "content/browser/web_contents/web_contents_impl.h"
23 #include "content/common/view_messages.h" 23 #include "content/common/view_messages.h"
24 #include "content/public/browser/browser_context.h" 24 #include "content/public/browser/browser_context.h"
25 #include "content/public/browser/content_browser_client.h" 25 #include "content/public/browser/content_browser_client.h"
26 #include "content/public/browser/invalidate_type.h" 26 #include "content/public/browser/invalidate_type.h"
27 #include "content/public/browser/navigation_details.h" 27 #include "content/public/browser/navigation_details.h"
28 #include "content/public/browser/notification_service.h" 28 #include "content/public/browser/notification_service.h"
29 #include "content/public/browser/notification_types.h" 29 #include "content/public/browser/notification_types.h"
30 #include "content/public/browser/storage_partition.h"
30 #include "content/public/browser/user_metrics.h" 31 #include "content/public/browser/user_metrics.h"
31 #include "content/public/browser/web_contents_delegate.h" 32 #include "content/public/browser/web_contents_delegate.h"
32 #include "content/public/common/content_client.h" 33 #include "content/public/common/content_client.h"
33 #include "content/public/common/content_constants.h" 34 #include "content/public/common/content_constants.h"
34 #include "content/public/common/url_constants.h" 35 #include "content/public/common/url_constants.h"
35 #include "net/base/escape.h" 36 #include "net/base/escape.h"
36 #include "net/base/mime_util.h" 37 #include "net/base/mime_util.h"
37 #include "net/base/net_util.h" 38 #include "net/base/net_util.h"
38 #include "webkit/glue/webkit_glue.h" 39 #include "webkit/glue/webkit_glue.h"
39 40
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 GetContentClient()->browser()->GetStoragePartitionIdForSiteInstance( 1293 GetContentClient()->browser()->GetStoragePartitionIdForSiteInstance(
1293 browser_context_, instance); 1294 browser_context_, instance);
1294 } 1295 }
1295 1296
1296 SessionStorageNamespaceMap::const_iterator it = 1297 SessionStorageNamespaceMap::const_iterator it =
1297 session_storage_namespace_map_.find(partition_id); 1298 session_storage_namespace_map_.find(partition_id);
1298 if (it != session_storage_namespace_map_.end()) 1299 if (it != session_storage_namespace_map_.end())
1299 return it->second.get(); 1300 return it->second.get();
1300 1301
1301 // Create one if no one has accessed session storage for this partition yet. 1302 // Create one if no one has accessed session storage for this partition yet.
1303 //
1304 // TODO(ajwong): Should this use the |partition_id| directly rather than
1305 // re-lookup via |instance|?
Charlie Reis 2012/08/14 18:50:12 Do you think there will be any other places that w
awong 2012/08/14 19:12:47 I think it's mostly a SessionStorage thing. For r
1306 content::StoragePartition* partition =
1307 BrowserContext::GetStoragePartition(browser_context_, instance);
Charlie Reis 2012/08/14 18:50:12 nit: Wrong indent.
awong 2012/08/14 19:12:47 Done.
1302 SessionStorageNamespaceImpl* session_storage_namespace = 1308 SessionStorageNamespaceImpl* session_storage_namespace =
1303 new SessionStorageNamespaceImpl( 1309 new SessionStorageNamespaceImpl(
1304 static_cast<DOMStorageContextImpl*>( 1310 static_cast<DOMStorageContextImpl*>(
1305 BrowserContext::GetDOMStorageContextByPartitionId( 1311 partition->GetDOMStorageContext()));
1306 browser_context_, partition_id)));
1307 session_storage_namespace_map_[partition_id] = session_storage_namespace; 1312 session_storage_namespace_map_[partition_id] = session_storage_namespace;
1308 1313
1309 return session_storage_namespace; 1314 return session_storage_namespace;
1310 } 1315 }
1311 1316
1312 SessionStorageNamespace* 1317 SessionStorageNamespace*
1313 NavigationControllerImpl::GetDefaultSessionStorageNamespace() { 1318 NavigationControllerImpl::GetDefaultSessionStorageNamespace() {
1314 // TODO(ajwong): Remove if statement in GetSessionStorageNamespace(). 1319 // TODO(ajwong): Remove if statement in GetSessionStorageNamespace().
1315 return GetSessionStorageNamespace(NULL); 1320 return GetSessionStorageNamespace(NULL);
1316 } 1321 }
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 for (int i = 0; i < max_index; i++) { 1576 for (int i = 0; i < max_index; i++) {
1572 // When cloning a tab, copy all entries except interstitial pages 1577 // When cloning a tab, copy all entries except interstitial pages
1573 if (source.entries_[i].get()->GetPageType() != 1578 if (source.entries_[i].get()->GetPageType() !=
1574 content::PAGE_TYPE_INTERSTITIAL) { 1579 content::PAGE_TYPE_INTERSTITIAL) {
1575 entries_.insert(entries_.begin() + insert_index++, 1580 entries_.insert(entries_.begin() + insert_index++,
1576 linked_ptr<NavigationEntryImpl>( 1581 linked_ptr<NavigationEntryImpl>(
1577 new NavigationEntryImpl(*source.entries_[i]))); 1582 new NavigationEntryImpl(*source.entries_[i])));
1578 } 1583 }
1579 } 1584 }
1580 } 1585 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698