Chromium Code Reviews| 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 #include "content/browser/loader/sync_resource_handler.h" | 5 #include "content/browser/loader/sync_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/devtools/devtools_netlog_observer.h" | 8 #include "content/browser/devtools/devtools_netlog_observer.h" |
| 9 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 9 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 10 #include "content/browser/loader/resource_message_filter.h" | 10 #include "content/browser/loader/resource_message_filter.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 if (!info->filter()) | 79 if (!info->filter()) |
| 80 return false; | 80 return false; |
| 81 | 81 |
| 82 if (rdh_->delegate()) { | 82 if (rdh_->delegate()) { |
| 83 rdh_->delegate()->OnResponseStarted( | 83 rdh_->delegate()->OnResponseStarted( |
| 84 request(), info->GetContext(), response, info->filter()); | 84 request(), info->GetContext(), response, info->filter()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); | 87 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); |
| 88 | 88 |
| 89 // If the parent handler downloaded the resource to a file, grant the child | |
| 90 // read permissions on it. Note: there is similar logic in | |
| 91 // AsyncResourceHandler. | |
| 92 // | |
| 93 // TODO(davidben): Can we remove support for download_file in sync requests | |
|
darin (slow to review)
2014/03/11 05:15:58
Yes, I believe we should be able to disallow suppo
davidben
2014/03/11 19:50:04
Alright. Let's do that in a follow-up, unless you
| |
| 94 // altogether? I don't think Blink ever makes such requests. | |
| 95 if (!response->head.download_file_path.empty()) { | |
| 96 rdh_->RegisterDownloadedTempFile( | |
| 97 info->GetChildID(), info->GetRequestID(), | |
| 98 response->head.download_file_path); | |
| 99 } | |
| 100 | |
| 89 // We don't care about copying the status here. | 101 // We don't care about copying the status here. |
| 90 result_.headers = response->head.headers; | 102 result_.headers = response->head.headers; |
| 91 result_.mime_type = response->head.mime_type; | 103 result_.mime_type = response->head.mime_type; |
| 92 result_.charset = response->head.charset; | 104 result_.charset = response->head.charset; |
| 93 result_.download_file_path = response->head.download_file_path; | 105 result_.download_file_path = response->head.download_file_path; |
| 94 result_.request_time = response->head.request_time; | 106 result_.request_time = response->head.request_time; |
| 95 result_.response_time = response->head.response_time; | 107 result_.response_time = response->head.response_time; |
| 96 result_.load_timing = response->head.load_timing; | 108 result_.load_timing = response->head.load_timing; |
| 97 result_.devtools_info = response->head.devtools_info; | 109 result_.devtools_info = response->head.devtools_info; |
| 98 return true; | 110 return true; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 } | 161 } |
| 150 | 162 |
| 151 void SyncResourceHandler::OnDataDownloaded( | 163 void SyncResourceHandler::OnDataDownloaded( |
| 152 int request_id, | 164 int request_id, |
| 153 int bytes_downloaded) { | 165 int bytes_downloaded) { |
| 154 // Sync requests don't involve ResourceMsg_DataDownloaded messages | 166 // Sync requests don't involve ResourceMsg_DataDownloaded messages |
| 155 // being sent back to renderers as progress is made. | 167 // being sent back to renderers as progress is made. |
| 156 } | 168 } |
| 157 | 169 |
| 158 } // namespace content | 170 } // namespace content |
| OLD | NEW |