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

Side by Side Diff: chrome/browser/sessions/session_restore.cc

Issue 658073004: Rewrites SerializedNavigationEntry to not have any //content member variables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/sessions/session_restore.h" 5 #include "chrome/browser/sessions/session_restore.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 30 matching lines...) Expand all
41 #include "content/public/browser/dom_storage_context.h" 41 #include "content/public/browser/dom_storage_context.h"
42 #include "content/public/browser/navigation_controller.h" 42 #include "content/public/browser/navigation_controller.h"
43 #include "content/public/browser/notification_registrar.h" 43 #include "content/public/browser/notification_registrar.h"
44 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
45 #include "content/public/browser/render_process_host.h" 45 #include "content/public/browser/render_process_host.h"
46 #include "content/public/browser/render_widget_host.h" 46 #include "content/public/browser/render_widget_host.h"
47 #include "content/public/browser/render_widget_host_view.h" 47 #include "content/public/browser/render_widget_host_view.h"
48 #include "content/public/browser/session_storage_namespace.h" 48 #include "content/public/browser/session_storage_namespace.h"
49 #include "content/public/browser/storage_partition.h" 49 #include "content/public/browser/storage_partition.h"
50 #include "content/public/browser/web_contents.h" 50 #include "content/public/browser/web_contents.h"
51 #include "content/public/common/page_state.h"
51 #include "extensions/browser/extension_registry.h" 52 #include "extensions/browser/extension_registry.h"
52 #include "extensions/common/extension_set.h" 53 #include "extensions/common/extension_set.h"
53 #include "net/base/network_change_notifier.h" 54 #include "net/base/network_change_notifier.h"
54 55
55 #if defined(OS_CHROMEOS) 56 #if defined(OS_CHROMEOS)
56 #include "chrome/browser/chromeos/boot_times_loader.h" 57 #include "chrome/browser/chromeos/boot_times_loader.h"
57 #endif 58 #endif
58 59
59 using content::NavigationController; 60 using content::NavigationController;
60 using content::RenderWidgetHost; 61 using content::RenderWidgetHost;
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 true, 1047 true,
1047 session_storage_namespace.get(), 1048 session_storage_namespace.get(),
1048 tab.user_agent_override); 1049 tab.user_agent_override);
1049 // Regression check: check that the tab didn't start loading right away. The 1050 // Regression check: check that the tab didn't start loading right away. The
1050 // focused tab will be loaded by Browser, and TabLoader will load the rest. 1051 // focused tab will be loaded by Browser, and TabLoader will load the rest.
1051 DCHECK(web_contents->GetController().NeedsReload()); 1052 DCHECK(web_contents->GetController().NeedsReload());
1052 1053
1053 // Set up the file access rights for the selected navigation entry. 1054 // Set up the file access rights for the selected navigation entry.
1054 const int id = web_contents->GetRenderProcessHost()->GetID(); 1055 const int id = web_contents->GetRenderProcessHost()->GetID();
1055 const content::PageState& page_state = 1056 const content::PageState& page_state =
1056 tab.navigations.at(selected_index).page_state(); 1057 content::PageState::CreateFromEncodedData(
1058 tab.navigations.at(selected_index).encoded_page_state());
1057 const std::vector<base::FilePath>& file_paths = 1059 const std::vector<base::FilePath>& file_paths =
1058 page_state.GetReferencedFiles(); 1060 page_state.GetReferencedFiles();
1059 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); 1061 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin();
1060 file != file_paths.end(); ++file) { 1062 file != file_paths.end(); ++file) {
1061 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, 1063 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id,
1062 *file); 1064 *file);
1063 } 1065 }
1064 1066
1065 if (!is_selected_tab) 1067 if (!is_selected_tab)
1066 tab_loader_->ScheduleLoad(&web_contents->GetController()); 1068 tab_loader_->ScheduleLoad(&web_contents->GetController());
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 if (!active_session_restorers) 1291 if (!active_session_restorers)
1290 return false; 1292 return false;
1291 for (std::set<SessionRestoreImpl*>::const_iterator it = 1293 for (std::set<SessionRestoreImpl*>::const_iterator it =
1292 active_session_restorers->begin(); 1294 active_session_restorers->begin();
1293 it != active_session_restorers->end(); ++it) { 1295 it != active_session_restorers->end(); ++it) {
1294 if ((*it)->synchronous()) 1296 if ((*it)->synchronous())
1295 return true; 1297 return true;
1296 } 1298 }
1297 return false; 1299 return false;
1298 } 1300 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698