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

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

Issue 14985014: Introduce content::PageState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation issues. Created 7 years, 7 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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 // focused tab will be loaded by Browser, and TabLoader will load the rest. 1011 // focused tab will be loaded by Browser, and TabLoader will load the rest.
1013 DCHECK(web_contents->GetController().NeedsReload()); 1012 DCHECK(web_contents->GetController().NeedsReload());
1014 1013
1015 // Set up the file access rights for the selected navigation entry. 1014 // Set up the file access rights for the selected navigation entry.
1016 const int id = web_contents->GetRenderProcessHost()->GetID(); 1015 const int id = web_contents->GetRenderProcessHost()->GetID();
1017 const int read_file_permissions = 1016 const int read_file_permissions =
1018 base::PLATFORM_FILE_OPEN | 1017 base::PLATFORM_FILE_OPEN |
1019 base::PLATFORM_FILE_READ | 1018 base::PLATFORM_FILE_READ |
1020 base::PLATFORM_FILE_EXCLUSIVE_READ | 1019 base::PLATFORM_FILE_EXCLUSIVE_READ |
1021 base::PLATFORM_FILE_ASYNC; 1020 base::PLATFORM_FILE_ASYNC;
1022 const std::string& state = 1021 const content::PageState& page_state =
1023 tab.navigations.at(selected_index).content_state(); 1022 tab.navigations.at(selected_index).page_state();
1024 const std::vector<base::FilePath>& file_paths = 1023 const std::vector<base::FilePath>& file_paths =
1025 webkit_glue::FilePathsFromHistoryState(state); 1024 page_state.GetReferencedFiles();
1026 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); 1025 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin();
1027 file != file_paths.end(); ++file) { 1026 file != file_paths.end(); ++file) {
1028 content::ChildProcessSecurityPolicy::GetInstance()-> 1027 content::ChildProcessSecurityPolicy::GetInstance()->
1029 GrantPermissionsForFile(id, *file, read_file_permissions); 1028 GrantPermissionsForFile(id, *file, read_file_permissions);
1030 } 1029 }
1031 1030
1032 if (schedule_load) 1031 if (schedule_load)
1033 tab_loader_->ScheduleLoad(&web_contents->GetController()); 1032 tab_loader_->ScheduleLoad(&web_contents->GetController());
1034 return web_contents; 1033 return web_contents;
1035 } 1034 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 if (!active_session_restorers) 1235 if (!active_session_restorers)
1237 return false; 1236 return false;
1238 for (std::set<SessionRestoreImpl*>::const_iterator it = 1237 for (std::set<SessionRestoreImpl*>::const_iterator it =
1239 active_session_restorers->begin(); 1238 active_session_restorers->begin();
1240 it != active_session_restorers->end(); ++it) { 1239 it != active_session_restorers->end(); ++it) {
1241 if ((*it)->synchronous()) 1240 if ((*it)->synchronous())
1242 return true; 1241 return true;
1243 } 1242 }
1244 return false; 1243 return false;
1245 } 1244 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service_unittest.cc » ('j') | content/public/common/page_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698