WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158332
Modernize loading code
https://bugs.webkit.org/show_bug.cgi?id=158332
Summary
Modernize loading code
Alex Christensen
Reported
2016-06-02 18:54:33 PDT
Use more SharedBuffer instead of a pointer and length
Attachments
Patch
(101.55 KB, patch)
2016-06-02 18:57 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews103 for mac-yosemite
(1.25 MB, application/zip)
2016-06-02 19:44 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews114 for mac-yosemite
(522.47 KB, application/zip)
2016-06-02 19:46 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews104 for mac-yosemite-wk2
(664.00 KB, application/zip)
2016-06-02 19:53 PDT
,
Build Bot
no flags
Details
Patch
(61.77 KB, patch)
2016-06-06 12:17 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(63.38 KB, patch)
2016-06-06 16:32 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(63.95 KB, patch)
2016-06-06 17:14 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(64.61 KB, patch)
2016-06-06 17:21 PDT
,
Alex Christensen
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2016-06-02 18:57:46 PDT
Created
attachment 280400
[details]
Patch
Alex Christensen
Comment 2
2016-06-02 19:00:48 PDT
Comment on
attachment 280400
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280400&action=review
> Source/WebCore/loader/cache/CachedRawResource.cpp:54 > - unsigned incrementalDataLength; > - const char* incrementalData = calculateIncrementalDataChunk(&data, incrementalDataLength); > - setEncodedSize(data.size()); > - notifyClientsDataWasReceived(incrementalData, incrementalDataLength); > + notifyClientsDataWasReceived(data);
I think this may have changed behavior, but I'm not sure.
Build Bot
Comment 3
2016-06-02 19:43:59 PDT
Comment on
attachment 280400
[details]
Patch
Attachment 280400
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/1426096
Number of test failures exceeded the failure limit.
Build Bot
Comment 4
2016-06-02 19:44:02 PDT
Created
attachment 280415
[details]
Archive of layout-test-results from ews103 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 5
2016-06-02 19:46:49 PDT
Comment on
attachment 280400
[details]
Patch
Attachment 280400
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/1426067
Number of test failures exceeded the failure limit.
Build Bot
Comment 6
2016-06-02 19:46:51 PDT
Created
attachment 280416
[details]
Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 7
2016-06-02 19:53:07 PDT
Comment on
attachment 280400
[details]
Patch
Attachment 280400
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/1426133
Number of test failures exceeded the failure limit.
Build Bot
Comment 8
2016-06-02 19:53:09 PDT
Created
attachment 280418
[details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Alex Christensen
Comment 9
2016-06-06 12:17:16 PDT
Created
attachment 280617
[details]
Patch
Alex Christensen
Comment 10
2016-06-06 16:32:19 PDT
Created
attachment 280645
[details]
Patch
Alex Christensen
Comment 11
2016-06-06 17:14:08 PDT
Created
attachment 280651
[details]
Patch
Alex Christensen
Comment 12
2016-06-06 17:21:24 PDT
Created
attachment 280652
[details]
Patch
Darin Adler
Comment 13
2016-06-06 18:43:45 PDT
Comment on
attachment 280652
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280652&action=review
Description says modernize, but I also see a some null checking being added that seems unrelated to the modernizing.
> Source/WebCore/loader/DocumentLoader.cpp:809 > + if (m_substituteData.content() && m_substituteData.content()->size()) > + dataReceived(nullptr, m_substituteData.content()->data(), m_substituteData.content()->size());
Given that we dereference it three times after checking it for null, maybe put the pointer into a local variable?
> Source/WebCore/loader/ResourceLoader.cpp:310 > + m_resourceData->append(buffer);
Should append take a SharedBuffer& instead of a SharedBuffer*?
> Source/WebCore/loader/SubstituteData.h:58 > - const SharedBuffer* content() const { return m_content.get(); } > + SharedBuffer* content() const { return m_content.get(); }
What’s the rationale behind this change?
> Source/WebCore/platform/SharedBuffer.cpp:111 > RefPtr<SharedBuffer> buffer = create();
Should use auto.
> Source/WebCore/platform/SharedBuffer.cpp:291 > + Ref<DataBuffer> newBuffer = adoptRef(*new DataBuffer);
Should use auto.
> Source/WebCore/platform/SharedBuffer.h:61 > + WEBCORE_EXPORT static RefPtr<SharedBuffer> adoptVector(Vector<char>&);
This should return a Ref, not a RefPtr.
Alex Christensen
Comment 14
2016-06-07 11:32:37 PDT
(In reply to
comment #13
)
> > Source/WebCore/loader/SubstituteData.h:58 > > - const SharedBuffer* content() const { return m_content.get(); } > > + SharedBuffer* content() const { return m_content.get(); } > > What’s the rationale behind this change?
This was needed because of the lack of
https://bugs.webkit.org/show_bug.cgi?id=158269
at some point while working on this patch, but I don't think it's needed any more. Removing.
Alex Christensen
Comment 15
2016-06-07 13:06:38 PDT
Committed to
http://trac.webkit.org/changeset/201761
Fixed some builds in
http://trac.webkit.org/changeset/201767
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug