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

Issue 942633004: IndexedDB: Fixed support for empty blobs. (Closed)

Created:
5 years, 10 months ago by cmumford
Modified:
5 years, 9 months ago
Reviewers:
michaeln, jsbell, mmenke, kinaba
CC:
cbentzel+watch_chromium.org, chromium-reviews, kinuko+fileapi, nhiroki, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

IndexedDB: Fixed support for empty blobs. This solution allows empty blobs (and files) to be created. Most tests for this change are Blink layout tests, so will land in a separate CL. BUG=399323 Committed: https://crrev.com/3a61739491730a1acd96c09a6ae7b79825eb445f Cr-Commit-Position: refs/heads/master@{#320636}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Creating empty cursor to avoid null ptr deref. #

Total comments: 5

Patch Set 3 : Added back in some DCHECKs and simplified empty file write. #

Total comments: 14

Patch Set 4 : LocalFileStreamWriter always creates an output file. #

Patch Set 5 : Deleted CREATE_NEW_FILE. Creating file before using FileStreamWriter. #

Total comments: 8

Patch Set 6 : Backing store now creating empty file + test. #

Total comments: 16

Patch Set 7 : Test cleanup & added blob delete to test. #

Total comments: 6

Patch Set 8 : Handling double read of empty blob, and allowing empty data to be added to the builder. #

Patch Set 9 : Reordered test code and git cl format. #

Total comments: 3

Patch Set 10 : Created local var to improve readability #

Total comments: 14

Patch Set 11 : Removed IndexedDBContext::GetOriginBlobFileCount #

Total comments: 16

Patch Set 12 : Removed dead code in test. #

Patch Set 13 : Removed no longer needed using base::File #

Patch Set 14 : Early return in BlobDataBuilder::AppendData #

Total comments: 9

Patch Set 15 : More test cleanup. #

Total comments: 1

Patch Set 16 : Added back in handle1 (removed from wrong test). #

Patch Set 17 : Re-removed handle1 #

Patch Set 18 : Test using base::MessageLoopForIO #

Patch Set 19 : Worked around Android feature/bug for test #

