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

Issue 94893003: Support for json media types as (non-image) mime types. (Closed)

Created:
7 years ago by sof
Modified:
7 years ago
CC:
blink-reviews, caseq+blink_chromium.org, loislo+blink_chromium.org, eustas+blink_chromium.org, alph+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, lushnikov+blink_chromium.org, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, dglazkov+blink, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, adamk+blink_chromium.org, devtools-reviews_chromium.org, aandrey+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Support for json media types as (non-image) mime types. Consider mime types with a JSON media type (*) just like "application/json" is; i.e., rendered as text content. Similarly for devtools, have such mime types be equally previewable. Also addressed a smaller bug which made non-XHR loaded resources with text mime types (but no charset supplied in the response) to not be previewable. Added inspector tests to verify that such mime types are indeed previewed using the JSON viewer. * - "application/<something>+json", http://tools.ietf.org/html/rfc6839#section-3.1 R=tyoshino@chromium.org,pfeldman@chromium.org,vsevik@chromium.org BUG=278568 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164220

Patch Set 1 #

Total comments: 4

Patch Set 2 : Sync licence text + add a unit test #

Total comments: 3

Patch Set 3 : Added DOMImplementation::isJSONMIMEType() and use it to resolve default encodings #

Total comments: 14

Patch Set 4 : Style improvements + robustify media type token recognition #

Patch Set 5 : Rework and simplify Inspector network tests #

Patch Set 6 : Improve test descriptions a bit #

Total comments: 4

