WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
119482
Waste work in MediaController() and ArrayBuffer()
https://bugs.webkit.org/show_bug.cgi?id=119482
Summary
Waste work in MediaController() and ArrayBuffer()
Po-Chun Chang
Reported
2013-08-04 19:14:39 PDT
The problem appears in revision 153701. I have attached simple one-line patches that fixes it. In method ustomFilterValidatedProgram::rewriteMixVertexShader() in WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp, the loop on line 228 should break immediately after "texCoordAttributeDefined" is set to "true". All the iterations after "texCoordAttributeDefined" is set to "true" do not perform any useful work, at best they just set "texCoordAttributeDefined" again to "true". Similarly, method MediaController::hasEnded() in WebCore/html/MediaController.cpp, the loop on line 528 should break immediately after "allHaveEnded" is set to "false". Method ArrayBuffer::transfer() in WTF/wtf/ArrayBuffer.cpp, the loop on line 46 should break immediately after "allViewsAreNeuterable" is set to "false".
Attachments
Suggested patch part 1
(820 bytes, patch)
2013-08-04 19:16 PDT
,
Po-Chun Chang
no flags
Details
Formatted Diff
Diff
Suggested patch part 2
(581 bytes, patch)
2013-08-04 19:17 PDT
,
Po-Chun Chang
no flags
Details
Formatted Diff
Diff
Suggested patch part 3
(552 bytes, patch)
2013-08-04 19:17 PDT
,
Po-Chun Chang
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Po-Chun Chang
Comment 1
2013-08-04 19:16:59 PDT
Created
attachment 208105
[details]
Suggested patch part 1
Po-Chun Chang
Comment 2
2013-08-04 19:17:26 PDT
Created
attachment 208106
[details]
Suggested patch part 2
Po-Chun Chang
Comment 3
2013-08-04 19:17:44 PDT
Created
attachment 208107
[details]
Suggested patch part 3
Dirk Schulze
Comment 4
2014-03-02 10:31:46 PST
Custom shaders don't exist anymore. Is the bug still valid for the other two types? Removing custom shader text from title.
Eric Carlson
Comment 5
2014-03-03 16:53:44 PST
Comment on
attachment 208106
[details]
Suggested patch part 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=208106&action=review
> WebCore/html/MediaController.cpp:534 > bool allHaveEnded = true; > for (size_t index = 0; index < m_mediaElements.size(); ++index) { > - if (!m_mediaElements[index]->ended()) > + if (!m_mediaElements[index]->ended()) { > allHaveEnded = false; > + break; > + } > } > return allHaveEnded;
Actually, we can do away with the variable completely and just "return false" when the loop finds an element that hasn't ended, and "return true" if the loop completes.
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