|
|
Created:
6 years, 2 months ago by jkarlin Modified:
6 years, 2 months ago CC:
blink-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, nhiroki, mkwst+moarreviews_chromium.org, falken, dglazkov+blink, kinuko+serviceworker, horo+watch_chromium.org, danakj, Zhenyao Mo Base URL:
https://chromium.googlesource.com/chromium/blink.git@opacity Project:
blink Visibility:
Public. |
DescriptionLet the client (browser) set blobs in WebServiceWorkerResponse.
This lets ServiceWorkerCache return a response to Blink with a blob for the body.
This CL is a dependency of: https://codereview.chromium.org/622833002/
BUG=419417
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183500
Patch Set 1 #Patch Set 2 : Rebase #
Total comments: 2
Patch Set 3 : Use unsigned long long for blob size #Patch Set 4 : Use uint64_t for blob size #
Messages
Total messages: 28 (5 generated)
jkarlin@chromium.org changed reviewers: + horo@chromium.org, jsbell@chromium.org
horo@chromium.org: Please review changes in all jsbell@chromium.org: Please review changes in all Thanks!
jkarlin@chromium.org changed reviewers: + jamesr@chromium.org
jamesr@chromium.org: Please review changes outside of modules/serviceworker/ for OWNERS. Thanks!
lgtm
lgtm
jkarlin@chromium.org changed reviewers: + jochen@chromium.org
+r hochen: ptal at platform/ directories for OWNERS. Thanks!
On 2014/10/06 11:17:10, jkarlin wrote: > +r hochen: ptal at platform/ directories for OWNERS. Thanks! Sorry, fat fingers. jochen@, ptal...
jochen or jamesr, PTAL for owners. Many thanks!
https://codereview.chromium.org/623753002/diff/20001/public/platform/WebServi... File public/platform/WebServiceWorkerResponse.h (right): https://codereview.chromium.org/623753002/diff/20001/public/platform/WebServi... public/platform/WebServiceWorkerResponse.h:69: long long blobSize() const; i don't know much about blobs but if this is supposed to be a number of bytes or number of elements in an array the type must be size_t
https://codereview.chromium.org/623753002/diff/20001/public/platform/WebServi... File public/platform/WebServiceWorkerResponse.h (right): https://codereview.chromium.org/623753002/diff/20001/public/platform/WebServi... public/platform/WebServiceWorkerResponse.h:69: long long blobSize() const; On 2014/10/07 04:33:13, jamesr wrote: > i don't know much about blobs but if this is supposed to be a number of bytes or > number of elements in an array the type must be size_t Number of bytes. Blobs can refer to files and they take long long sizes and offsets. See https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
(1) That type is different from the one you used since it's unsigned (2) The public API must use size_t uniformly. If you find yourself interfacing with some code that doesn't use size_t for a count of bytes, fix that. not lgtm
> (2) The public API must use size_t uniformly. A quick search finds many usages of the long long in the public\web and public\platform api for a byte count. I think other parts of the WebKit api related specifically to blob sizes consistently use 'long long'. From the point of view on maintaining consistency with regard to the blob data type, long long may actually be the best choice.
Our type guidelines are here: http://www.chromium.org/developers/coding-style given the many security holes that can arise from getting the wrong type for byte counts, using the correct type outweighs consistency. Please fix any bad places you can find.
On 2014/10/07 21:08:43, michaeln1 wrote: > > (2) The public API must use size_t uniformly. > > A quick search finds many usages of the long long in the public\web and > public\platform api for a byte count. I think other parts of the WebKit api > related specifically to blob sizes consistently use 'long long'. From the point > of view on maintaining consistency with regard to the blob data type, long long > may actually be the best choice. jkarlin also pointed out to me that it's a file size on disk, which may be > size_t (e.g. 32 bit systems). As michaeln says, we appear to fairly consistent within blink and in the public API about holding the file length in a LL. Numerous points in chromium pipe through a LL e.g. all the way from base::File GetSize() which deals in offsets and lengths exclusively as int64. jkarlin's upstream (chromium-side) patch does persist blob lengths as uint64s though. But... yuck. BlobDataHandle itself takes/stores a LL for size, but has only a ULL accessor for it. But nearly every caller (~26 of them) in Blink populates it with LL, some explicitly negative e.g. File.cpp calls BlobDataHandle::create(..., -1).
On 2014/10/07 21:15:06, jamesr wrote: > Please fix any bad places you can find. Not disagreeing, just lamenting the current state of bogisity before deciding how to proceed. We can probably tackle the BlobDataHandle ctors and work backwards from there to make sure all the callers are sanitizing inputs.
On 2014/10/07 22:15:48, jsbell wrote: > On 2014/10/07 21:15:06, jamesr wrote: > > Please fix any bad places you can find. > > Not disagreeing, just lamenting the current state of bogisity before deciding > how to proceed. > > We can probably tackle the BlobDataHandle ctors and work backwards from there to > make sure all the callers are sanitizing inputs. While michaeln and jsbell refactor blob I've updated this CL to use unsigned long long (not size_t because we need at least 64 bytes on all platforms). jamesr: PTAL.
Patchset #3 (id:40001) has been deleted
On 2014/10/09 13:49:52, jkarlin wrote: > On 2014/10/07 22:15:48, jsbell wrote: > > On 2014/10/07 21:15:06, jamesr wrote: > > > Please fix any bad places you can find. > > > > Not disagreeing, just lamenting the current state of bogisity before deciding > > how to proceed. > > > > We can probably tackle the BlobDataHandle ctors and work backwards from there > to > > make sure all the callers are sanitizing inputs. > > While michaeln and jsbell refactor blob I've updated this CL to use unsigned > long long (not size_t because we need at least 64 bytes on all platforms). > If you need 64 bits use uint64_t. Please read the document I linked earlier about what types to use. > jamesr: PTAL.
> If you need 64 bits use uint64_t. Please read the document I linked earlier > about what types to use. > > jamesr: PTAL. Done. I wasn't sure what the proper Blink type to use was (there is more unsigned long long than uint64_t in Blink) but it looks like Chromium policy applies. Thanks for the correction.
thanks, public/ lgtm
On 2014/10/09 20:44:18, jamesr wrote: > thanks, public/ lgtm Just to be clear, are you okay with landing this before the cleanup https://code.google.com/p/chromium/issues/detail?id=422047 is finished?
The public/ addition here, which is what I looked at, seems to be using the right type.
The CQ bit was checked by jkarlin@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/623753002/110001
On 2014/10/09 22:46:15, I haz the power (commit-bot) wrote: > CQ is trying da patch. Follow status at > https://chromium-cq-status.appspot.com/patch-status/623753002/110001 I think your CL may have introduced browser or tab crashes and that's why the mac_gpu_triggered_tests and mac_gpu_retina_triggered_tests bots are failing your CL. Could you please try to reproduce those failures locally?
Message was sent while issue was closed.
Committed patchset #4 (id:110001) as 183500 |