Patch Set 20 : Added bug for test re: Android #

Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -6 lines) Patch
M content/browser/indexed_db/indexed_db_backing_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +20 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +38 lines, -0 lines 0 comments Download
M content/browser/indexed_db/indexed_db_context_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/indexed_db/indexed_db_context_impl.cc View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/loader/upload_data_stream_builder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +70 lines, -0 lines 0 comments Download
A content/test/data/indexeddb/empty_blob.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +116 lines, -0 lines 0 comments Download
M storage/browser/blob/blob_data_builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M storage/browser/blob/blob_storage_context.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M storage/browser/blob/blob_url_request_job.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 60 (12 generated)
cmumford
I know the discussion regarding saving empty files to disk is still ongoing (crrev.com/431143002). Still ...
5 years, 10 months ago (2015-02-23 23:28:45 UTC) #2
jsbell
https://codereview.chromium.org/942633004/diff/1/net/base/file_stream_context_posix.cc File net/base/file_stream_context_posix.cc (right): https://codereview.chromium.org/942633004/diff/1/net/base/file_stream_context_posix.cc#newcode106 net/base/file_stream_context_posix.cc:106: if (buf_len == 0) Can you explain why we ...
5 years, 10 months ago (2015-02-24 18:37:36 UTC) #3
cmumford
OK, found a (hopefully acceptable) further up the stack to write empty files eliminating the ...
5 years, 10 months ago (2015-02-24 22:40:53 UTC) #4
jsbell
https://codereview.chromium.org/942633004/diff/1/net/base/file_stream_context_posix.cc File net/base/file_stream_context_posix.cc (right): https://codereview.chromium.org/942633004/diff/1/net/base/file_stream_context_posix.cc#newcode106 net/base/file_stream_context_posix.cc:106: if (buf_len == 0) Although you took a different ...
5 years, 10 months ago (2015-02-25 00:10:31 UTC) #5
michaeln
https://codereview.chromium.org/942633004/diff/20001/storage/browser/blob/blob_data_builder.cc File storage/browser/blob/blob_data_builder.cc (left): https://codereview.chromium.org/942633004/diff/20001/storage/browser/blob/blob_data_builder.cc#oldcode18 storage/browser/blob/blob_data_builder.cc:18: DCHECK(length > 0); Are we also hitting this dcheck? ...
5 years, 10 months ago (2015-02-25 00:51:59 UTC) #6
michaeln
fyi: VerifySnapshotTime() makes me wary of not using the actual timestamp on any underlying OS ...
5 years, 10 months ago (2015-02-25 00:55:53 UTC) #7
cmumford
https://codereview.chromium.org/942633004/diff/20001/storage/browser/blob/blob_data_builder.cc File storage/browser/blob/blob_data_builder.cc (left): https://codereview.chromium.org/942633004/diff/20001/storage/browser/blob/blob_data_builder.cc#oldcode18 storage/browser/blob/blob_data_builder.cc:18: DCHECK(length > 0); On 2015/02/25 00:51:59, michaeln wrote: > ...
5 years, 10 months ago (2015-02-25 18:09:49 UTC) #8
jsbell
This is using the tests in https://codereview.chromium.org/433983002/ correct? I don't see a case in there ...
5 years, 10 months ago (2015-02-25 19:53:27 UTC) #9
cmumford
On 2015/02/25 19:53:27, jsbell wrote: > This is using the tests in https://codereview.chromium.org/433983002/ correct? > ...
5 years, 10 months ago (2015-02-25 20:15:59 UTC) #10
michaeln
Ok, I see there's just too much hair on not producing zero len files in ...
5 years, 10 months ago (2015-02-25 20:35:43 UTC) #11
michaeln
https://codereview.chromium.org/942633004/diff/40001/storage/browser/fileapi/file_writer_delegate.cc File storage/browser/fileapi/file_writer_delegate.cc (right): https://codereview.chromium.org/942633004/diff/40001/storage/browser/fileapi/file_writer_delegate.cc#newcode160 storage/browser/fileapi/file_writer_delegate.cc:160: int64 bytes_to_write = bytes_read_ - bytes_written_; On 2015/02/25 20:35:43, ...
5 years, 10 months ago (2015-02-25 21:55:42 UTC) #12
cmumford
https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_data_builder.cc File storage/browser/blob/blob_data_builder.cc (left): https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_data_builder.cc#oldcode28 storage/browser/blob/blob_data_builder.cc:28: DCHECK(length > 0); On 2015/02/25 20:35:43, michaeln wrote: > ...
5 years, 10 months ago (2015-02-25 22:37:30 UTC) #13
cmumford
https://codereview.chromium.org/942633004/diff/40001/storage/browser/fileapi/file_writer_delegate.cc File storage/browser/fileapi/file_writer_delegate.cc (right): https://codereview.chromium.org/942633004/diff/40001/storage/browser/fileapi/file_writer_delegate.cc#newcode146 storage/browser/fileapi/file_writer_delegate.cc:146: // file creation. On 2015/02/25 22:37:29, cmumford wrote: > ...
5 years, 10 months ago (2015-02-25 23:52:50 UTC) #14
michaeln
https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_data_builder.cc File storage/browser/blob/blob_data_builder.cc (left): https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_data_builder.cc#oldcode28 storage/browser/blob/blob_data_builder.cc:28: DCHECK(length > 0); On 2015/02/25 22:37:29, cmumford wrote: > ...
5 years, 10 months ago (2015-02-26 02:05:37 UTC) #15
michaeln
https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_storage_context.cc File storage/browser/blob/blob_storage_context.cc (left): https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_storage_context.cc#oldcode312 storage/browser/blob/blob_storage_context.cc:312: DCHECK_GT(length, 0u); I think BlobURLRequestJob is relying on items ...
5 years, 10 months ago (2015-02-26 02:50:33 UTC) #16
cmumford
On 2015/02/26 02:05:37, michaeln wrote: > https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_data_builder.cc > File storage/browser/blob/blob_data_builder.cc (left): > > https://codereview.chromium.org/942633004/diff/40001/storage/browser/blob/blob_data_builder.cc#oldcode28 > ...
5 years, 9 months ago (2015-02-27 19:37:09 UTC) #17
michaeln
> I thought it was in wider use, but FileStreamWriter::Write() is only called with > ...
5 years, 9 months ago (2015-02-27 20:06:51 UTC) #18
michaeln
a thought about the api? * remove the 'OpenOrCreate'flag altogether, it will only open if ...
5 years, 9 months ago (2015-02-28 01:36:26 UTC) #19
cmumford
michaeln, kinaba for review jsbell: FYI
5 years, 9 months ago (2015-03-02 23:40:14 UTC) #21
michaeln
lgtm https://codereview.chromium.org/942633004/diff/80001/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc File content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc (right): https://codereview.chromium.org/942633004/diff/80001/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc#newcode741 content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc:741: EXPECT_TRUE(file.created()); Ah, so there were some uses of ...
5 years, 9 months ago (2015-03-03 00:02:51 UTC) #22
jsbell
I'm slightly worried about the "open file, close file, re-open file" pattern this now imposes ...
5 years, 9 months ago (2015-03-03 01:01:48 UTC) #23
kinaba
LGTM to me, though I'm not quite confident about the concern in the open-close-open pattern ...
5 years, 9 months ago (2015-03-03 09:51:09 UTC) #24
cmumford
Now back full circle and the backing store is creating the empty file, but only ...
5 years, 9 months ago (2015-03-03 22:26:10 UTC) #25
jsbell
lgtm! https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode429 content/browser/indexed_db/indexed_db_browsertest.cc:429: GetContext()->TaskRunner()->PostTask( Is this actually necessary? Is state persisted ...
5 years, 9 months ago (2015-03-03 22:38:07 UTC) #26
cmumford
https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode429 content/browser/indexed_db/indexed_db_browsertest.cc:429: GetContext()->TaskRunner()->PostTask( On 2015/03/03 22:38:07, jsbell wrote: > Is this ...
5 years, 9 months ago (2015-03-03 23:01:35 UTC) #27
jsbell
https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode429 content/browser/indexed_db/indexed_db_browsertest.cc:429: GetContext()->TaskRunner()->PostTask( On 2015/03/03 23:01:35, cmumford wrote: > On 2015/03/03 ...
5 years, 9 months ago (2015-03-03 23:37:57 UTC) #28
cmumford
-kinaba as his code is no longer modified. Adding the CreateUploadDataStreamWithEmptyBlob test hit the DCHECK ...
5 years, 9 months ago (2015-03-06 18:02:10 UTC) #30
jsbell
lgtm. This time for sure? https://codereview.chromium.org/942633004/diff/160001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/160001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode434 content/browser/indexed_db/indexed_db_browsertest.cc:434: // Test creates two ...
5 years, 9 months ago (2015-03-06 18:28:50 UTC) #31
cmumford
+mmenke for content/browser/loader* https://codereview.chromium.org/942633004/diff/160001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/160001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode434 content/browser/indexed_db/indexed_db_browsertest.cc:434: // Test creates two blob's (but ...
5 years, 9 months ago (2015-03-06 19:11:03 UTC) #33
mmenke
loader/ LGTM (deferring to other reviewers) https://codereview.chromium.org/942633004/diff/180001/content/browser/loader/upload_data_stream_builder_unittest.cc File content/browser/loader/upload_data_stream_builder_unittest.cc (right): https://codereview.chromium.org/942633004/diff/180001/content/browser/loader/upload_data_stream_builder_unittest.cc#newcode341 content/browser/loader/upload_data_stream_builder_unittest.cc:341: base::FilePath(FILE_PATH_LITERAL("BlobFile.txt")), 0, 20, ...
5 years, 9 months ago (2015-03-06 20:54:40 UTC) #34
michaeln
mostly just nits about the tests https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/942633004/diff/100001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode2344 content/browser/indexed_db/indexed_db_backing_store.cc:2344: // If none ...
5 years, 9 months ago (2015-03-06 22:31:38 UTC) #35
cmumford
https://codereview.chromium.org/942633004/diff/180001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/180001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode435 content/browser/indexed_db/indexed_db_browsertest.cc:435: // a single file. Expect two blobs. On 2015/03/06 ...
5 years, 9 months ago (2015-03-09 20:05:48 UTC) #36
michaeln
https://codereview.chromium.org/942633004/diff/200001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/200001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode434 content/browser/indexed_db/indexed_db_browsertest.cc:434: // Test creates two blobs (but stores them to ...
5 years, 9 months ago (2015-03-09 21:15:18 UTC) #37
mmenke
https://codereview.chromium.org/942633004/diff/200001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): https://codereview.chromium.org/942633004/diff/200001/net/base/upload_data_stream.cc#newcode47 net/base/upload_data_stream.cc:47: if (!buf_len || is_eof_) On 2015/03/09 21:15:18, michaeln wrote: ...
5 years, 9 months ago (2015-03-09 21:20:09 UTC) #38
mmenke
https://codereview.chromium.org/942633004/diff/200001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): https://codereview.chromium.org/942633004/diff/200001/net/base/upload_data_stream.cc#newcode47 net/base/upload_data_stream.cc:47: if (!buf_len || is_eof_) On 2015/03/09 21:20:09, mmenke wrote: ...
5 years, 9 months ago (2015-03-09 21:22:41 UTC) #39
cmumford
https://codereview.chromium.org/942633004/diff/200001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/200001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode434 content/browser/indexed_db/indexed_db_browsertest.cc:434: // Test creates two blobs (but stores them to ...
5 years, 9 months ago (2015-03-09 22:05:11 UTC) #40
michaeln
lgtm https://codereview.chromium.org/942633004/diff/260001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/260001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode187 content/browser/indexed_db/indexed_db_browsertest.cc:187: int blob_file_count_ = 0; go c++ 11! maybe ...
5 years, 9 months ago (2015-03-09 22:34:06 UTC) #41
cmumford
https://codereview.chromium.org/942633004/diff/260001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): https://codereview.chromium.org/942633004/diff/260001/content/browser/indexed_db/indexed_db_browsertest.cc#newcode187 content/browser/indexed_db/indexed_db_browsertest.cc:187: int blob_file_count_ = 0; On 2015/03/09 22:34:06, michaeln wrote: ...
5 years, 9 months ago (2015-03-09 23:00:10 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/942633004/280001
5 years, 9 months ago (2015-03-10 20:25:33 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/41720)
5 years, 9 months ago (2015-03-10 22:58:39 UTC) #47
michaeln
https://codereview.chromium.org/942633004/diff/260001/content/browser/loader/upload_data_stream_builder_unittest.cc File content/browser/loader/upload_data_stream_builder_unittest.cc (right): https://codereview.chromium.org/942633004/diff/260001/content/browser/loader/upload_data_stream_builder_unittest.cc#newcode335 content/browser/loader/upload_data_stream_builder_unittest.cc:335: scoped_ptr<BlobDataHandle> handle1 = On 2015/03/09 23:00:10, cmumford wrote: > ...
5 years, 9 months ago (2015-03-11 00:10:25 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/942633004/320001
5 years, 9 months ago (2015-03-11 20:48:15 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/1036)
5 years, 9 months ago (2015-03-12 02:50:11 UTC) #53
cmumford
Josh: I couldn't figure out why Android (and only Android) is failing to set the ...
5 years, 9 months ago (2015-03-13 23:21:56 UTC) #54
jsbell
On 2015/03/13 23:21:56, cmumford wrote: > Josh: I couldn't figure out why Android (and only ...
5 years, 9 months ago (2015-03-14 00:02:15 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/942633004/380001
5 years, 9 months ago (2015-03-14 00:49:26 UTC) #58
commit-bot: I haz the power
Committed patchset #20 (id:380001)
5 years, 9 months ago (2015-03-14 02:39:37 UTC) #59
commit-bot: I haz the power
5 years, 9 months ago (2015-03-14 02:40:10 UTC) #60
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/3a61739491730a1acd96c09a6ae7b79825eb445f
Cr-Commit-Position: refs/heads/master@{#320636}

Powered by Google App Engine
This is Rietveld 408576698