| Index: content/browser/renderer_host/render_view_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
| index 6cbc87ff851bc2a6bea7e1b57499547eaddece07..1d2af2624cc536e81f6360317fc046b32ec0db65 100644
|
| --- a/content/browser/renderer_host/render_view_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_view_host_impl.cc
|
| @@ -930,7 +930,9 @@ void RenderViewHostImpl::OnUpdateState(int32_t page_id,
|
|
|
| // Without this check, the renderer can trick the browser into using
|
| // filenames it can't access in a future session restore.
|
| - if (!CanAccessFilesOfPageState(state)) {
|
| + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance();
|
| + int child_id = GetProcess()->GetID();
|
| + if (!policy->CanReadAllFiles(child_id, state.GetReferencedFiles())) {
|
| bad_message::ReceivedBadMessage(
|
| GetProcess(), bad_message::RVH_CAN_ACCESS_FILES_OF_PAGE_STATE);
|
| return;
|
| @@ -1222,30 +1224,6 @@ void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) {
|
| #endif
|
| }
|
|
|
| -bool RenderViewHostImpl::CanAccessFilesOfPageState(
|
| - const PageState& state) const {
|
| - ChildProcessSecurityPolicyImpl* policy =
|
| - ChildProcessSecurityPolicyImpl::GetInstance();
|
| -
|
| - const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles();
|
| - for (const auto& file : file_paths) {
|
| - if (!policy->CanReadFile(GetProcess()->GetID(), file))
|
| - return false;
|
| - }
|
| - return true;
|
| -}
|
| -
|
| -void RenderViewHostImpl::GrantFileAccessFromPageState(const PageState& state) {
|
| - ChildProcessSecurityPolicyImpl* policy =
|
| - ChildProcessSecurityPolicyImpl::GetInstance();
|
| -
|
| - const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles();
|
| - for (const auto& file : file_paths) {
|
| - if (!policy->CanReadFile(GetProcess()->GetID(), file))
|
| - policy->GrantReadFile(GetProcess()->GetID(), file);
|
| - }
|
| -}
|
| -
|
| void RenderViewHostImpl::SelectWordAroundCaret() {
|
| Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
|
| }
|
|
|