OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "chrome/common/resource_dispatcher.h" | 7 #include "chrome/common/resource_dispatcher.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 if (response_head.replace_extension_localization_templates) { | 330 if (response_head.replace_extension_localization_templates) { |
331 webkit_glue::ResourceLoaderBridge::Peer* new_peer = | 331 webkit_glue::ResourceLoaderBridge::Peer* new_peer = |
332 ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( | 332 ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( |
333 request_info->peer, message_sender(), response_head.mime_type, | 333 request_info->peer, message_sender(), response_head.mime_type, |
334 request_info->url); | 334 request_info->url); |
335 if (new_peer) | 335 if (new_peer) |
336 request_info->peer = new_peer; | 336 request_info->peer = new_peer; |
337 } | 337 } |
338 | 338 |
339 request_info->peer->OnReceivedResponse(response_head, false); | 339 request_info->peer->OnReceivedResponse(response_head); |
340 } | 340 } |
341 | 341 |
342 void ResourceDispatcher::OnReceivedCachedMetadata( | 342 void ResourceDispatcher::OnReceivedCachedMetadata( |
343 int request_id, const std::vector<char>& data) { | 343 int request_id, const std::vector<char>& data) { |
344 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 344 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
345 if (!request_info) | 345 if (!request_info) |
346 return; | 346 return; |
347 | 347 |
348 if (data.size()) | 348 if (data.size()) |
349 request_info->peer->OnReceivedCachedMetadata(&data.front(), data.size()); | 349 request_info->peer->OnReceivedCachedMetadata(&data.front(), data.size()); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 612 |
613 // static | 613 // static |
614 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 614 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
615 while (!queue->empty()) { | 615 while (!queue->empty()) { |
616 IPC::Message* message = queue->front(); | 616 IPC::Message* message = queue->front(); |
617 ReleaseResourcesInDataMessage(*message); | 617 ReleaseResourcesInDataMessage(*message); |
618 queue->pop_front(); | 618 queue->pop_front(); |
619 delete message; | 619 delete message; |
620 } | 620 } |
621 } | 621 } |
OLD | NEW |