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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "content/public/browser/notification_registrar.h" | 42 #include "content/public/browser/notification_registrar.h" |
43 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/render_process_host.h" | 44 #include "content/public/browser/render_process_host.h" |
45 #include "content/public/browser/render_widget_host.h" | 45 #include "content/public/browser/render_widget_host.h" |
46 #include "content/public/browser/render_widget_host_view.h" | 46 #include "content/public/browser/render_widget_host_view.h" |
47 #include "content/public/browser/session_storage_namespace.h" | 47 #include "content/public/browser/session_storage_namespace.h" |
48 #include "content/public/browser/storage_partition.h" | 48 #include "content/public/browser/storage_partition.h" |
49 #include "content/public/browser/web_contents.h" | 49 #include "content/public/browser/web_contents.h" |
50 #include "content/public/browser/web_contents_view.h" | 50 #include "content/public/browser/web_contents_view.h" |
51 #include "net/base/network_change_notifier.h" | 51 #include "net/base/network_change_notifier.h" |
52 #include "webkit/glue/glue_serialize.h" | |
53 | 52 |
54 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
55 #include "chrome/browser/chromeos/boot_times_loader.h" | 54 #include "chrome/browser/chromeos/boot_times_loader.h" |
56 #endif | 55 #endif |
57 | 56 |
58 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
59 #include "win8/util/win8_util.h" | 58 #include "win8/util/win8_util.h" |
60 #endif | 59 #endif |
61 | 60 |
62 #if defined(USE_ASH) | 61 #if defined(USE_ASH) |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 // focused tab will be loaded by Browser, and TabLoader will load the rest. | 1032 // focused tab will be loaded by Browser, and TabLoader will load the rest. |
1034 DCHECK(web_contents->GetController().NeedsReload()); | 1033 DCHECK(web_contents->GetController().NeedsReload()); |
1035 | 1034 |
1036 // Set up the file access rights for the selected navigation entry. | 1035 // Set up the file access rights for the selected navigation entry. |
1037 const int id = web_contents->GetRenderProcessHost()->GetID(); | 1036 const int id = web_contents->GetRenderProcessHost()->GetID(); |
1038 const int read_file_permissions = | 1037 const int read_file_permissions = |
1039 base::PLATFORM_FILE_OPEN | | 1038 base::PLATFORM_FILE_OPEN | |
1040 base::PLATFORM_FILE_READ | | 1039 base::PLATFORM_FILE_READ | |
1041 base::PLATFORM_FILE_EXCLUSIVE_READ | | 1040 base::PLATFORM_FILE_EXCLUSIVE_READ | |
1042 base::PLATFORM_FILE_ASYNC; | 1041 base::PLATFORM_FILE_ASYNC; |
1043 const std::string& state = | 1042 const content::PageState& page_state = |
1044 tab.navigations.at(selected_index).content_state(); | 1043 tab.navigations.at(selected_index).page_state(); |
1045 const std::vector<base::FilePath>& file_paths = | 1044 const std::vector<base::FilePath>& file_paths = |
1046 webkit_glue::FilePathsFromHistoryState(state); | 1045 page_state.GetReferencedFiles(); |
1047 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 1046 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
1048 file != file_paths.end(); ++file) { | 1047 file != file_paths.end(); ++file) { |
1049 content::ChildProcessSecurityPolicy::GetInstance()-> | 1048 content::ChildProcessSecurityPolicy::GetInstance()-> |
1050 GrantPermissionsForFile(id, *file, read_file_permissions); | 1049 GrantPermissionsForFile(id, *file, read_file_permissions); |
1051 } | 1050 } |
1052 | 1051 |
1053 if (schedule_load) | 1052 if (schedule_load) |
1054 tab_loader_->ScheduleLoad(&web_contents->GetController()); | 1053 tab_loader_->ScheduleLoad(&web_contents->GetController()); |
1055 return web_contents; | 1054 return web_contents; |
1056 } | 1055 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 if (!active_session_restorers) | 1256 if (!active_session_restorers) |
1258 return false; | 1257 return false; |
1259 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1258 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1260 active_session_restorers->begin(); | 1259 active_session_restorers->begin(); |
1261 it != active_session_restorers->end(); ++it) { | 1260 it != active_session_restorers->end(); ++it) { |
1262 if ((*it)->synchronous()) | 1261 if ((*it)->synchronous()) |
1263 return true; | 1262 return true; |
1264 } | 1263 } |
1265 return false; | 1264 return false; |
1266 } | 1265 } |
OLD | NEW |