Chromium Code Reviews| Index: content/browser/renderer_host/resource_dispatcher_host.cc |
| diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc |
| index 0b78183547b3aaf56fdaeba238350cee743a8188..816286a7a4f8a75a268c2fac5cc43be7d34c213c 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host.cc |
| +++ b/content/browser/renderer_host/resource_dispatcher_host.cc |
| @@ -68,7 +68,9 @@ |
| #include "net/base/request_priority.h" |
| #include "net/base/ssl_cert_request_info.h" |
| #include "net/base/upload_data.h" |
| +#include "net/http/http_cache.h" |
| #include "net/http/http_response_headers.h" |
| +#include "net/http/http_transaction_factory.h" |
| #include "net/url_request/url_request.h" |
| #include "net/url_request/url_request_context.h" |
| #include "net/url_request/url_request_job_factory.h" |
| @@ -338,9 +340,17 @@ bool ResourceDispatcherHost::OnMessageReceived(const IPC::Message& message, |
| IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest) |
| IPC_MESSAGE_HANDLER(ResourceHostMsg_FollowRedirect, OnFollowRedirect) |
| IPC_MESSAGE_HANDLER(ViewHostMsg_SwapOut_ACK, OnSwapOutACK) |
| + IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, |
| + OnDidLoadResourceFromMemoryCache) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP_EX() |
| + if (message.type() == ViewHostMsg_DidLoadResourceFromMemoryCache::ID) { |
|
darin (slow to review)
2011/07/30 05:09:32
it is a tad unfortunate that this code can't be in
James Simonsen
2011/08/02 00:14:27
I could only find one other case. They use IPC_MES
|
| + // We just needed to peek at this message. We still want it to reach its |
| + // normal destination. |
| + handled = false; |
| + } |
| + |
| filter_ = NULL; |
| return handled; |
| } |
| @@ -675,6 +685,15 @@ void ResourceDispatcherHost::OnSwapOutACK( |
| &RenderViewHost::OnSwapOutACK); |
| } |
| +void ResourceDispatcherHost::OnDidLoadResourceFromMemoryCache( |
| + const GURL& url, |
| + const std::string& security_info, |
| + const std::string& http_method, |
| + ResourceType::Type resource_type) { |
| + filter_->GetURLRequestContext(resource_type)->http_transaction_factory()-> |
| + GetCache()->OnExternalCacheHit(url, http_method); |
| +} |
| + |
| // We are explicitly forcing the download of 'url'. |
| void ResourceDispatcherHost::BeginDownload( |
| const GURL& url, |