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

Side by Side Diff: chrome/browser/renderer_host/async_resource_handler.cc

Issue 1698001: Receive cacheable metadata from the renderer and... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months 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
« no previous file with comments | « no previous file | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698