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

Issue 1642563002: Introduce EventSourceParser (Closed)

Created:
4 years, 10 months ago by yhirano
Modified:
4 years, 10 months ago
CC:
chromium-reviews, blink-reviews, blink-reviews-events_chromium.org, dglazkov+blink, eae+blinkwatch
Base URL:
https://chromium.googlesource.com/chromium/src.git@event-source-retry-fix
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce EventSourceParser This change the parsing functionality from EventSource class. This change improves the performance for long messages. In my environment, it reduces the time taken for receiving a 16m long message from over 30s to under 2s. This CL does not change the behavior, except one point. The spec says the last event ID string should be updated when there is a valid id field in an event even when the event is not dispatched because the data buffer is empty. The previous implementation was wrong on this point and this CL fixes it. BUG=570148 Committed: https://crrev.com/f8259072812989d0042d6c287c03a9a351e2dfff Cr-Commit-Position: refs/heads/master@{#376496}

Patch Set 1 : #

Total comments: 24

Patch Set 2 : #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Total comments: 10

Patch Set 5 : #

Total comments: 8

Patch Set 6 : rebase #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+664 lines, -149 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorInstrumentation.idl View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/EventSource.h View 1 2 3 4 5 3 chunks +8 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/page/EventSource.cpp View 1 2 3 4 5 6 7 11 chunks +28 lines, -124 lines 0 comments Download
A third_party/WebKit/Source/core/page/EventSourceParser.h View 1 2 3 1 chunk +61 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/page/EventSourceParser.cpp View 1 2 3 4 5 1 chunk +135 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/page/EventSourceParserTest.cpp View 1 2 3 4 5 1 chunk +407 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/page/EventSourceTest.cpp View 1 2 3 4 5 3 chunks +18 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (22 generated)
yhirano
4 years, 10 months ago (2016-01-27 11:51:37 UTC) #9
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1642563002/diff/120001/third_party/WebKit/Source/core/page/EventSource.h File third_party/WebKit/Source/core/page/EventSource.h (right): https://codereview.chromium.org/1642563002/diff/120001/third_party/WebKit/Source/core/page/EventSource.h#newcode42 third_party/WebKit/Source/core/page/EventSource.h:42: #include "wtf/RefPtr.h" add wtf/Forward.h for AtomicString https://codereview.chromium.org/1642563002/diff/120001/third_party/WebKit/Source/core/page/EventSourceParser.cpp File third_party/WebKit/Source/core/page/EventSourceParser.cpp ...
4 years, 10 months ago (2016-01-28 07:31:44 UTC) #10
yhirano
https://codereview.chromium.org/1642563002/diff/120001/third_party/WebKit/Source/core/page/EventSource.h File third_party/WebKit/Source/core/page/EventSource.h (right): https://codereview.chromium.org/1642563002/diff/120001/third_party/WebKit/Source/core/page/EventSource.h#newcode42 third_party/WebKit/Source/core/page/EventSource.h:42: #include "wtf/RefPtr.h" On 2016/01/28 07:31:43, tyoshino wrote: > add ...
4 years, 10 months ago (2016-01-28 08:45:37 UTC) #14
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/1642563002/diff/210001/third_party/WebKit/Source/core/page/EventSource.cpp File third_party/WebKit/Source/core/page/EventSource.cpp (right): https://codereview.chromium.org/1642563002/diff/210001/third_party/WebKit/Source/core/page/EventSource.cpp#newcode314 third_party/WebKit/Source/core/page/EventSource.cpp:314: void EventSource::onMessageEvent(const AtomicString& event, const String& data, const ...
4 years, 10 months ago (2016-01-29 07:00:15 UTC) #15
yhirano
https://codereview.chromium.org/1642563002/diff/210001/third_party/WebKit/Source/core/page/EventSource.cpp File third_party/WebKit/Source/core/page/EventSource.cpp (right): https://codereview.chromium.org/1642563002/diff/210001/third_party/WebKit/Source/core/page/EventSource.cpp#newcode314 third_party/WebKit/Source/core/page/EventSource.cpp:314: void EventSource::onMessageEvent(const AtomicString& event, const String& data, const AtomicString& ...
4 years, 10 months ago (2016-01-29 11:41:16 UTC) #16
yhirano
+yurys for OWNER review.
4 years, 10 months ago (2016-01-29 11:41:49 UTC) #18
yhirano
On 2016/01/29 11:41:49, yhirano wrote: > +yurys for OWNER review. ping
4 years, 10 months ago (2016-02-05 01:21:21 UTC) #19
yurys
+dgozman
4 years, 10 months ago (2016-02-05 01:28:51 UTC) #22
dgozman
Sorry, I'm not a owner of core/page. Over to pfeldman.
4 years, 10 months ago (2016-02-05 01:43:06 UTC) #24
yhirano
ping
4 years, 10 months ago (2016-02-09 18:38:46 UTC) #25
pfeldman
https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp File third_party/WebKit/Source/core/page/EventSourceParser.cpp (right): https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp#newcode31 third_party/WebKit/Source/core/page/EventSourceParser.cpp:31: const unsigned char kBOM[] = {0xef, 0xbb, 0xbf}; Do ...
4 years, 10 months ago (2016-02-11 18:54:41 UTC) #26
yhirano
On 2016/02/11 18:54:41, pfeldman wrote: > https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp > File third_party/WebKit/Source/core/page/EventSourceParser.cpp (right): > > https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp#newcode31 > ...
4 years, 10 months ago (2016-02-12 07:24:32 UTC) #28
Tom Sepez
https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSource.cpp File third_party/WebKit/Source/core/page/EventSource.cpp (right): https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSource.cpp#newcode131 third_party/WebKit/Source/core/page/EventSource.cpp:131: request.setHTTPHeaderField(HTTPNames::Last_Event_ID, AtomicString(reinterpret_cast<const LChar*>(lastEventIdUtf8.data()), lastEventIdUtf8.length())); So if this is untrusted, ...
4 years, 10 months ago (2016-02-12 17:14:31 UTC) #29
yhirano
https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSource.cpp File third_party/WebKit/Source/core/page/EventSource.cpp (right): https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSource.cpp#newcode131 third_party/WebKit/Source/core/page/EventSource.cpp:131: request.setHTTPHeaderField(HTTPNames::Last_Event_ID, AtomicString(reinterpret_cast<const LChar*>(lastEventIdUtf8.data()), lastEventIdUtf8.length())); On 2016/02/12 17:14:30, Tom Sepez ...
4 years, 10 months ago (2016-02-12 21:33:27 UTC) #30
Tom Sepez
> It cannot contain CR or LF, but it can contain other control characters. I ...
4 years, 10 months ago (2016-02-16 17:05:10 UTC) #31
yhirano
+kinuko
4 years, 10 months ago (2016-02-17 23:36:23 UTC) #33
kinuko
lgtm https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp File third_party/WebKit/Source/core/page/EventSourceParser.cpp (right): https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp#newcode96 third_party/WebKit/Source/core/page/EventSourceParser.cpp:96: } else if (fieldName == "data") { nit: ...
4 years, 10 months ago (2016-02-18 09:15:00 UTC) #34
yhirano
https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp File third_party/WebKit/Source/core/page/EventSourceParser.cpp (right): https://codereview.chromium.org/1642563002/diff/230001/third_party/WebKit/Source/core/page/EventSourceParser.cpp#newcode96 third_party/WebKit/Source/core/page/EventSourceParser.cpp:96: } else if (fieldName == "data") { On 2016/02/18 ...
4 years, 10 months ago (2016-02-18 23:06:43 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1642563002/290001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1642563002/290001
4 years, 10 months ago (2016-02-19 17:38:32 UTC) #38
commit-bot: I haz the power
Committed patchset #8 (id:290001)
4 years, 10 months ago (2016-02-19 18:40:35 UTC) #40
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/f8259072812989d0042d6c287c03a9a351e2dfff Cr-Commit-Position: refs/heads/master@{#376496}
4 years, 10 months ago (2016-02-19 18:41:48 UTC) #42
krasin1
https://codereview.chromium.org/1642563002/diff/290001/third_party/WebKit/Source/core/page/EventSourceParserTest.cpp File third_party/WebKit/Source/core/page/EventSourceParserTest.cpp (right): https://codereview.chromium.org/1642563002/diff/290001/third_party/WebKit/Source/core/page/EventSourceParserTest.cpp#newcode387 third_party/WebKit/Source/core/page/EventSourceParserTest.cpp:387: TEST(EventSourceParserStoppingTest, StopWhileParsing) Early warning. This test broke CFI buildbot: ...
4 years, 10 months ago (2016-02-19 22:54:37 UTC) #44
yhirano
On 2016/02/19 22:54:37, krasin1 wrote: > https://codereview.chromium.org/1642563002/diff/290001/third_party/WebKit/Source/core/page/EventSourceParserTest.cpp > File third_party/WebKit/Source/core/page/EventSourceParserTest.cpp (right): > > https://codereview.chromium.org/1642563002/diff/290001/third_party/WebKit/Source/core/page/EventSourceParserTest.cpp#newcode387 > ...
4 years, 10 months ago (2016-02-19 23:05:03 UTC) #45
yhirano
On 2016/02/19 23:05:03, yhirano wrote: > On 2016/02/19 22:54:37, krasin1 wrote: > > > https://codereview.chromium.org/1642563002/diff/290001/third_party/WebKit/Source/core/page/EventSourceParserTest.cpp ...
4 years, 10 months ago (2016-02-19 23:25:05 UTC) #46
krasin1
4 years, 10 months ago (2016-02-19 23:28:04 UTC) #47
Message was sent while issue was closed.
> a more comprehensive bug report is to follow.

Bug filed: https://crbug.com/588320
Fix proposed: https://codereview.chromium.org/1717863002/

Powered by Google App Engine
This is Rietveld 408576698