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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 true, | 1046 true, |
1047 session_storage_namespace.get(), | 1047 session_storage_namespace.get(), |
1048 tab.user_agent_override); | 1048 tab.user_agent_override); |
1049 // Regression check: check that the tab didn't start loading right away. The | 1049 // 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. | 1050 // focused tab will be loaded by Browser, and TabLoader will load the rest. |
1051 DCHECK(web_contents->GetController().NeedsReload()); | 1051 DCHECK(web_contents->GetController().NeedsReload()); |
1052 | 1052 |
1053 // Set up the file access rights for the selected navigation entry. | 1053 // Set up the file access rights for the selected navigation entry. |
1054 const int id = web_contents->GetRenderProcessHost()->GetID(); | 1054 const int id = web_contents->GetRenderProcessHost()->GetID(); |
1055 const content::PageState& page_state = | 1055 const content::PageState& page_state = |
1056 tab.navigations.at(selected_index).page_state(); | 1056 content::PageState::CreateFromEncodedData( |
| 1057 tab.navigations.at(selected_index).encoded_page_state()); |
1057 const std::vector<base::FilePath>& file_paths = | 1058 const std::vector<base::FilePath>& file_paths = |
1058 page_state.GetReferencedFiles(); | 1059 page_state.GetReferencedFiles(); |
1059 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 1060 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
1060 file != file_paths.end(); ++file) { | 1061 file != file_paths.end(); ++file) { |
1061 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, | 1062 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, |
1062 *file); | 1063 *file); |
1063 } | 1064 } |
1064 | 1065 |
1065 if (!is_selected_tab) | 1066 if (!is_selected_tab) |
1066 tab_loader_->ScheduleLoad(&web_contents->GetController()); | 1067 tab_loader_->ScheduleLoad(&web_contents->GetController()); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 if (!active_session_restorers) | 1290 if (!active_session_restorers) |
1290 return false; | 1291 return false; |
1291 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1292 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1292 active_session_restorers->begin(); | 1293 active_session_restorers->begin(); |
1293 it != active_session_restorers->end(); ++it) { | 1294 it != active_session_restorers->end(); ++it) { |
1294 if ((*it)->synchronous()) | 1295 if ((*it)->synchronous()) |
1295 return true; | 1296 return true; |
1296 } | 1297 } |
1297 return false; | 1298 return false; |
1298 } | 1299 } |
OLD | NEW |