Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Issue 431143002: Remove failing DCHECKs in Blob code.

Created:
6 years, 4 months ago by pwnall-personal
Modified:
5 years, 10 months ago
Reviewers:
michaeln, cmumford
CC:
chromium-reviews, darin-cc_chromium.org, jam, kinuko+fileapi, nhiroki, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Remove failing DCHECKs in Blob code. This change removes some DCHECKs that are triggered by empty File and Blob instances getting serialized to IndexedDB. The DCHECKs are hit in the layout tests in the CL below. https://codereview.chromium.org/433983002 BUG=399323

Patch Set 1 #

Total comments: 7

Patch Set 2 : Addressed feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -3 lines) Patch
M content/browser/fileapi/blob_url_request_job_unittest.cc View 1 5 chunks +23 lines, -0 lines 0 comments Download
M webkit/browser/blob/blob_storage_context.cc View 1 chunk +0 lines, -1 line 0 comments Download
M webkit/common/blob/blob_data.cc View 2 chunks +0 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
pwnall-personal
PTAL?
6 years, 4 months ago (2014-07-31 18:21:01 UTC) #1
cmumford
lgtm https://codereview.chromium.org/431143002/diff/1/content/browser/fileapi/blob_url_request_job_unittest.cc File content/browser/fileapi/blob_url_request_job_unittest.cc (right): https://codereview.chromium.org/431143002/diff/1/content/browser/fileapi/blob_url_request_job_unittest.cc#newcode102 content/browser/fileapi/blob_url_request_job_unittest.cc:102: ASSERT_EQ(static_cast<int>(0), Why the static_cast? Isn't 0 an integer ...
6 years, 4 months ago (2014-07-31 18:44:43 UTC) #2
michaeln
Can we identify the source of the empty elements making it this far and eliminate ...
6 years, 4 months ago (2014-07-31 19:31:23 UTC) #3
pwnall-personal
https://codereview.chromium.org/431143002/diff/1/content/browser/fileapi/blob_url_request_job_unittest.cc File content/browser/fileapi/blob_url_request_job_unittest.cc (right): https://codereview.chromium.org/431143002/diff/1/content/browser/fileapi/blob_url_request_job_unittest.cc#newcode102 content/browser/fileapi/blob_url_request_job_unittest.cc:102: ASSERT_EQ(static_cast<int>(0), On 2014/07/31 18:44:43, cmumford wrote: > Why the ...
6 years, 4 months ago (2014-07-31 19:34:47 UTC) #4
pwnall-personal
On 2014/07/31 19:31:23, michaeln wrote: > Can we identify the source of the empty elements ...
6 years, 4 months ago (2014-07-31 19:36:54 UTC) #5
michaeln
> I think this happens with files because blink code avoids having to > (synchronously) ...
6 years, 4 months ago (2014-07-31 19:46:45 UTC) #6
michaeln
On 2014/07/31 19:46:45, michaeln wrote: > > I think this happens with files because blink ...
6 years, 4 months ago (2014-07-31 19:48:10 UTC) #7
michaeln
On 2014/07/31 19:48:10, michaeln wrote: > On 2014/07/31 19:46:45, michaeln wrote: > > > I ...
6 years, 4 months ago (2014-07-31 19:50:21 UTC) #8
jsbell
In content/browser/indexed_db/indexed_db_callbacks.cc, CreateBlobData, we could simply skip the blob_data->AppendFile() call if blob_info.size() is 0. So ...
6 years, 3 months ago (2014-08-26 19:10:05 UTC) #9
michaeln
thnx for digging up where the zero-length inputs are coming from. looks like it might ...
6 years, 3 months ago (2014-08-26 21:06:43 UTC) #10
michaeln
On 2014/08/26 21:06:43, michaeln wrote: > thnx for digging up where the zero-length inputs are ...
6 years, 3 months ago (2014-08-26 21:16:42 UTC) #11
michaeln
> looks like it's using that mechanism to know when the blobs it vends are ...
6 years, 3 months ago (2014-08-26 22:37:58 UTC) #12
michaeln
> thoughts? i thought of something else. blobs can be composed of other blobs (or ...
6 years, 3 months ago (2014-08-26 23:24:30 UTC) #13
jsbell
On 2014/08/26 23:24:30, michaeln wrote: > here's an assertion, idb shouldn't write zero-length files on ...
6 years ago (2014-12-10 01:18:23 UTC) #14
cmumford
On 2014/12/10 01:18:23, jsbell wrote: > On 2014/08/26 23:24:30, michaeln wrote: > > here's an ...
5 years, 10 months ago (2015-02-21 01:57:46 UTC) #15
michaeln
5 years, 10 months ago (2015-02-23 19:29:12 UTC) #16
On 2015/02/21 01:57:46, cmumford wrote:
> On 2014/12/10 01:18:23, jsbell wrote:
> > On 2014/08/26 23:24:30, michaeln wrote:
> > > here's an assertion, idb shouldn't write zero-length files on disk to
start
> > with
> > 
> > I like that idea in theory... although I recently learned that we don't
> persist
> > the lastModified
> > time of File objects in the database; we actually use the timestamp of the
> file
> > on disk. So if we actually had a zero-length File and it wasn't on disk we'd
> > lose that data. Bleah.
> 
> Yes, I agree, but I think that we should write a zero length file to disk -
just
> like any other OS (which we are) when asked to create an empty file.

The question is more a matter of whether to use the OS filesystem to store some
of the meta data for 'files' written into idb values. I'm not sure if this is a
complete listing of the meta data consist we have to handle? I've put notes
about where i think those pieces are currently stored, but i'm not 100% sure
about that.

- filename (currently stored in leveldb)
- filesize (current stored in leveldb and in the OS filesystem)
- contenttype (current stored in leveldb)
- datetimes (current stored in the OS filesystem)

Its makes some sense to store all of the metadata we care to store in leveldb
for consistency, and to only use the filesystem for the bag of unstructured
bits.

Powered by Google App Engine
This is Rietveld 408576698