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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 3325012: Fix SessionStorage (Closed)
Patch Set: kill the last (new) dcheck Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #if defined(OS_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 // For GdkScreen 8 // For GdkScreen
9 #include <gdk/gdk.h> 9 #include <gdk/gdk.h>
10 #endif // defined(OS_CHROMEOS) 10 #endif // defined(OS_CHROMEOS)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/browser/external_protocol_handler.h" 43 #include "chrome/browser/external_protocol_handler.h"
44 #include "chrome/browser/extensions/extensions_service.h" 44 #include "chrome/browser/extensions/extensions_service.h"
45 #include "chrome/browser/history/history_types.h" 45 #include "chrome/browser/history/history_types.h"
46 #include "chrome/browser/history/top_sites.h" 46 #include "chrome/browser/history/top_sites.h"
47 #include "chrome/browser/favicon_service.h" 47 #include "chrome/browser/favicon_service.h"
48 #include "chrome/browser/file_select_helper.h" 48 #include "chrome/browser/file_select_helper.h"
49 #include "chrome/browser/find_bar_state.h" 49 #include "chrome/browser/find_bar_state.h"
50 #include "chrome/browser/google/google_util.h" 50 #include "chrome/browser/google/google_util.h"
51 #include "chrome/browser/host_content_settings_map.h" 51 #include "chrome/browser/host_content_settings_map.h"
52 #include "chrome/browser/hung_renderer_dialog.h" 52 #include "chrome/browser/hung_renderer_dialog.h"
53 #include "chrome/browser/in_process_webkit/session_storage_namespace.h"
53 #include "chrome/browser/message_box_handler.h" 54 #include "chrome/browser/message_box_handler.h"
54 #include "chrome/browser/load_from_memory_cache_details.h" 55 #include "chrome/browser/load_from_memory_cache_details.h"
55 #include "chrome/browser/load_notification_details.h" 56 #include "chrome/browser/load_notification_details.h"
56 #include "chrome/browser/metrics/metric_event_duration_details.h" 57 #include "chrome/browser/metrics/metric_event_duration_details.h"
57 #include "chrome/browser/modal_html_dialog_delegate.h" 58 #include "chrome/browser/modal_html_dialog_delegate.h"
58 #include "chrome/browser/omnibox_search_hint.h" 59 #include "chrome/browser/omnibox_search_hint.h"
59 #include "chrome/browser/password_manager/password_manager.h" 60 #include "chrome/browser/password_manager/password_manager.h"
60 #include "chrome/browser/platform_util.h" 61 #include "chrome/browser/platform_util.h"
61 #include "chrome/browser/plugin_installer.h" 62 #include "chrome/browser/plugin_installer.h"
62 #include "chrome/browser/popup_blocked_animation.h" 63 #include "chrome/browser/popup_blocked_animation.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 311
311 // ----------------------------------------------------------------------------- 312 // -----------------------------------------------------------------------------
312 313
313 // static 314 // static
314 int TabContents::find_request_id_counter_ = -1; 315 int TabContents::find_request_id_counter_ = -1;
315 316
316 317
317 TabContents::TabContents(Profile* profile, 318 TabContents::TabContents(Profile* profile,
318 SiteInstance* site_instance, 319 SiteInstance* site_instance,
319 int routing_id, 320 int routing_id,
320 const TabContents* base_tab_contents) 321 const TabContents* base_tab_contents,
322 SessionStorageNamespace* session_storage_namespace)
321 : delegate_(NULL), 323 : delegate_(NULL),
322 ALLOW_THIS_IN_INITIALIZER_LIST(controller_(this, profile)), 324 ALLOW_THIS_IN_INITIALIZER_LIST(controller_(
325 this, profile, session_storage_namespace)),
323 ALLOW_THIS_IN_INITIALIZER_LIST(view_( 326 ALLOW_THIS_IN_INITIALIZER_LIST(view_(
324 TabContentsView::Create(this))), 327 TabContentsView::Create(this))),
325 ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)), 328 ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)),
326 property_bag_(), 329 property_bag_(),
327 registrar_(), 330 registrar_(),
328 ALLOW_THIS_IN_INITIALIZER_LIST(printing_( 331 ALLOW_THIS_IN_INITIALIZER_LIST(printing_(
329 new printing::PrintViewManager(*this))), 332 new printing::PrintViewManager(*this))),
330 save_package_(), 333 save_package_(),
331 autocomplete_history_manager_(), 334 autocomplete_history_manager_(),
332 autofill_manager_(), 335 autofill_manager_(),
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 void TabContents::DisassociateFromPopupCount() { 925 void TabContents::DisassociateFromPopupCount() {
923 render_view_host()->DisassociateFromPopupCount(); 926 render_view_host()->DisassociateFromPopupCount();
924 } 927 }
925 928
926 TabContents* TabContents::Clone() { 929 TabContents* TabContents::Clone() {
927 // We create a new SiteInstance so that the new tab won't share processes 930 // We create a new SiteInstance so that the new tab won't share processes
928 // with the old one. This can be changed in the future if we need it to share 931 // with the old one. This can be changed in the future if we need it to share
929 // processes for some reason. 932 // processes for some reason.
930 TabContents* tc = new TabContents(profile(), 933 TabContents* tc = new TabContents(profile(),
931 SiteInstance::CreateSiteInstance(profile()), 934 SiteInstance::CreateSiteInstance(profile()),
932 MSG_ROUTING_NONE, this); 935 MSG_ROUTING_NONE, this, NULL);
933 tc->controller().CopyStateFrom(controller_); 936 tc->controller().CopyStateFrom(controller_);
934 tc->extension_app_ = extension_app_; 937 tc->extension_app_ = extension_app_;
935 tc->extension_app_icon_ = extension_app_icon_; 938 tc->extension_app_icon_ = extension_app_icon_;
936 return tc; 939 return tc;
937 } 940 }
938 941
939 void TabContents::ShowPageInfo(const GURL& url, 942 void TabContents::ShowPageInfo(const GURL& url,
940 const NavigationEntry::SSLStatus& ssl, 943 const NavigationEntry::SSLStatus& ssl,
941 bool show_history) { 944 bool show_history) {
942 if (!delegate_) 945 if (!delegate_)
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 NavigationEntry* entry = controller().GetActiveEntry(); 1448 NavigationEntry* entry = controller().GetActiveEntry();
1446 if (extension_app_) 1449 if (extension_app_)
1447 tab_nav.set_virtual_url(extension_app_->GetFullLaunchURL()); 1450 tab_nav.set_virtual_url(extension_app_->GetFullLaunchURL());
1448 else if (entry) 1451 else if (entry)
1449 tab_nav.SetFromNavigationEntry(*entry); 1452 tab_nav.SetFromNavigationEntry(*entry);
1450 1453
1451 std::vector<TabNavigation> navigations; 1454 std::vector<TabNavigation> navigations;
1452 navigations.push_back(tab_nav); 1455 navigations.push_back(tab_nav);
1453 1456
1454 TabContents* new_contents = 1457 TabContents* new_contents =
1455 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL); 1458 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL,
1459 controller_.session_storage_namespace()->Clone());
1456 new_contents->SetExtensionApp(extension_app_); 1460 new_contents->SetExtensionApp(extension_app_);
1457 new_contents->controller().RestoreFromState(navigations, 0, false); 1461 new_contents->controller().RestoreFromState(navigations, 0, false);
1458 1462
1459 if (!extension_app_ && entry) 1463 if (!extension_app_ && entry)
1460 new_contents->controller().GetActiveEntry()->favicon() = entry->favicon(); 1464 new_contents->controller().GetActiveEntry()->favicon() = entry->favicon();
1461 1465
1462 return new_contents; 1466 return new_contents;
1463 } 1467 }
1464 1468
1465 void TabContents::UpdateHistoryForNavigation( 1469 void TabContents::UpdateHistoryForNavigation(
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); 3273 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save));
3270 } 3274 }
3271 3275
3272 Profile* TabContents::GetProfileForPasswordManager() { 3276 Profile* TabContents::GetProfileForPasswordManager() {
3273 return profile(); 3277 return profile();
3274 } 3278 }
3275 3279
3276 bool TabContents::DidLastPageLoadEncounterSSLErrors() { 3280 bool TabContents::DidLastPageLoadEncounterSSLErrors() {
3277 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); 3281 return controller().ssl_manager()->ProcessedSSLErrorFromRequest();
3278 } 3282 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/test_tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698