diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 20:38:11 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 20:38:11 +0000 |
commit | d14c7ac0a14a2dc3984022aeadf830a3e30c99f3 (patch) | |
tree | 14b94d459b30e5156fa32daf318a217f79392d32 /net/disk_cache/entry_impl.cc | |
parent | 5d25637a208dbed17b10d31eb91221e6332a5e62 (diff) | |
download | chromium_src-d14c7ac0a14a2dc3984022aeadf830a3e30c99f3.zip chromium_src-d14c7ac0a14a2dc3984022aeadf830a3e30c99f3.tar.gz chromium_src-d14c7ac0a14a2dc3984022aeadf830a3e30c99f3.tar.bz2 |
Remove code path that passes a file handle to the renderer
Since the code now does range request without any caching
the code path for passing file handle is not used any more.
Changes:
1. Remove response_data_file in webkit_glue::ResourceResponseHead
2. Remove response_data_file in net::ResourceInfo
3. Remove code that passes file handle using IPC
4. Remove code that passes file hadnle from network layer to ResourceDispatcherHost
5. Remove MediaResourceHandler
6. Remove code in disk_cache that expose the file handle
7. Remove ChromeURLRequestContext::CreateOffTheRecordForMedia() so no more OTR request context for media, in OTR mode simply memory cache is used
8. Reset cache size for media cache to default
BUG=12249
BUG=12256
Review URL: http://codereview.chromium.org/113931
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.cc')
-rw-r--r-- | net/disk_cache/entry_impl.cc | 51 |
1 files changed, 1 insertions, 50 deletions
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); |