| OLD | NEW |
| 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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 DCHECK(web_contents->GetController().NeedsReload()); | 940 DCHECK(web_contents->GetController().NeedsReload()); |
| 941 | 941 |
| 942 // Set up the file access rights for the selected navigation entry. | 942 // Set up the file access rights for the selected navigation entry. |
| 943 const int id = web_contents->GetRenderProcessHost()->GetID(); | 943 const int id = web_contents->GetRenderProcessHost()->GetID(); |
| 944 const int read_file_permissions = | 944 const int read_file_permissions = |
| 945 base::PLATFORM_FILE_OPEN | | 945 base::PLATFORM_FILE_OPEN | |
| 946 base::PLATFORM_FILE_READ | | 946 base::PLATFORM_FILE_READ | |
| 947 base::PLATFORM_FILE_EXCLUSIVE_READ | | 947 base::PLATFORM_FILE_EXCLUSIVE_READ | |
| 948 base::PLATFORM_FILE_ASYNC; | 948 base::PLATFORM_FILE_ASYNC; |
| 949 const std::string& state = | 949 const std::string& state = |
| 950 tab.navigations.at(selected_index).state(); | 950 tab.navigations.at(selected_index).content_state(); |
| 951 const std::vector<FilePath>& file_paths = | 951 const std::vector<FilePath>& file_paths = |
| 952 webkit_glue::FilePathsFromHistoryState(state); | 952 webkit_glue::FilePathsFromHistoryState(state); |
| 953 for (std::vector<FilePath>::const_iterator file = file_paths.begin(); | 953 for (std::vector<FilePath>::const_iterator file = file_paths.begin(); |
| 954 file != file_paths.end(); ++file) { | 954 file != file_paths.end(); ++file) { |
| 955 content::ChildProcessSecurityPolicy::GetInstance()-> | 955 content::ChildProcessSecurityPolicy::GetInstance()-> |
| 956 GrantPermissionsForFile(id, *file, read_file_permissions); | 956 GrantPermissionsForFile(id, *file, read_file_permissions); |
| 957 } | 957 } |
| 958 | 958 |
| 959 if (schedule_load) | 959 if (schedule_load) |
| 960 tab_loader_->ScheduleLoad(&web_contents->GetController()); | 960 tab_loader_->ScheduleLoad(&web_contents->GetController()); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 if (active_session_restorers == NULL) | 1132 if (active_session_restorers == NULL) |
| 1133 return false; | 1133 return false; |
| 1134 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1134 for (std::set<SessionRestoreImpl*>::const_iterator it = |
| 1135 active_session_restorers->begin(); | 1135 active_session_restorers->begin(); |
| 1136 it != active_session_restorers->end(); ++it) { | 1136 it != active_session_restorers->end(); ++it) { |
| 1137 if ((*it)->profile() == profile) | 1137 if ((*it)->profile() == profile) |
| 1138 return true; | 1138 return true; |
| 1139 } | 1139 } |
| 1140 return false; | 1140 return false; |
| 1141 } | 1141 } |
| OLD | NEW |