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 | |
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 | |
101 // We don't care about copying the status here. | 89 // We don't care about copying the status here. |
102 result_.headers = response->head.headers; | 90 result_.headers = response->head.headers; |
103 result_.mime_type = response->head.mime_type; | 91 result_.mime_type = response->head.mime_type; |
104 result_.charset = response->head.charset; | 92 result_.charset = response->head.charset; |
105 result_.download_file_path = response->head.download_file_path; | 93 result_.download_file_path = response->head.download_file_path; |
106 result_.request_time = response->head.request_time; | 94 result_.request_time = response->head.request_time; |
107 result_.response_time = response->head.response_time; | 95 result_.response_time = response->head.response_time; |
108 result_.load_timing = response->head.load_timing; | 96 result_.load_timing = response->head.load_timing; |
109 result_.devtools_info = response->head.devtools_info; | 97 result_.devtools_info = response->head.devtools_info; |
110 return true; | 98 return true; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 149 } |
162 | 150 |
163 void SyncResourceHandler::OnDataDownloaded( | 151 void SyncResourceHandler::OnDataDownloaded( |
164 int request_id, | 152 int request_id, |
165 int bytes_downloaded) { | 153 int bytes_downloaded) { |
166 // Sync requests don't involve ResourceMsg_DataDownloaded messages | 154 // Sync requests don't involve ResourceMsg_DataDownloaded messages |
167 // being sent back to renderers as progress is made. | 155 // being sent back to renderers as progress is made. |
168 } | 156 } |
169 | 157 |
170 } // namespace content | 158 } // namespace content |
OLD | NEW |