diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-02 20:43:50 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-02 20:43:50 +0000 |
commit | ac8e3525fa24068878ef8a45f35aba681f852cc9 (patch) | |
tree | e2e829aae01ac23916e4a2f6703ecf92ca348e23 /net | |
parent | aead92ea5e4ce873f4f956e6b42870ae6952759e (diff) | |
download | chromium_src-ac8e3525fa24068878ef8a45f35aba681f852cc9.zip chromium_src-ac8e3525fa24068878ef8a45f35aba681f852cc9.tar.gz chromium_src-ac8e3525fa24068878ef8a45f35aba681f852cc9.tar.bz2 |
Fix an innocuous dcheck when going to view-cache.
Don't initialize an IOBUffer if the needed size is zero.
Review URL: http://codereview.chromium.org/60054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/url_request/url_request_view_cache_job.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/url_request/url_request_view_cache_job.cc b/net/url_request/url_request_view_cache_job.cc index 4c7b622..81431c6 100644 --- a/net/url_request/url_request_view_cache_job.cc +++ b/net/url_request/url_request_view_cache_job.cc @@ -88,9 +88,11 @@ static std::string FormatEntryDetails(disk_cache::Entry* entry) { int data_size = entry->GetDataSize(i); - scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(data_size); - if (entry->ReadData(i, 0, buffer, data_size, NULL) == data_size) - HexDump(buffer->data(), data_size, &result); + if (data_size) { + scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(data_size); + if (entry->ReadData(i, 0, buffer, data_size, NULL) == data_size) + HexDump(buffer->data(), data_size, &result); + } result.append("</pre>"); } |