OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/async_resource_handler.h" | 5 #include "chrome/browser/renderer_host/async_resource_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/process.h" | 8 #include "base/process.h" |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "chrome/browser/net/chrome_url_request_context.h" | 10 #include "chrome/browser/net/chrome_url_request_context.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 info->route_id(), request_url, | 117 info->route_id(), request_url, |
118 context->host_content_settings_map()->GetContentSettings( | 118 context->host_content_settings_map()->GetContentSettings( |
119 request_url))); | 119 request_url))); |
120 receiver_->Send(new ViewMsg_SetZoomLevelForLoadingURL(info->route_id(), | 120 receiver_->Send(new ViewMsg_SetZoomLevelForLoadingURL(info->route_id(), |
121 request_url, context->host_zoom_map()->GetZoomLevel(request_url))); | 121 request_url, context->host_zoom_map()->GetZoomLevel(request_url))); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 receiver_->Send(new ViewMsg_Resource_ReceivedResponse( | 125 receiver_->Send(new ViewMsg_Resource_ReceivedResponse( |
126 routing_id_, request_id, response->response_head)); | 126 routing_id_, request_id, response->response_head)); |
| 127 |
| 128 if (request->response_info().metadata) { |
| 129 std::vector<char> copy(request->response_info().metadata->data(), |
| 130 request->response_info().metadata->data() + |
| 131 request->response_info().metadata->size()); |
| 132 receiver_->Send(new ViewMsg_Resource_ReceivedCachedMetadata( |
| 133 routing_id_, request_id, copy)); |
| 134 } |
| 135 |
127 return true; | 136 return true; |
128 } | 137 } |
129 | 138 |
130 bool AsyncResourceHandler::OnWillStart(int request_id, | 139 bool AsyncResourceHandler::OnWillStart(int request_id, |
131 const GURL& url, | 140 const GURL& url, |
132 bool* defer) { | 141 bool* defer) { |
133 return true; | 142 return true; |
134 } | 143 } |
135 | 144 |
136 bool AsyncResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, | 145 bool AsyncResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 232 |
224 // static | 233 // static |
225 void AsyncResourceHandler::GlobalCleanup() { | 234 void AsyncResourceHandler::GlobalCleanup() { |
226 if (g_spare_read_buffer) { | 235 if (g_spare_read_buffer) { |
227 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). | 236 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). |
228 SharedIOBuffer* tmp = g_spare_read_buffer; | 237 SharedIOBuffer* tmp = g_spare_read_buffer; |
229 g_spare_read_buffer = NULL; | 238 g_spare_read_buffer = NULL; |
230 tmp->Release(); | 239 tmp->Release(); |
231 } | 240 } |
232 } | 241 } |
OLD | NEW |