diff options
32 files changed, 17 insertions, 659 deletions
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index c18a4ff..d11b0dc 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -2220,14 +2220,6 @@ > </File> <File - RelativePath=".\renderer_host\media_resource_handler.cc" - > - </File> - <File - RelativePath=".\renderer_host\media_resource_handler.h" - > - </File> - <File RelativePath=".\renderer_host\render_process_host.cc" > </File> diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 6a3f404..304b506 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -197,16 +197,6 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOffTheRecord( } // static -ChromeURLRequestContext* ChromeURLRequestContext::CreateOffTheRecordForMedia( - Profile* profile, const FilePath& disk_cache_path) { - // TODO(hclam): since we don't have an implementation of disk cache backend - // for media files in OTR mode, we create a request context just like the - // original one. - DCHECK(profile->IsOffTheRecord()); - return CreateRequestContextForMedia(profile, disk_cache_path, true); -} - -// static ChromeURLRequestContext* ChromeURLRequestContext::CreateOffTheRecordForExtensions(Profile* profile) { DCHECK(profile->IsOffTheRecord()); @@ -233,8 +223,7 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateRequestContextForMedia( // Also share the cookie store of the common profile. context->cookie_store_ = original_context->cookie_store(); - // Create a media cache with maximum size of ~1.8GB, which is a - // size cache backend won't complain. + // Create a media cache with default size. // TODO(hclam): make the maximum size of media cache configurable. net::HttpCache* original_cache = original_context->http_transaction_factory()->GetCache(); @@ -248,21 +237,15 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateRequestContextForMedia( net::HttpNetworkLayer* original_network_layer = static_cast<net::HttpNetworkLayer*>(original_cache->network_layer()); cache = new net::HttpCache(original_network_layer->GetSession(), - disk_cache_path.ToWStringHack(), kint32max - kint32max / 10 - 1); + disk_cache_path.ToWStringHack(), 0); } else { // If original HttpCache doesn't exist, simply construct one with a whole // new set of network stack. cache = new net::HttpCache(original_context->proxy_service(), - disk_cache_path.ToWStringHack(), kint32max - kint32max / 10 - 1); - } - - // Set the cache type to media. - if (off_the_record) { - cache->set_type(net::TEMP_MEDIA_CACHE); - } else { - cache->set_type(net::MEDIA_CACHE); + disk_cache_path.ToWStringHack(), 0); } + cache->set_type(net::MEDIA_CACHE); context->http_transaction_factory_ = cache; return context; } diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h index 5ef64d6..bf8d119 100644 --- a/chrome/browser/net/chrome_url_request_context.h +++ b/chrome/browser/net/chrome_url_request_context.h @@ -47,10 +47,6 @@ class ChromeURLRequestContext : public URLRequestContext, // called on the UI thread. static ChromeURLRequestContext* CreateOffTheRecord(Profile* profile); - // Create an instance of request context for OTR profile for media resources. - static ChromeURLRequestContext* CreateOffTheRecordForMedia(Profile* profile, - const FilePath& disk_cache_path); - // Create an instance of request context for OTR profile for extensions. static ChromeURLRequestContext* CreateOffTheRecordForExtensions( Profile* profile); diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 1435288..e5d007e 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -100,7 +100,6 @@ class OffTheRecordProfileImpl : public Profile, public: explicit OffTheRecordProfileImpl(Profile* real_profile) : profile_(real_profile), - media_request_context_(NULL), extensions_request_context_(NULL), start_time_(Time::Now()) { request_context_ = ChromeURLRequestContext::CreateOffTheRecord(this); @@ -117,7 +116,6 @@ class OffTheRecordProfileImpl : public Profile, virtual ~OffTheRecordProfileImpl() { CleanupRequestContext(request_context_); - CleanupRequestContext(media_request_context_); CleanupRequestContext(extensions_request_context_); } @@ -237,26 +235,8 @@ class OffTheRecordProfileImpl : public Profile, } virtual URLRequestContext* GetRequestContextForMedia() { - if (!media_request_context_) { - FilePath cache_path = GetPath(); - - // Override the cache location if specified by the user. - const std::wstring user_cache_dir( - CommandLine::ForCurrentProcess()->GetSwitchValue( - switches::kDiskCacheDir)); - if (!user_cache_dir.empty()) { - cache_path = FilePath::FromWStringHack(user_cache_dir); - } - - cache_path = cache_path.Append(chrome::kOffTheRecordMediaCacheDirname); - media_request_context_ = - ChromeURLRequestContext::CreateOffTheRecordForMedia( - this, cache_path); - media_request_context_->AddRef(); - - DCHECK(media_request_context_->cookie_store()); - } - return media_request_context_; + // In OTR mode, media request context is the same as the original one. + return request_context_; } URLRequestContext* GetRequestContextForExtensions() { @@ -377,9 +357,6 @@ class OffTheRecordProfileImpl : public Profile, // The context to use for requests made from this OTR session. ChromeURLRequestContext* request_context_; - // The context for requests for media resources. - ChromeURLRequestContext* media_request_context_; - ChromeURLRequestContext* extensions_request_context_; // The download manager that only stores downloaded items in memory. diff --git a/chrome/browser/renderer_host/media_resource_handler.cc b/chrome/browser/renderer_host/media_resource_handler.cc deleted file mode 100644 index ca79b0d..0000000 --- a/chrome/browser/renderer_host/media_resource_handler.cc +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/renderer_host/media_resource_handler.h" - -#include "base/process.h" -#include "chrome/common/render_messages.h" -#include "net/base/load_flags.h" - -MediaResourceHandler::MediaResourceHandler( - ResourceHandler* resource_handler, - ResourceDispatcherHost::Receiver* receiver, - int render_process_host_id, - int routing_id, - base::ProcessHandle render_process, - ResourceDispatcherHost* resource_dispatcher_host) - : receiver_(receiver), - render_process_host_id_(render_process_host_id), - routing_id_(routing_id), - render_process_(render_process), - handler_(resource_handler), - rdh_(resource_dispatcher_host), - has_file_handle_(false), - position_(0), - size_(-1) { -} - -bool MediaResourceHandler::OnUploadProgress(int request_id, - uint64 position, - uint64 size) { - return handler_->OnUploadProgress(request_id, position, size); -} - -bool MediaResourceHandler::OnRequestRedirected(int request_id, - const GURL& new_url) { - return handler_->OnRequestRedirected(request_id, new_url); -} - -bool MediaResourceHandler::OnResponseStarted(int request_id, - ResourceResponse* response) { -#if defined(OS_POSIX) - if (response->response_head.response_data_file.fd != - base::kInvalidPlatformFileValue) { - // On POSIX, we will just set auto_close to true, and the IPC infrastructure - // will send this file handle through and close it automatically. - response->response_head.response_data_file.auto_close = true; - has_file_handle_ = true; - } -#elif defined(OS_WIN) - if (response->response_head.response_data_file != - base::kInvalidPlatformFileValue) { - // On Windows, we duplicate the file handle for the renderer process and - // close the original manually. - base::PlatformFile foreign_handle; - if (DuplicateHandle(GetCurrentProcess(), - response->response_head.response_data_file, - render_process_, - &foreign_handle, - FILE_READ_DATA, // Only allow read access to data. - false, // Foreign handle is not inheritable. - // Close the file handle after duplication. - DUPLICATE_CLOSE_SOURCE)){ - response->response_head.response_data_file = foreign_handle; - has_file_handle_ = true; - } else { - has_file_handle_ = false; - } - } -#endif - size_ = response->response_head.content_length; - return handler_->OnResponseStarted(request_id, response); -} - -bool MediaResourceHandler::OnWillRead(int request_id, - net::IOBuffer** buf, int* buf_size, - int min_size) { - return handler_->OnWillRead(request_id, buf, buf_size, min_size); -} - -bool MediaResourceHandler::OnReadCompleted(int request_id, int* bytes_read) { - if (has_file_handle_) { - // If we have received a file handle before we will be sending a progress - // update for download. - // TODO(hclam): rate limit this message so we won't be sending too much to - // the renderer process. - receiver_->Send( - new ViewMsg_Resource_DownloadProgress(routing_id_, request_id, - position_, size_)); - position_ += *bytes_read; - } - return handler_->OnReadCompleted(request_id, bytes_read); -} - -bool MediaResourceHandler::OnResponseCompleted(int request_id, - const URLRequestStatus& status, const std::string& security_info) { - return handler_->OnResponseCompleted(request_id, status, security_info); -} diff --git a/chrome/browser/renderer_host/media_resource_handler.h b/chrome/browser/renderer_host/media_resource_handler.h deleted file mode 100644 index 93be6d706..0000000 --- a/chrome/browser/renderer_host/media_resource_handler.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_RENDERER_HOST_MEDIA_RESOURCE_HANDLER_H_ -#define CHROME_BROWSER_RENDERER_HOST_MEDIA_RESOURCE_HANDLER_H_ - -#include "base/process.h" -#include "base/platform_file.h" -#include "chrome/browser/renderer_host/resource_dispatcher_host.h" -#include "chrome/browser/renderer_host/resource_handler.h" - -// Used to complete a media resource request in response to resource load events -// from the resource dispatcher host. This handler only works asynchronously and -// tries to work with file for response data if possible. If a response data -// file is not available, it redirects calls to underlying handler. -class MediaResourceHandler : public ResourceHandler { - public: - MediaResourceHandler(ResourceHandler* resource_handler, - ResourceDispatcherHost::Receiver* receiver, - int render_process_host_id, - int routing_id, - base::ProcessHandle render_process, - ResourceDispatcherHost* resource_dispatcher_host); - - // ResourceHandler implementation: - bool OnUploadProgress(int request_id, uint64 position, uint64 size); - bool OnRequestRedirected(int request_id, const GURL& new_url); - bool OnResponseStarted(int request_id, ResourceResponse* response); - bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, - int min_size); - bool OnReadCompleted(int request_id, int* bytes_read); - bool OnResponseCompleted(int request_id, const URLRequestStatus& status, - const std::string& security_info); - - private: - ResourceDispatcherHost::Receiver* receiver_; - int render_process_host_id_; - int routing_id_; - base::ProcessHandle render_process_; - scoped_refptr<ResourceHandler> handler_; - ResourceDispatcherHost* rdh_; - bool has_file_handle_; - int64 position_; - int64 size_; - - DISALLOW_COPY_AND_ASSIGN(MediaResourceHandler); -}; - -#endif // CHROME_BROWSER_RENDERER_HOST_MEDIA_RESOURCE_HANDLER_H_ diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index fc57748..8f1e329 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -26,7 +26,6 @@ #include "chrome/browser/renderer_host/buffered_resource_handler.h" #include "chrome/browser/renderer_host/cross_site_resource_handler.h" #include "chrome/browser/renderer_host/download_resource_handler.h" -#include "chrome/browser/renderer_host/media_resource_handler.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/resource_request_details.h" #include "chrome/browser/renderer_host/safe_browsing_resource_handler.h" @@ -231,7 +230,6 @@ bool ResourceDispatcherHost::OnMessageReceived(const IPC::Message& message, IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_SyncLoad, OnSyncLoad) IPC_MESSAGE_HANDLER(ViewHostMsg_DataReceived_ACK, OnDataReceivedACK) - IPC_MESSAGE_HANDLER(ViewHostMsg_DownloadProgress_ACK, OnDownloadProgressACK) IPC_MESSAGE_HANDLER(ViewHostMsg_UploadProgress_ACK, OnUploadProgressACK) IPC_MESSAGE_HANDLER(ViewHostMsg_CancelRequest, OnCancelRequest) IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) @@ -313,17 +311,6 @@ void ResourceDispatcherHost::BeginRequest( receiver_->handle(), request_data.url, this); - // If the resource type is ResourceType::MEDIA and LOAD_ENABLE_DOWNLOAD_FILE - // is enabled we insert a media resource handler. - if (request_data.resource_type == ResourceType::MEDIA && - (request_data.load_flags & net::LOAD_ENABLE_DOWNLOAD_FILE)) { - handler = new MediaResourceHandler(handler, - receiver_, - process_id, - route_id, - receiver_->handle(), - this); - } } if (HandleExternalProtocol(request_id, process_id, route_id, @@ -435,10 +422,6 @@ void ResourceDispatcherHost::DataReceivedACK(int process_id, int request_id) { } } -void ResourceDispatcherHost::OnDownloadProgressACK(int request_id) { - // TODO(hclam): do something to help rate limiting the message. -} - void ResourceDispatcherHost::OnUploadProgressACK(int request_id) { int process_id = receiver_->GetProcessId(); PendingRequestList::iterator i = pending_requests_.find( @@ -916,16 +899,6 @@ bool ResourceDispatcherHost::CompleteResponseStarted(URLRequest* request) { response->response_head.app_cache_id = WebAppCacheContext::kNoAppCacheId; request->GetMimeType(&response->response_head.mime_type); - // Make sure we don't get a file handle if LOAD_ENABLE_DOWNLOAD_FILE is not - // set. - DCHECK((request->load_flags() & net::LOAD_ENABLE_DOWNLOAD_FILE) || - request->response_data_file() == base::kInvalidPlatformFileValue); -#if defined(OS_POSIX) - response->response_head.response_data_file.fd = request->response_data_file(); -#elif defined(OS_WIN) - response->response_head.response_data_file = request->response_data_file(); -#endif - if (request->ssl_info().cert) { int cert_id = CertStore::GetSharedInstance()->StoreCert( diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h index fd6e06c..ecabe59 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host.h @@ -490,7 +490,6 @@ class ResourceDispatcherHost : public URLRequest::Delegate { IPC::Message* sync_result, // only valid for sync int route_id); // only valid for async void OnDataReceivedACK(int request_id); - void OnDownloadProgressACK(int request_id); void OnUploadProgressACK(int request_id); void OnCancelRequest(int request_id); diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index 7ca5421..6a28e81 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -358,14 +358,11 @@ URLRequestContext* ResourceMessageFilter::GetRequestContext( uint32 request_id, const ViewHostMsg_Resource_Request& request_data) { URLRequestContext* request_context = request_context_; - // If the request has resource type of ResourceType::MEDIA and - // LOAD_ENABLE_DOWNLOAD_FILE is set as a load flag, we use a request context - // specific to media for handling it because these resources have specific - // needs for caching and data passing. - if (request_data.resource_type == ResourceType::MEDIA && - (request_data.load_flags & net::LOAD_ENABLE_DOWNLOAD_FILE)) { + // If the request has resource type of ResourceType::MEDIA, we use a request + // context specific to media for handling it because these resources have + // specific needs for caching. + if (request_data.resource_type == ResourceType::MEDIA) request_context = media_request_context_; - } return request_context; } diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ef24b7e..9df69c0 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1189,8 +1189,6 @@ 'browser/renderer_host/download_resource_handler.h', 'browser/renderer_host/download_throttling_resource_handler.cc', 'browser/renderer_host/download_throttling_resource_handler.h', - 'browser/renderer_host/media_resource_handler.cc', - 'browser/renderer_host/media_resource_handler.h', 'browser/renderer_host/render_process_host.cc', 'browser/renderer_host/render_process_host.h', 'browser/renderer_host/render_view_host.cc', diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 7bcfa79..4511b0e 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1319,7 +1319,6 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { WriteParam(m, p.security_info); WriteParam(m, p.content_length); WriteParam(m, p.app_cache_id); - WriteParam(m, p.response_data_file); } static bool Read(const Message* m, void** iter, param_type* r) { return @@ -1330,8 +1329,7 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { ReadParam(m, iter, &r->charset) && ReadParam(m, iter, &r->security_info) && ReadParam(m, iter, &r->content_length) && - ReadParam(m, iter, &r->app_cache_id) && - ReadParam(m, iter, &r->response_data_file); + ReadParam(m, iter, &r->app_cache_id); } static void Log(const param_type& p, std::wstring* l) { l->append(L"("); diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index 727244f..d598b39 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.cc @@ -294,29 +294,6 @@ bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { return true; } -void ResourceDispatcher::OnDownloadProgress( - const IPC::Message& message, int request_id, int64 position, int64 size) { - PendingRequestList::iterator it = pending_requests_.find(request_id); - if (it == pending_requests_.end()) { - DLOG(WARNING) << "Got download progress for a nonexistant or " - " finished requests"; - return; - } - - PendingRequestInfo& request_info = it->second; - - RESOURCE_LOG("Dispatching download progress for " << - request_info.peer->GetURLForDebugging()); - request_info.peer->OnDownloadProgress(position, size); - - // Send the ACK message back. - IPC::Message::Sender* sender = message_sender(); - if (sender) { - sender->Send( - new ViewHostMsg_DownloadProgress_ACK(message.routing_id(), request_id)); - } -} - void ResourceDispatcher::OnUploadProgress( const IPC::Message& message, int request_id, int64 position, int64 size) { PendingRequestList::iterator it = pending_requests_.find(request_id); @@ -504,7 +481,6 @@ void ResourceDispatcher::SetDefersLoading(int request_id, bool value) { void ResourceDispatcher::DispatchMessage(const IPC::Message& message) { IPC_BEGIN_MESSAGE_MAP(ResourceDispatcher, message) IPC_MESSAGE_HANDLER(ViewMsg_Resource_UploadProgress, OnUploadProgress) - IPC_MESSAGE_HANDLER(ViewMsg_Resource_DownloadProgress, OnDownloadProgress) IPC_MESSAGE_HANDLER(ViewMsg_Resource_ReceivedResponse, OnReceivedResponse) IPC_MESSAGE_HANDLER(ViewMsg_Resource_ReceivedRedirect, OnReceivedRedirect) IPC_MESSAGE_HANDLER(ViewMsg_Resource_DataReceived, OnReceivedData) @@ -559,7 +535,6 @@ webkit_glue::ResourceLoaderBridge* ResourceDispatcher::CreateBridge( bool ResourceDispatcher::IsResourceDispatcherMessage( const IPC::Message& message) { switch (message.type()) { - case ViewMsg_Resource_DownloadProgress::ID: case ViewMsg_Resource_UploadProgress::ID: case ViewMsg_Resource_ReceivedResponse::ID: case ViewMsg_Resource_ReceivedRedirect::ID: diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h index f1933bc..1ba1fa5 100644 --- a/chrome/common/resource_dispatcher.h +++ b/chrome/common/resource_dispatcher.h @@ -91,8 +91,6 @@ class ResourceDispatcher { int request_id, int64 position, int64 size); - void OnDownloadProgress(const IPC::Message& message, - int request_id, int64 position, int64 size); void OnReceivedResponse(int request_id, const ResourceResponseHead&); void OnReceivedRedirect(int request_id, const GURL& new_url); void OnReceivedData(const IPC::Message& message, diff --git a/net/base/cache_type.h b/net/base/cache_type.h index 4ba487f..341ce7a 100644 --- a/net/base/cache_type.h +++ b/net/base/cache_type.h @@ -12,7 +12,6 @@ enum CacheType { DISK_CACHE, // Disk is used as the backing storage. MEMORY_CACHE, // Data is stored only in memory. MEDIA_CACHE, // Optimized to handle media files. - TEMP_MEDIA_CACHE // Optimized for media files while off the record. }; } // namespace disk_cache diff --git a/net/base/load_flags.h b/net/base/load_flags.h index 09851ec..f60163f35 100644 --- a/net/base/load_flags.h +++ b/net/base/load_flags.h @@ -37,11 +37,6 @@ enum { // If present, upload progress messages should be provided to initiator. LOAD_ENABLE_UPLOAD_PROGRESS = 1 << 6, - // If present, try to download the resource to a standalone file. - // This hint tells the http cache to provide a native file handle - // of the cached file to the renderer process. - LOAD_ENABLE_DOWNLOAD_FILE = 1 << 7, - // If present, ignores certificate mismatches with the domain name. // (The default behavior is to trigger an OnSSLCertificateError callback.) LOAD_IGNORE_CERT_COMMON_NAME_INVALID = 1 << 8, diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 2fbcfa9..bd510c0 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -1310,18 +1310,15 @@ TEST_F(DiskCacheTest, MultipleInstances) { ScopedTestCache store2(L"cache_test2"); ScopedTestCache store3(L"cache_test3"); - const int kNumberOfCaches = 3; + const int kNumberOfCaches = 2; scoped_ptr<disk_cache::Backend> cache[kNumberOfCaches]; cache[0].reset(disk_cache::CreateCacheBackend(store1.path_wstring(), false, 0, net::DISK_CACHE)); cache[1].reset(disk_cache::CreateCacheBackend(store2.path_wstring(), false, 0, net::MEDIA_CACHE)); - cache[2].reset(disk_cache::CreateCacheBackend(store3.path_wstring(), false, 0, - net::TEMP_MEDIA_CACHE)); - ASSERT_TRUE(cache[0].get() != NULL && cache[1].get() != NULL && - cache[2].get() != NULL); + ASSERT_TRUE(cache[0].get() != NULL && cache[1].get() != NULL); std::string key("the first key"); disk_cache::Entry* entry; diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index 5eb6d2c..de40554 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -12,7 +12,6 @@ #include <vector> #include "base/basictypes.h" -#include "base/platform_file.h" #include "base/time.h" #include "net/base/cache_type.h" #include "net/base/completion_callback.h" @@ -155,28 +154,6 @@ class Entry { net::CompletionCallback* completion_callback, bool truncate) = 0; - // Prepares a target stream as an external file, returns a corresponding - // base::PlatformFile if successful, returns base::kInvalidPlatformFileValue - // if fails. If this call returns a valid base::PlatformFile value (i.e. - // not base::kInvalidPlatformFileValue), there is no guarantee that the file - // is truncated. Implementor can always return base::kInvalidPlatformFileValue - // if external file is not available in that particular implementation. - // The caller should close the file handle returned by this method or there - // will be a leak. - // With a stream prepared as an external file, the stream would always be - // kept in an external file since creation, even if the stream has 0 bytes. - // So we need to be cautious about using this option for preparing a stream or - // we will end up having a lot of empty cache files. Calling this method also - // means that all data written to the stream will always be written to file - // directly *without* buffering. - virtual base::PlatformFile UseExternalFile(int index) = 0; - - // Returns an asynchronous read file handle for the cache stream referenced by - // |index|. Values other than base::kInvalidPlatformFileValue are successful - // and the file handle should be managed by the caller, i.e. the caller should - // close the handle after use or there will be a leak. - virtual base::PlatformFile GetPlatformFile(int index) = 0; - protected: virtual ~Entry() {} }; diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc index a000785..e0853b7 100644 --- a/net/disk_cache/entry_impl.cc +++ b/net/disk_cache/entry_impl.cc @@ -81,7 +81,6 @@ EntryImpl::EntryImpl(BackendImpl* backend, Addr address) backend_ = backend; for (int i = 0; i < NUM_STREAMS; i++) { unreported_size_[i] = 0; - need_file_[i] = false; } } @@ -303,9 +302,7 @@ int EntryImpl::WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, backend_->OnEvent(Stats::WRITE_DATA); - // If we have prepared the cache as an external file, we should never use - // user_buffers_ and always write to file directly. - if (!need_file_[index] && user_buffers_[index].get()) { + if (user_buffers_[index].get()) { // Complete the operation locally. if (!buf_len) return 0; @@ -354,43 +351,6 @@ int EntryImpl::WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING; } -base::PlatformFile EntryImpl::UseExternalFile(int index) { - DCHECK(index >= 0 && index < NUM_STREAMS); - - Addr address(entry_.Data()->data_addr[index]); - - // We will not prepare the cache file since the entry is already initialized, - // just return the platform file backing the cache. - if (address.is_initialized()) - return GetPlatformFile(index); - - if (!backend_->CreateExternalFile(&address)) - return base::kInvalidPlatformFileValue; - - entry_.Data()->data_addr[index] = address.value(); - entry_.Store(); - - // Set the flag for this stream so we never use user_buffer_. - // TODO(hclam): do we need to save this information to EntryStore? - need_file_[index] = true; - - return GetPlatformFile(index); -} - -base::PlatformFile EntryImpl::GetPlatformFile(int index) { - DCHECK(index >= 0 && index < NUM_STREAMS); - - Addr address(entry_.Data()->data_addr[index]); - if (!address.is_initialized() || !address.is_separate_file()) - return base::kInvalidPlatformFileValue; - - return base::CreatePlatformFile(backend_->GetFileName(address), - base::PLATFORM_FILE_OPEN | - base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_ASYNC, - NULL); -} - uint32 EntryImpl::GetHash() { return entry_.Data()->hash; } @@ -675,15 +635,6 @@ bool EntryImpl::PrepareTarget(int index, int offset, int buf_len, bool truncate) { Addr address(entry_.Data()->data_addr[index]); - // If we are instructed to use an external file, we should never buffer when - // writing. We are done with preparation of the target automatically, since - // we have already created the external file for writing. - if (need_file_[index]) { - // Make sure the stream is initialized and is kept in an external file. - DCHECK(address.is_initialized() && address.is_separate_file()); - return true; - } - if (address.is_initialized() || user_buffers_[index].get()) return GrowUserBuffer(index, offset, buf_len, truncate); diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h index 71a960a..39ba186 100644 --- a/net/disk_cache/entry_impl.h +++ b/net/disk_cache/entry_impl.h @@ -33,8 +33,6 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, net::CompletionCallback* completion_callback, bool truncate); - virtual base::PlatformFile UseExternalFile(int index); - virtual base::PlatformFile GetPlatformFile(int index); inline CacheEntryBlock* entry() { return &entry_; @@ -146,8 +144,6 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { // data and key. int unreported_size_[NUM_STREAMS]; // Bytes not reported yet to the backend. bool doomed_; // True if this entry was removed from the cache. - bool need_file_[NUM_STREAMS]; // True if stream is prepared as an external - // file. DISALLOW_EVIL_CONSTRUCTORS(EntryImpl); }; diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index a79b3f7..e48acb5 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc @@ -832,102 +832,3 @@ TEST_F(DiskCacheEntryTest, MemoryOnlyDoomedEntry) { InitCache(); DoomEntry(); } - -// Check that we can hint an entry to use external file and the return value -// is a valid file handle. -TEST_F(DiskCacheEntryTest, UseExternalFile) { - InitCache(); - - disk_cache::Entry* entry; - ASSERT_TRUE(cache_->CreateEntry("key", &entry)); - base::PlatformFile cache_file = entry->UseExternalFile(0); - - // We should have a valid file handle. - EXPECT_NE(base::kInvalidPlatformFileValue, cache_file); - scoped_refptr<disk_cache::File> file(new disk_cache::File(cache_file)); - - // 4KB. - size_t kDataSize = 0x1000; - scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kDataSize); - - CacheTestFillBuffer(buffer->data(), kDataSize, false); - ASSERT_EQ(0U, file->GetLength()); - ASSERT_EQ(kDataSize, static_cast<size_t>( - entry->WriteData(0, 0, buffer, kDataSize, NULL, false))); - ASSERT_EQ(kDataSize, file->GetLength()); - entry->Close(); -} - -// Make sure we can use Entry::GetPlatformFile on an entry stored in an external -// file and get a valid file handle. -TEST_F(DiskCacheEntryTest, GetPlatformFile) { - InitCache(); - - disk_cache::Entry* entry; - ASSERT_TRUE(cache_->CreateEntry("key", &entry)); - EXPECT_NE(base::kInvalidPlatformFileValue, entry->UseExternalFile(0)); - - size_t kDataSize = 50; - scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kDataSize); - - // Fill the data buffer and write it to cache. - CacheTestFillBuffer(buffer->data(), kDataSize, false); - ASSERT_EQ(kDataSize,static_cast<size_t>( - entry->WriteData(0, 0, buffer, kDataSize, NULL, false))); - - // Close the entry. - entry->Close(); - - // Open the entry again and get it's file handle. - ASSERT_TRUE(cache_->OpenEntry("key", &entry)); - base::PlatformFile cache_file = entry->GetPlatformFile(0); - - // Make sure it's a valid file handle and verify the size of the file. - scoped_refptr<disk_cache::File> file(new disk_cache::File(cache_file)); - ASSERT_EQ(kDataSize, file->GetLength()); - - entry->Close(); -} - -// Test the behavior of EntryImpl that small entries are kept in block files -// or buffer, and only entries above certain size would be stored in an -// external file, make sure GetPlatformFile() works with both cases without -// using UseExternalFile(). -TEST_F(DiskCacheEntryTest, GetPlatformFileVariableEntrySize) { - InitCache(); - - disk_cache::Entry* entry; - - // Make the buffer just larger than disk_cache::kMaxBlockSize. - const size_t kLargeDataSize = disk_cache::kMaxBlockSize + 1; - const size_t kSmallDataSize = kLargeDataSize / 2; - scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kLargeDataSize); - - // 1. First test with small entry. - ASSERT_TRUE(cache_->CreateEntry("small_entry", &entry)); - - CacheTestFillBuffer(buffer->data(), kSmallDataSize, false); - ASSERT_EQ(kSmallDataSize, static_cast<size_t>( - entry->WriteData(0, 0, buffer, kSmallDataSize, NULL, false))); - - // Make sure we don't get an external file. - ASSERT_EQ(base::kInvalidPlatformFileValue, entry->GetPlatformFile(0)); - - entry->Close(); - - // 2. Test with large entry. - ASSERT_TRUE(cache_->CreateEntry("large_entry", &entry)); - - CacheTestFillBuffer(buffer->data(), kLargeDataSize, false); - ASSERT_EQ(kLargeDataSize, static_cast<size_t>( - entry->WriteData(0, 0, buffer, kLargeDataSize, NULL, false))); - - base::PlatformFile cache_file = entry->GetPlatformFile(0); - EXPECT_NE(base::kInvalidPlatformFileValue, cache_file); - - // Make sure it's a valid file handle and verify the size of the file. - scoped_refptr<disk_cache::File> file(new disk_cache::File(cache_file)); - ASSERT_EQ(kLargeDataSize, file->GetLength()); - - entry->Close(); -} diff --git a/net/disk_cache/histogram_macros.h b/net/disk_cache/histogram_macros.h index ef88ccf..6ff66ea 100644 --- a/net/disk_cache/histogram_macros.h +++ b/net/disk_cache/histogram_macros.h @@ -56,9 +56,6 @@ case net::MEDIA_CACHE:\ UMA_HISTOGRAM_##type(my_name.data(), sample);\ break;\ - case net::TEMP_MEDIA_CACHE:\ - UMA_HISTOGRAM_##type(my_name.data(), sample);\ - break;\ default:\ NOTREACHED();\ break;\ diff --git a/net/disk_cache/mem_entry_impl.h b/net/disk_cache/mem_entry_impl.h index f51bf601..42fad96 100644 --- a/net/disk_cache/mem_entry_impl.h +++ b/net/disk_cache/mem_entry_impl.h @@ -29,14 +29,6 @@ class MemEntryImpl : public Entry { virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, net::CompletionCallback* completion_callback, bool truncate); - virtual base::PlatformFile UseExternalFile(int index) { - // MemEntryImpl doesn't support caching to an external file. - return base::kInvalidPlatformFileValue; - } - virtual base::PlatformFile GetPlatformFile(int index) { - // MemEntryImpl doesn't support caching to an external file. - return base::kInvalidPlatformFileValue; - } // Performs the initialization of a EntryImpl that will be added to the // cache. diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 1beb36f..48178a6 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -587,15 +587,6 @@ void HttpCache::Transaction::SetRequest(const HttpRequestInfo* request) { if (cache_->mode() == RECORD) effective_load_flags_ |= LOAD_BYPASS_CACHE; - // If HttpCache has type MEDIA make sure LOAD_ENABLE_DOWNLOAD_FILE is set, - // otherwise make sure LOAD_ENABLE_DOWNLOAD_FILE is not set when HttpCache - // has type other than MEDIA. - if (cache_->type() == MEDIA_CACHE) { - DCHECK(effective_load_flags_ & LOAD_ENABLE_DOWNLOAD_FILE); - } else { - DCHECK(!(effective_load_flags_ & LOAD_ENABLE_DOWNLOAD_FILE)); - } - // Some headers imply load flags. The order here is significant. // // LOAD_DISABLE_CACHE : no cache read or write @@ -786,14 +777,6 @@ int HttpCache::Transaction::ReadResponseInfoFromEntry() { if (!HttpCache::ReadResponseInfo(entry_->disk_entry, &response_)) return ERR_CACHE_READ_FAILURE; - - // If the cache object is used for media file, we want the file handle of - // response data. - if (cache_->type() == MEDIA_CACHE) { - response_.response_data_file = - entry_->disk_entry->GetPlatformFile(kResponseContentIndex); - } - return OK; } @@ -854,20 +837,6 @@ void HttpCache::Transaction::TruncateResponseData() { if (!entry_) return; - // If the cache is for media files, we try to prepare the response data - // file as an external file and truncate it afterwards. - // Recipient of ResponseInfo should judge from |response_.response_data_file| - // to tell whether an external file of response data is available for reading - // or not. - // TODO(hclam): we should prepare the target stream as extern file only - // if we get a valid response from server, i.e. 200. We don't want empty - // cache files for redirection or external files for erroneous requests. - response_.response_data_file = base::kInvalidPlatformFileValue; - if (cache_->type() == MEDIA_CACHE) { - response_.response_data_file = - entry_->disk_entry->UseExternalFile(kResponseContentIndex); - } - // Truncate the stream. WriteToEntry(kResponseContentIndex, 0, NULL, 0); } diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index 7f84a36..ef127a2 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -6,7 +6,6 @@ #include "base/hash_tables.h" #include "base/message_loop.h" -#include "base/platform_file.h" #include "base/string_util.h" #include "net/base/net_errors.h" #include "net/base/load_flags.h" @@ -28,11 +27,11 @@ class MockDiskEntry : public disk_cache::Entry, public base::RefCounted<MockDiskEntry> { public: MockDiskEntry() - : test_mode_(0), doomed_(false), platform_file_(global_platform_file_) { + : test_mode_(0), doomed_(false) { } MockDiskEntry(const std::string& key) - : key_(key), doomed_(false), platform_file_(global_platform_file_) { + : key_(key), doomed_(false) { // // 'key' is prefixed with an identifier if it corresponds to a cached POST. // Skip past that to locate the actual URL. @@ -117,18 +116,6 @@ class MockDiskEntry : public disk_cache::Entry, return buf_len; } - base::PlatformFile UseExternalFile(int index) { - return platform_file_; - } - - base::PlatformFile GetPlatformFile(int index) { - return platform_file_; - } - - static void set_global_platform_file(base::PlatformFile platform_file) { - global_platform_file_ = platform_file; - } - private: // Unlike the callbacks for MockHttpTransaction, we want this one to run even // if the consumer called Close on the MockDiskEntry. We achieve that by @@ -145,13 +132,8 @@ class MockDiskEntry : public disk_cache::Entry, std::vector<char> data_[2]; int test_mode_; bool doomed_; - base::PlatformFile platform_file_; - static base::PlatformFile global_platform_file_; }; -base::PlatformFile MockDiskEntry::global_platform_file_ = - base::kInvalidPlatformFileValue; - class MockDiskCache : public disk_cache::Backend { public: MockDiskCache() : open_count_(0), create_count_(0), fail_requests_(0) { @@ -1257,79 +1239,3 @@ TEST(HttpCache, OutlivedTransactions) { delete cache; delete trans; } - -// Make sure Entry::UseExternalFile is called when a new entry is created in -// a HttpCache with MEDIA type. Also make sure Entry::GetPlatformFile is called -// when an entry is loaded from a HttpCache with MEDIA type. Also confirm we -// will receive a file handle in ResponseInfo from a media cache. -TEST(HttpCache, SimpleGET_MediaCache) { - // Initialize the HttpCache with MEDIA_CACHE type. - MockHttpCache cache; - cache.http_cache()->set_type(net::MEDIA_CACHE); - - // Define some fake file handles for testing. - base::PlatformFile kFakePlatformFile1, kFakePlatformFile2; -#if defined(OS_WIN) - kFakePlatformFile1 = reinterpret_cast<base::PlatformFile>(1); - kFakePlatformFile2 = reinterpret_cast<base::PlatformFile>(2); -#else - kFakePlatformFile1 = 1; - kFakePlatformFile2 = 2; -#endif - - ScopedMockTransaction trans_info(kSimpleGET_Transaction); - trans_info.load_flags |= net::LOAD_ENABLE_DOWNLOAD_FILE; - TestCompletionCallback callback; - - { - // Set the fake file handle to MockDiskEntry so cache is written with an - // entry created with our fake file handle. - MockDiskEntry::set_global_platform_file(kFakePlatformFile1); - - scoped_ptr<net::HttpTransaction> trans( - cache.http_cache()->CreateTransaction()); - ASSERT_TRUE(trans.get()); - - MockHttpRequest request(trans_info); - - int rv = trans->Start(&request, &callback); - if (rv == net::ERR_IO_PENDING) - rv = callback.WaitForResult(); - ASSERT_EQ(net::OK, rv); - - const net::HttpResponseInfo* response = trans->GetResponseInfo(); - ASSERT_TRUE(response); - - ASSERT_EQ(kFakePlatformFile1, response->response_data_file); - - ReadAndVerifyTransaction(trans.get(), trans_info); - } - - // Load only from cache so we would get the same file handle. - trans_info.load_flags |= net::LOAD_ONLY_FROM_CACHE; - - { - // Set a different file handle value to MockDiskEntry so any new entry - // created in the cache won't have the same file handle value. - MockDiskEntry::set_global_platform_file(kFakePlatformFile2); - - scoped_ptr<net::HttpTransaction> trans( - cache.http_cache()->CreateTransaction()); - ASSERT_TRUE(trans.get()); - - MockHttpRequest request(trans_info); - - int rv = trans->Start(&request, &callback); - if (rv == net::ERR_IO_PENDING) - rv = callback.WaitForResult(); - ASSERT_EQ(net::OK, rv); - - const net::HttpResponseInfo* response = trans->GetResponseInfo(); - ASSERT_TRUE(response); - - // Make sure we get the same file handle as in the first request. - ASSERT_EQ(kFakePlatformFile1, response->response_data_file); - - ReadAndVerifyTransaction(trans.get(), trans_info); - } -} diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 0dcb91e..c8435d2f 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -2598,8 +2598,6 @@ TEST_F(HttpNetworkTransactionTest, ResetStateForRestart) { EXPECT_EQ(NULL, trans->response_.auth_challenge.get()); EXPECT_EQ(NULL, trans->response_.headers.get()); EXPECT_EQ(false, trans->response_.was_cached); - EXPECT_EQ(base::kInvalidPlatformFileValue, - trans->response_.response_data_file); EXPECT_EQ(0, trans->response_.ssl_info.cert_status); EXPECT_FALSE(trans->response_.vary_data.is_valid()); } diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc index a94aa91..bc2fbe3 100644 --- a/net/http/http_response_info.cc +++ b/net/http/http_response_info.cc @@ -8,7 +8,7 @@ namespace net { HttpResponseInfo::HttpResponseInfo() - : was_cached(false), response_data_file(base::kInvalidPlatformFileValue) { + : was_cached(false) { } HttpResponseInfo::~HttpResponseInfo() { diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h index d2803d1..88f89e7 100644 --- a/net/http/http_response_info.h +++ b/net/http/http_response_info.h @@ -5,7 +5,6 @@ #ifndef NET_HTTP_HTTP_RESPONSE_INFO_H_ #define NET_HTTP_HTTP_RESPONSE_INFO_H_ -#include "base/platform_file.h" #include "base/time.h" #include "net/base/auth.h" #include "net/base/ssl_info.h" @@ -50,10 +49,6 @@ class HttpResponseInfo { // The "Vary" header data for this response. HttpVaryData vary_data; - - // Platform specific file handle to the response data, if response data is - // not in a standalone file, its value is base::kInvalidPlatformFileValue. - base::PlatformFile response_data_file; }; } // namespace net diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index 7798fa7..16a3286 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -333,13 +333,6 @@ class URLRequest { return response_info_.ssl_info; } - // Returns the platform specific file handle for the standalone file that - // contains response data. base::kInvalidPlatformFileValue is returned if - // such file is not available. - base::PlatformFile response_data_file() { - return response_info_.response_data_file; - } - // Returns the cookie values included in the response, if the request is one // that can have cookies. Returns true if the request is a cookie-bearing // type, false otherwise. This method may only be called once the diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc index 7941424..67f4fb2 100644 --- a/net/url_request/url_request_file_job.cc +++ b/net/url_request/url_request_file_job.cc @@ -184,24 +184,6 @@ bool URLRequestFileJob::GetMimeType(std::string* mime_type) const { return net::GetMimeTypeFromFile(file_path_, mime_type); } -void URLRequestFileJob::GetResponseInfo(net::HttpResponseInfo* info) { - DCHECK(request_); - - // If we have enabled downloading the file, the requester expects to receive - // a file handle to the file. Since we are serving file:/// url requests we - // can provide such a handle if the file exists. - bool created; - if ((request_->load_flags() & net::LOAD_ENABLE_DOWNLOAD_FILE) && - stream_.IsOpen()) { - info->response_data_file = - base::CreatePlatformFile(file_path_.ToWStringHack(), - base::PLATFORM_FILE_OPEN | - base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_ASYNC, - &created); - } -} - void URLRequestFileJob::SetExtraRequestHeaders(const std::string& headers) { // We only care about "Range" header here. std::vector<net::HttpByteRange> ranges; diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h index 108a7cf..f7da8c1 100644 --- a/net/url_request/url_request_file_job.h +++ b/net/url_request/url_request_file_job.h @@ -31,7 +31,6 @@ class URLRequestFileJob : public URLRequestJob { virtual bool GetContentEncodings( std::vector<Filter::FilterType>* encoding_type); virtual bool GetMimeType(std::string* mime_type) const; - virtual void GetResponseInfo(net::HttpResponseInfo* info); virtual void SetExtraRequestHeaders(const std::string& headers); static URLRequest::ProtocolFactory Factory; diff --git a/webkit/glue/resource_loader_bridge.cc b/webkit/glue/resource_loader_bridge.cc index 97832f1..d7b535c3 100644 --- a/webkit/glue/resource_loader_bridge.cc +++ b/webkit/glue/resource_loader_bridge.cc @@ -15,12 +15,6 @@ namespace webkit_glue { ResourceLoaderBridge::ResponseInfo::ResponseInfo() { content_length = -1; app_cache_id = WebAppCacheContext::kNoAppCacheId; -#if defined(OS_WIN) - response_data_file = base::kInvalidPlatformFileValue; -#elif defined(OS_POSIX) - response_data_file.fd = base::kInvalidPlatformFileValue; - response_data_file.auto_close = false; -#endif } ResourceLoaderBridge::ResponseInfo::~ResponseInfo() { diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h index 1a3809d..813cd05 100644 --- a/webkit/glue/resource_loader_bridge.h +++ b/webkit/glue/resource_loader_bridge.h @@ -70,20 +70,6 @@ class ResourceLoaderBridge { // The appcache this response was loaded from, or kNoAppCacheId. int64 app_cache_id; - - // A platform specific handle for a file that carries response data. This - // entry is used if the resource request is of type ResourceType::MEDIA and - // the underlying cache layer keeps the response data in a standalone file. -#if defined(OS_POSIX) - // If the response data file is available, the file handle is stored in - // response_data_file.fd, its value is base::kInvalidPlatformFileValue - // otherwise. - base::FileDescriptor response_data_file; -#elif defined(OS_WIN) - // An asynchronous file handle to the response data file, its value is - // base::kInvalidPlatformFileValue if the file is not available. - base::PlatformFile response_data_file; -#endif }; // See the SyncLoad method declared below. (The name of this struct is not @@ -114,13 +100,6 @@ class ResourceLoaderBridge { public: virtual ~Peer() {} - // Called as download progress is made. - // note: only for requests with LOAD_ENABLE_DOWNLOAD_FILE set and the - // resource is downloaded to a standalone file and the file handle to it is - // passed in ResponseInfo during OnReceivedResponse. Note that size may be - // unknown and |size| will be kuint64max in that case. - virtual void OnDownloadProgress(uint64 position, uint64 size) {} - // Called as upload progress is made. // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set virtual void OnUploadProgress(uint64 position, uint64 size) = 0; |