Patch Set 7 : Test via synthetic NetworkRequest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -41 lines) Patch
M LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type.html View 1 2 3 4 5 1 chunk +60 lines, -15 lines 0 comments Download
M LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type-expected.txt View 1 2 3 4 5 1 chunk +25 lines, -5 lines 0 comments Download
A LayoutTests/http/tests/inspector/network/json-preview.html View 1 2 3 4 5 6 1 chunk +49 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/inspector/network/json-preview-expected.txt View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/inspector/network/resources/json.php View 1 chunk +1 line, -2 lines 0 comments Download
A + LayoutTests/http/tests/security/mime-type-execute-as-html-16.html View 1 chunk +2 lines, -2 lines 0 comments Download
A + LayoutTests/http/tests/security/mime-type-execute-as-html-16-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/DOMImplementation.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/DOMImplementation.cpp View 1 2 3 4 5 6 1 chunk +27 lines, -6 lines 0 comments Download
A Source/core/dom/DOMImplementationTest.cpp View 1 2 3 1 chunk +64 lines, -0 lines 0 comments Download
M Source/core/inspector/NetworkResourcesData.cpp View 1 2 3 4 5 6 2 chunks +15 lines, -8 lines 0 comments Download
M Source/devtools/front_end/RequestPreviewView.js View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 42 (0 generated)
sof
At your leisure, please take a look. (See https://codereview.chromium.org/97913002/ for the Chromium changes needed.)
7 years ago (2013-12-01 21:16:12 UTC) #1
sof
On 2013/12/01 21:16:12, sof wrote: > At your leisure, please take a look. > > ...
7 years ago (2013-12-01 21:18:36 UTC) #2
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/94893003/diff/1/Source/core/dom/DOMImplementationTest.cpp File Source/core/dom/DOMImplementationTest.cpp (right): https://codereview.chromium.org/94893003/diff/1/Source/core/dom/DOMImplementationTest.cpp#newcode13 Source/core/dom/DOMImplementationTest.cpp:13: * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ...
7 years ago (2013-12-02 07:05:13 UTC) #3
sof
https://codereview.chromium.org/94893003/diff/1/Source/core/dom/DOMImplementationTest.cpp File Source/core/dom/DOMImplementationTest.cpp (right): https://codereview.chromium.org/94893003/diff/1/Source/core/dom/DOMImplementationTest.cpp#newcode13 Source/core/dom/DOMImplementationTest.cpp:13: * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ...
7 years ago (2013-12-02 07:45:37 UTC) #4
sof
Chromium changes to net/base/ are ready; does this CL have to be split up to ...
7 years ago (2013-12-05 12:32:31 UTC) #5
pfeldman
https://codereview.chromium.org/94893003/diff/20001/Source/core/dom/DOMImplementation.cpp File Source/core/dom/DOMImplementation.cpp (right): https://codereview.chromium.org/94893003/diff/20001/Source/core/dom/DOMImplementation.cpp#newcode322 Source/core/dom/DOMImplementation.cpp:322: if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) || isJSONType(mimeType) || isTextPlainType(mimeType)) return MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) || ...
7 years ago (2013-12-05 12:54:32 UTC) #6
sof
https://codereview.chromium.org/94893003/diff/20001/Source/core/dom/DOMImplementation.h File Source/core/dom/DOMImplementation.h (right): https://codereview.chromium.org/94893003/diff/20001/Source/core/dom/DOMImplementation.h#newcode70 Source/core/dom/DOMImplementation.h:70: static const char* getTextDefaultEncodingName(const String& MIMEType); On 2013/12/05 12:54:33, ...
7 years ago (2013-12-05 13:42:58 UTC) #7
pfeldman
> ok; just so that i understand your suggestion: you want the symmetric use of ...
7 years ago (2013-12-05 15:31:45 UTC) #8
sof
On 2013/12/05 15:31:45, pfeldman wrote: > > ok; just so that i understand your suggestion: ...
7 years ago (2013-12-05 16:25:02 UTC) #9
pfeldman
lgtm with nits https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html File LayoutTests/http/tests/inspector/network/network-preview-json-type.html (right): https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html#newcode1 LayoutTests/http/tests/inspector/network/network-preview-json-type.html:1: <!doctype html> I don't think you ...
7 years ago (2013-12-05 17:18:52 UTC) #10
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/94893003/diff/40001/Source/core/dom/DOMImplementation.cpp File Source/core/dom/DOMImplementation.cpp (right): https://codereview.chromium.org/94893003/diff/40001/Source/core/dom/DOMImplementation.cpp#newcode297 Source/core/dom/DOMImplementation.cpp:297: bool DOMImplementation::isJSONMIMEType(const String& mimeType) doesn't this return true for ...
7 years ago (2013-12-05 18:57:42 UTC) #11
sof
Great review feedback, thanks - much obliged. Needs clarification on the test issues raised. https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html ...
7 years ago (2013-12-05 19:32:44 UTC) #12
sof
https://codereview.chromium.org/94893003/diff/40001/Source/core/dom/DOMImplementation.cpp File Source/core/dom/DOMImplementation.cpp (right): https://codereview.chromium.org/94893003/diff/40001/Source/core/dom/DOMImplementation.cpp#newcode297 Source/core/dom/DOMImplementation.cpp:297: bool DOMImplementation::isJSONMIMEType(const String& mimeType) On 2013/12/05 18:57:42, tyoshino wrote: ...
7 years ago (2013-12-05 19:34:54 UTC) #13
sof
In case anyone's worried about the failing trybot run on the previous patchset against the ...
7 years ago (2013-12-05 19:38:46 UTC) #14
pfeldman
https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html File LayoutTests/http/tests/inspector/network/network-preview-json-type.html (right): https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html#newcode1 LayoutTests/http/tests/inspector/network/network-preview-json-type.html:1: <!doctype html> I am not sure I follow. It ...
7 years ago (2013-12-06 11:12:28 UTC) #15
sof
https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/security/mime-type-execute-as-html-16.html File LayoutTests/http/tests/security/mime-type-execute-as-html-16.html (right): https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/security/mime-type-execute-as-html-16.html#newcode15 LayoutTests/http/tests/security/mime-type-execute-as-html-16.html:15: <iframe src="resources/send-mime-types.php?mt=application%2Fx-foo%2Bjson"></iframe> On 2013/12/06 11:12:29, pfeldman wrote: > I ...
7 years ago (2013-12-06 11:16:15 UTC) #16
pfeldman
> Isn't that the diff similarity running riot? Oh, alright, now I see "A" against ...
7 years ago (2013-12-06 11:17:53 UTC) #17
sof
https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html File LayoutTests/http/tests/inspector/network/network-preview-json-type.html (right): https://codereview.chromium.org/94893003/diff/40001/LayoutTests/http/tests/inspector/network/network-preview-json-type.html#newcode1 LayoutTests/http/tests/inspector/network/network-preview-json-type.html:1: <!doctype html> On 2013/12/06 11:12:29, pfeldman wrote: > I ...
7 years ago (2013-12-06 11:34:59 UTC) #18
pfeldman
> InspectorPageAgent.cpp:createXHRTextDecoder() vs > NetworkResourcesData.cpp:createOtherResourceTextDecoder() There is no need to build JSON viewers for that, ...
7 years ago (2013-12-06 11:54:45 UTC) #19
sof
On 2013/12/06 11:54:45, pfeldman wrote: > > InspectorPageAgent.cpp:createXHRTextDecoder() vs > > NetworkResourcesData.cpp:createOtherResourceTextDecoder() > > There ...
7 years ago (2013-12-06 12:01:09 UTC) #20
sof
On 2013/12/06 12:01:09, sof wrote: > On 2013/12/06 11:54:45, pfeldman wrote: > > > InspectorPageAgent.cpp:createXHRTextDecoder() ...
7 years ago (2013-12-06 12:05:06 UTC) #21
pfeldman
> Well, we want to verify that RequestPreviewView.js matching applies in both > cases (application/json ...
7 years ago (2013-12-06 12:29:41 UTC) #22
sof
On 2013/12/06 12:29:41, pfeldman wrote: > > Well, we want to verify that RequestPreviewView.js matching ...
7 years ago (2013-12-06 12:33:38 UTC) #23
pfeldman
> If you do have suggestions for how to avoid doing that & reuse some ...
7 years ago (2013-12-06 12:51:40 UTC) #24
sof
On 2013/12/06 12:51:40, pfeldman wrote: > > If you do have suggestions for how to ...
7 years ago (2013-12-06 15:41:44 UTC) #25
sof
Tweaked the test description text to reflect reality better; are we looking ok test-wise and ...
7 years ago (2013-12-09 13:46:46 UTC) #26
sof
Would be good to get this ready & in this week; are we looking ok ...
7 years ago (2013-12-11 10:05:41 UTC) #27
sof
@yurys: do the inspector tests look ok? (pfeldman seems to have his hands full & ...
7 years ago (2013-12-13 08:11:17 UTC) #28
yurys
On 2013/12/13 08:11:17, sof wrote: > @yurys: do the inspector tests look ok? (pfeldman seems ...
7 years ago (2013-12-16 08:05:58 UTC) #29
vsevik
https://codereview.chromium.org/94893003/diff/100001/LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type-expected.txt File LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type-expected.txt (right): https://codereview.chromium.org/94893003/diff/100001/LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type-expected.txt#newcode28 LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type-expected.txt:28: request.content: {"number": "42"} I am getting request.content: null in ...
7 years ago (2013-12-16 10:01:18 UTC) #30
sof
Thanks very much for going through this, much appreciated. I hope we can sort out ...
7 years ago (2013-12-16 10:35:30 UTC) #31
vsevik
On 2013/12/16 10:35:30, sof wrote: > Thanks very much for going through this, much appreciated. ...
7 years ago (2013-12-18 09:13:44 UTC) #32
sof
On 2013/12/18 09:13:44, vsevik wrote: > On 2013/12/16 10:35:30, sof wrote: > > Thanks very ...
7 years ago (2013-12-18 10:32:47 UTC) #33
sof
test now looking ok? :)
7 years ago (2013-12-19 08:31:39 UTC) #34
vsevik
lgtm
7 years ago (2013-12-19 20:54:54 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/94893003/120001
7 years ago (2013-12-19 20:55:08 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/94893003/120001
7 years ago (2013-12-19 20:55:52 UTC) #37
sof
On 2013/12/19 20:54:54, vsevik wrote: > lgtm thanks very much. i'll have to land the ...
7 years ago (2013-12-19 20:57:07 UTC) #38
vsevik
On 2013/12/19 20:55:52, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
7 years ago (2013-12-19 20:57:15 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/94893003/120001
7 years ago (2013-12-20 04:23:00 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/94893003/120001
7 years ago (2013-12-20 07:26:09 UTC) #41
commit-bot: I haz the power
7 years ago (2013-12-20 08:57:31 UTC) #42
Message was sent while issue was closed.
Change committed as 164220

Powered by Google App Engine
This is Rietveld 408576698