WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
128717
Fix TimeRanges layering violations
https://bugs.webkit.org/show_bug.cgi?id=128717
Summary
Fix TimeRanges layering violations
Eric Carlson
Reported
2014-02-12 19:15:16 PST
TimeRanges is defined in WebCore/html, but it is used by many of the media engine related classes in WebCore/platform.
Attachments
Patch for the bots to chew on.
(74.26 KB, patch)
2014-02-19 14:50 PST
,
Eric Carlson
no flags
Details
Formatted Diff
Diff
Updated patch
(75.55 KB, patch)
2014-02-19 17:01 PST
,
Eric Carlson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Eric Carlson
Comment 1
2014-02-19 14:50:42 PST
Created
attachment 224681
[details]
Patch for the bots to chew on.
WebKit Commit Bot
Comment 2
2014-02-19 14:52:29 PST
Attachment 224681
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:773: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:774: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WebCore/platform/graphics/PlatformTimeRanges.cpp:28: You should not add a blank line before implementation file's own header. [build/include_order] [4] ERROR: Source/WebCore/platform/graphics/PlatformTimeRanges.cpp:144: Omit int when using unsigned [runtime/unsigned] [1] ERROR: Source/WebCore/platform/graphics/PlatformTimeRanges.cpp:156: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/graphics/PlatformTimeRanges.cpp:171: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 6 in 41 files If any of these errors are false positives, please file a bug against check-webkit-style.
Eric Carlson
Comment 3
2014-02-19 17:01:49 PST
Created
attachment 224694
[details]
Updated patch
WebKit Commit Bot
Comment 4
2014-02-19 17:04:09 PST
Attachment 224694
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:772: Non-label code inside switch statements should be indented. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:774: More than one command on the same line [whitespace/newline] [4] Total errors found: 2 in 43 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jer Noble
Comment 5
2014-02-21 11:02:23 PST
Comment on
attachment 224694
[details]
Updated patch View in context:
https://bugs.webkit.org/attachment.cgi?id=224694&action=review
r=me, with nits.
> Source/WebCore/Modules/mediasource/MediaSource.cpp:180 > - return intersectionRanges.release(); > + auto result = PlatformTimeRanges::create(); > + unsigned size = intersectionRanges->length(); > + for (unsigned i = 0; i < size; i++) > + result->add(intersectionRanges->start(i, ASSERT_NO_EXCEPTION), intersectionRanges->end(i, ASSERT_NO_EXCEPTION)); > + > + return result;
This is weird. Can't we just do: return PlatformTimeRanges::create(intersectionRanges->ranges()) ?
> Source/WebCore/html/HTMLMediaElement.cpp:3079 > + auto timeRanges = m_player->buffered();
I don't believe we're supposed to use 'auto' in this way; only when the type is implied by the method called.
> Source/WebCore/html/HTMLMediaElement.cpp:3082 > - double start = timeRanges->start(i, IGNORE_EXCEPTION); > - double end = timeRanges->end(i, IGNORE_EXCEPTION); > + double start = timeRanges->start(i, ignored); > + double end = timeRanges->end(i, ignored);
Why are we removing IGNORE_EXCEPTION?
> Source/WebCore/html/TimeRanges.h:67 > + const PlatformTimeRanges* ranges() const { return &m_ranges; }
Lets make this public, and have it return a 'const PlatformTimeRanges&'.
Eric Carlson
Comment 6
2014-02-21 11:20:56 PST
Comment on
attachment 224694
[details]
Updated patch View in context:
https://bugs.webkit.org/attachment.cgi?id=224694&action=review
>> Source/WebCore/Modules/mediasource/MediaSource.cpp:180 >> + return result; > > This is weird. Can't we just do: > > return PlatformTimeRanges::create(intersectionRanges->ranges()) ?
Good idea, I will try that.
>> Source/WebCore/html/HTMLMediaElement.cpp:3079 >> + auto timeRanges = m_player->buffered(); > > I don't believe we're supposed to use 'auto' in this way; only when the type is implied by the method called.
OK
>> Source/WebCore/html/HTMLMediaElement.cpp:3082 >> + double end = timeRanges->end(i, ignored); > > Why are we removing IGNORE_EXCEPTION?
Exception is an HTML concept, so PlatformTimeRanges returns a bool to indicate success/failure.
Eric Carlson
Comment 7
2014-02-21 13:59:36 PST
Committed
r164498
:
https://trac.webkit.org/r164498
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