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

Side by Side Diff: android_webview/native/state_serializer.cc

Issue 1223643002: android_webview: Replace usage of GetActiveEntry by GetLastCommittedEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 "android_webview/native/state_serializer.h" 5 #include "android_webview/native/state_serializer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 // |web_contents| takes ownership of these entries after this call. 108 // |web_contents| takes ownership of these entries after this call.
109 content::NavigationController& controller = web_contents->GetController(); 109 content::NavigationController& controller = web_contents->GetController();
110 controller.Restore( 110 controller.Restore(
111 selected_entry, 111 selected_entry,
112 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, 112 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
113 &restored_entries); 113 &restored_entries);
114 DCHECK_EQ(0u, restored_entries.size()); 114 DCHECK_EQ(0u, restored_entries.size());
115 115
116 if (controller.GetActiveEntry()) { 116 if (controller.GetLastCommittedEntry()) {
117 // Set up the file access rights for the selected navigation entry. 117 // Set up the file access rights for the selected navigation entry.
118 // TODO(joth): This is duplicated from chrome/.../session_restore.cc and 118 // TODO(joth): This is duplicated from chrome/.../session_restore.cc and
119 // should be shared e.g. in NavigationController. http://crbug.com/68222 119 // should be shared e.g. in NavigationController. http://crbug.com/68222
120 const int id = web_contents->GetRenderProcessHost()->GetID(); 120 const int id = web_contents->GetRenderProcessHost()->GetID();
121 const content::PageState& page_state = 121 const content::PageState& page_state =
122 controller.GetActiveEntry()->GetPageState(); 122 controller.GetLastCommittedEntry()->GetPageState();
123 const std::vector<base::FilePath>& file_paths = 123 const std::vector<base::FilePath>& file_paths =
124 page_state.GetReferencedFiles(); 124 page_state.GetReferencedFiles();
125 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); 125 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin();
126 file != file_paths.end(); ++file) { 126 file != file_paths.end(); ++file) {
127 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, 127 content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id,
128 *file); 128 *file);
129 } 129 }
130 } 130 }
131 131
132 controller.LoadIfNecessary(); 132 controller.LoadIfNecessary();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return false; 281 return false;
282 entry->SetHttpStatusCode(http_status_code); 282 entry->SetHttpStatusCode(http_status_code);
283 } 283 }
284 284
285 return true; 285 return true;
286 } 286 }
287 287
288 } // namespace internal 288 } // namespace internal
289 289
290 } // namespace android_webview 290 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698