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

Side by Side Diff: content/browser/loader/resource_dispatcher_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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) { 207 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) {
208 fileapi::FileSystemURL url = 208 fileapi::FileSystemURL url =
209 file_system_context->CrackURL(iter->filesystem_url()); 209 file_system_context->CrackURL(iter->filesystem_url());
210 if (!policy->CanReadFileSystemFile(child_id, url)) { 210 if (!policy->CanReadFileSystemFile(child_id, url)) {
211 NOTREACHED() << "Denied unauthorized upload of " 211 NOTREACHED() << "Denied unauthorized upload of "
212 << iter->filesystem_url().spec(); 212 << iter->filesystem_url().spec();
213 return false; 213 return false;
214 } 214 }
215 } 215 }
216 #if defined(OS_ANDROID)
217 if (iter->type() == ResourceRequestBody::Element::TYPE_CONTENT_URL &&
218 !policy->CanReadContentUrl(child_id, iter->content_url())) {
219 NOTREACHED() << "Denied unauthorized upload of "
220 << iter->content_url().spec();
221 return false;
222 }
223 #endif
216 } 224 }
217 } 225 }
218 226
219 return true; 227 return true;
220 } 228 }
221 229
222 void RemoveDownloadFileFromChildSecurityPolicy(int child_id, 230 void RemoveDownloadFileFromChildSecurityPolicy(int child_id,
223 const base::FilePath& path) { 231 const base::FilePath& path) {
224 ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile( 232 ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile(
225 child_id, path); 233 child_id, path);
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 1920 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
1913 && !policy->CanReadRawCookies(child_id)) { 1921 && !policy->CanReadRawCookies(child_id)) {
1914 VLOG(1) << "Denied unauthorized request for raw headers"; 1922 VLOG(1) << "Denied unauthorized request for raw headers";
1915 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 1923 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
1916 } 1924 }
1917 1925
1918 return load_flags; 1926 return load_flags;
1919 } 1927 }
1920 1928
1921 } // namespace content 1929 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698