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/renderer_host/async_resource_handler.h" | 5 #include "content/browser/renderer_host/async_resource_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // request commits, avoiding the possibility of e.g. zooming the old content | 126 // request commits, avoiding the possibility of e.g. zooming the old content |
127 // or of having to layout the new content twice. | 127 // or of having to layout the new content twice. |
128 net::URLRequest* request = rdh_->GetURLRequest( | 128 net::URLRequest* request = rdh_->GetURLRequest( |
129 GlobalRequestID(filter_->child_id(), request_id)); | 129 GlobalRequestID(filter_->child_id(), request_id)); |
130 | 130 |
131 if (rdh_->delegate()) | 131 if (rdh_->delegate()) |
132 rdh_->delegate()->OnResponseStarted(request, response, filter_); | 132 rdh_->delegate()->OnResponseStarted(request, response, filter_); |
133 | 133 |
134 DevToolsNetLogObserver::PopulateResponseInfo(request, response); | 134 DevToolsNetLogObserver::PopulateResponseInfo(request, response); |
135 | 135 |
136 const content::ResourceContext& resource_context = | 136 content::ResourceContext* resource_context = filter_->resource_context(); |
137 filter_->resource_context(); | 137 content::HostZoomMap* host_zoom_map = resource_context->GetHostZoomMap(); |
138 content::HostZoomMap* host_zoom_map = resource_context.host_zoom_map(); | |
139 | 138 |
140 ResourceDispatcherHostRequestInfo* info = rdh_->InfoForRequest(request); | 139 ResourceDispatcherHostRequestInfo* info = rdh_->InfoForRequest(request); |
141 if (info->resource_type() == ResourceType::MAIN_FRAME && host_zoom_map) { | 140 if (info->resource_type() == ResourceType::MAIN_FRAME && host_zoom_map) { |
142 GURL request_url(request->url()); | 141 GURL request_url(request->url()); |
143 filter_->Send(new ViewMsg_SetZoomLevelForLoadingURL( | 142 filter_->Send(new ViewMsg_SetZoomLevelForLoadingURL( |
144 info->route_id(), | 143 info->route_id(), |
145 request_url, host_zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL( | 144 request_url, host_zoom_map->GetZoomLevel(net::GetHostOrSpecFromURL( |
146 request_url)))); | 145 request_url)))); |
147 } | 146 } |
148 | 147 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 276 |
278 // static | 277 // static |
279 void AsyncResourceHandler::GlobalCleanup() { | 278 void AsyncResourceHandler::GlobalCleanup() { |
280 if (g_spare_read_buffer) { | 279 if (g_spare_read_buffer) { |
281 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). | 280 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). |
282 SharedIOBuffer* tmp = g_spare_read_buffer; | 281 SharedIOBuffer* tmp = g_spare_read_buffer; |
283 g_spare_read_buffer = NULL; | 282 g_spare_read_buffer = NULL; |
284 tmp->Release(); | 283 tmp->Release(); |
285 } | 284 } |
286 } | 285 } |
OLD | NEW |