OLD | NEW |
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 <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 } | 1216 } |
1217 | 1217 |
1218 void ResourceDispatcherHostImpl::OnDataDownloadedACK(int request_id) { | 1218 void ResourceDispatcherHostImpl::OnDataDownloadedACK(int request_id) { |
1219 // TODO(michaeln): maybe throttle DataDownloaded messages | 1219 // TODO(michaeln): maybe throttle DataDownloaded messages |
1220 } | 1220 } |
1221 | 1221 |
1222 void ResourceDispatcherHostImpl::RegisterDownloadedTempFile( | 1222 void ResourceDispatcherHostImpl::RegisterDownloadedTempFile( |
1223 int child_id, int request_id, const base::FilePath& file_path) { | 1223 int child_id, int request_id, const base::FilePath& file_path) { |
1224 scoped_refptr<ShareableFileReference> reference = | 1224 scoped_refptr<ShareableFileReference> reference = |
1225 ShareableFileReference::Get(file_path); | 1225 ShareableFileReference::Get(file_path); |
1226 DCHECK(reference); | 1226 DCHECK(reference.get()); |
1227 | 1227 |
1228 registered_temp_files_[child_id][request_id] = reference; | 1228 registered_temp_files_[child_id][request_id] = reference; |
1229 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 1229 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
1230 child_id, reference->path()); | 1230 child_id, reference->path()); |
1231 | 1231 |
1232 // When the temp file is deleted, revoke permissions that the renderer has | 1232 // When the temp file is deleted, revoke permissions that the renderer has |
1233 // to that file. This covers an edge case where the file is deleted and then | 1233 // to that file. This covers an edge case where the file is deleted and then |
1234 // the same name is re-used for some other purpose, we don't want the old | 1234 // the same name is re-used for some other purpose, we don't want the old |
1235 // renderer to still have access to it. | 1235 // renderer to still have access to it. |
1236 // | 1236 // |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 | 2004 |
2005 // Add a flag to selectively bypass the data reduction proxy if the resource | 2005 // Add a flag to selectively bypass the data reduction proxy if the resource |
2006 // type is not an image. | 2006 // type is not an image. |
2007 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2007 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2008 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2008 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2009 | 2009 |
2010 return load_flags; | 2010 return load_flags; |
2011 } | 2011 } |
2012 | 2012 |
2013 } // namespace content | 2013 } // namespace content |
OLD | NEW |