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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 void RenderViewHostImpl::FilesSelectedInChooser( 1088 void RenderViewHostImpl::FilesSelectedInChooser(
1089 const std::vector<ui::SelectedFileInfo>& files, 1089 const std::vector<ui::SelectedFileInfo>& files,
1090 FileChooserParams::Mode permissions) { 1090 FileChooserParams::Mode permissions) {
1091 // Grant the security access requested to the given files. 1091 // Grant the security access requested to the given files.
1092 for (size_t i = 0; i < files.size(); ++i) { 1092 for (size_t i = 0; i < files.size(); ++i) {
1093 const ui::SelectedFileInfo& file = files[i]; 1093 const ui::SelectedFileInfo& file = files[i];
1094 if (permissions == FileChooserParams::Save) { 1094 if (permissions == FileChooserParams::Save) {
1095 ChildProcessSecurityPolicyImpl::GetInstance()->GrantCreateReadWriteFile( 1095 ChildProcessSecurityPolicyImpl::GetInstance()->GrantCreateReadWriteFile(
1096 GetProcess()->GetID(), file.local_path); 1096 GetProcess()->GetID(), file.local_path);
1097 } else { 1097 } else {
1098 #if defined(OS_ANDROID)
1099 GURL url(file.local_path.value());
1100 if (url.SchemeIsContent()) {
1101 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadContentUrl(
1102 GetProcess()->GetID(), url);
kinuko 2013/10/29 02:52:31 We receive this as file path and then at some poin
qinmin 2013/10/29 19:14:21 For upload case, the content url should point to a
1103 } else {
1104 #endif
1098 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( 1105 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
1099 GetProcess()->GetID(), file.local_path); 1106 GetProcess()->GetID(), file.local_path);
1107 #if defined(OS_ANDROID)
1108 }
1109 #endif
1100 } 1110 }
1101 } 1111 }
1102 Send(new ViewMsg_RunFileChooserResponse(GetRoutingID(), files)); 1112 Send(new ViewMsg_RunFileChooserResponse(GetRoutingID(), files));
1103 } 1113 }
1104 1114
1105 void RenderViewHostImpl::DirectoryEnumerationFinished( 1115 void RenderViewHostImpl::DirectoryEnumerationFinished(
1106 int request_id, 1116 int request_id,
1107 const std::vector<base::FilePath>& files) { 1117 const std::vector<base::FilePath>& files) {
1108 // Grant the security access requested to the given files. 1118 // Grant the security access requested to the given files.
1109 for (std::vector<base::FilePath>::const_iterator file = files.begin(); 1119 for (std::vector<base::FilePath>::const_iterator file = files.begin();
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 void RenderViewHostImpl::AttachToFrameTree() { 2301 void RenderViewHostImpl::AttachToFrameTree() {
2292 FrameTree* frame_tree = delegate_->GetFrameTree(); 2302 FrameTree* frame_tree = delegate_->GetFrameTree();
2293 2303
2294 frame_tree->SwapMainFrame(main_render_frame_host_.get()); 2304 frame_tree->SwapMainFrame(main_render_frame_host_.get());
2295 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { 2305 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) {
2296 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); 2306 frame_tree->OnFirstNavigationAfterSwap(main_frame_id());
2297 } 2307 }
2298 } 2308 }
2299 2309
2300 } // namespace content 2310 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698