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

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

Issue 10695107: Fix: file permissions when restoring a page with file inputs with selected files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | webkit/glue/glue_serialize.h » ('j') | webkit/glue/glue_serialize.cc » ('J')
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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 base::PLATFORM_FILE_ASYNC; 905 base::PLATFORM_FILE_ASYNC;
906 const std::string& state = 906 const std::string& state =
907 tab.navigations.at(selected_index).state(); 907 tab.navigations.at(selected_index).state();
908 const std::vector<FilePath>& file_paths = 908 const std::vector<FilePath>& file_paths =
909 webkit_glue::FilePathsFromHistoryState(state); 909 webkit_glue::FilePathsFromHistoryState(state);
910 for (std::vector<FilePath>::const_iterator file = file_paths.begin(); 910 for (std::vector<FilePath>::const_iterator file = file_paths.begin();
911 file != file_paths.end(); ++file) { 911 file != file_paths.end(); ++file) {
912 content::ChildProcessSecurityPolicy::GetInstance()-> 912 content::ChildProcessSecurityPolicy::GetInstance()->
913 GrantPermissionsForFile(id, *file, read_file_permissions); 913 GrantPermissionsForFile(id, *file, read_file_permissions);
914 } 914 }
915 // Set up file access rights for selected files in file inputs.
916 const std::vector<FilePath>& input_file_paths =
917 webkit_glue::FilePathsFromInputsInHistoryState(state);
918 for (std::vector<FilePath>::const_iterator file = input_file_paths.begin();
919 file != input_file_paths.end(); ++file) {
920 content::ChildProcessSecurityPolicy::GetInstance()->
921 GrantPermissionsForFile(id, *file, read_file_permissions);
922 }
915 923
916 if (schedule_load) 924 if (schedule_load)
917 tab_loader_->ScheduleLoad(&web_contents->GetController()); 925 tab_loader_->ScheduleLoad(&web_contents->GetController());
918 return web_contents; 926 return web_contents;
919 } 927 }
920 928
921 Browser* CreateRestoredBrowser(Browser::Type type, 929 Browser* CreateRestoredBrowser(Browser::Type type,
922 gfx::Rect bounds, 930 gfx::Rect bounds,
923 ui::WindowShowState show_state, 931 ui::WindowShowState show_state,
924 const std::string& app_name) { 932 const std::string& app_name) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 if (active_session_restorers == NULL) 1097 if (active_session_restorers == NULL)
1090 return false; 1098 return false;
1091 for (std::set<SessionRestoreImpl*>::const_iterator it = 1099 for (std::set<SessionRestoreImpl*>::const_iterator it =
1092 active_session_restorers->begin(); 1100 active_session_restorers->begin();
1093 it != active_session_restorers->end(); ++it) { 1101 it != active_session_restorers->end(); ++it) {
1094 if ((*it)->profile() == profile) 1102 if ((*it)->profile() == profile)
1095 return true; 1103 return true;
1096 } 1104 }
1097 return false; 1105 return false;
1098 } 1106 }
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/glue_serialize.h » ('j') | webkit/glue/glue_serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698