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

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

Issue 745053002: Grant access to files in PageState, which have already been validated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting Created 6 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 tab.extension_app_id, 1075 tab.extension_app_id,
1076 false, // select 1076 false, // select
1077 tab.pinned, 1077 tab.pinned,
1078 true, 1078 true,
1079 session_storage_namespace.get(), 1079 session_storage_namespace.get(),
1080 tab.user_agent_override); 1080 tab.user_agent_override);
1081 // Regression check: check that the tab didn't start loading right away. The 1081 // Regression check: check that the tab didn't start loading right away. The
1082 // focused tab will be loaded by Browser, and TabLoader will load the rest. 1082 // focused tab will be loaded by Browser, and TabLoader will load the rest.
1083 DCHECK(web_contents->GetController().NeedsReload()); 1083 DCHECK(web_contents->GetController().NeedsReload());
1084 1084
1085 // Set up the file access rights for the selected navigation entry.
Charlie Reis 2014/11/25 21:00:55 This is now redundant with RenderFrameHostImpl::On
1086 const int id = web_contents->GetRenderProcessHost()->GetID();
1087 const content::PageState& page_state =
1088 content::PageState::CreateFromEncodedData(
1089 tab.navigations.at(selected_index).encoded_page_state());
1090 const std::vector<base::FilePath>& file_paths =
1091 page_state.GetReferencedFiles();
1092 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin();
1093 file != file_paths.end(); ++file) {
1094 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id,
1095 *file);
1096 }
1097
1098 if (!is_selected_tab) 1085 if (!is_selected_tab)
1099 tab_loader_->ScheduleLoad(&web_contents->GetController()); 1086 tab_loader_->ScheduleLoad(&web_contents->GetController());
1100 return web_contents; 1087 return web_contents;
1101 } 1088 }
1102 1089
1103 Browser* CreateRestoredBrowser(Browser::Type type, 1090 Browser* CreateRestoredBrowser(Browser::Type type,
1104 gfx::Rect bounds, 1091 gfx::Rect bounds,
1105 ui::WindowShowState show_state, 1092 ui::WindowShowState show_state,
1106 const std::string& app_name) { 1093 const std::string& app_name) {
1107 Browser::CreateParams params(type, profile_, host_desktop_type_); 1094 Browser::CreateParams params(type, profile_, host_desktop_type_);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 if (!active_session_restorers) 1309 if (!active_session_restorers)
1323 return false; 1310 return false;
1324 for (std::set<SessionRestoreImpl*>::const_iterator it = 1311 for (std::set<SessionRestoreImpl*>::const_iterator it =
1325 active_session_restorers->begin(); 1312 active_session_restorers->begin();
1326 it != active_session_restorers->end(); ++it) { 1313 it != active_session_restorers->end(); ++it) {
1327 if ((*it)->synchronous()) 1314 if ((*it)->synchronous())
1328 return true; 1315 return true;
1329 } 1316 }
1330 return false; 1317 return false;
1331 } 1318 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | content/browser/web_contents/web_contents_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698