Bug 56983 - [chromium] Implement preload=none, setPreload hooks to media player
Summary: [chromium] Implement preload=none, setPreload hooks to media player
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Victoria Kirst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-23 18:33 PDT by Victoria Kirst
Modified: 2011-06-20 11:56 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.15 KB, patch)
2011-03-23 18:35 PDT, Victoria Kirst
no flags Details | Formatted Diff | Diff
Patch (9.80 KB, patch)
2011-03-24 16:15 PDT, Victoria Kirst
no flags Details | Formatted Diff | Diff
Patch (9.99 KB, patch)
2011-03-28 15:44 PDT, Victoria Kirst
eric.carlson: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victoria Kirst 2011-03-23 18:33:47 PDT
[chromium] Add setPreload hooks to Chromium media player
Comment 1 Victoria Kirst 2011-03-23 18:35:08 PDT
Created attachment 86730 [details]
Patch
Comment 2 Eric Carlson 2011-03-23 22:20:38 PDT
Comment on attachment 86730 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=86730&action=review

> Source/WebKit/chromium/ChangeLog:9
> +        setAutobuffer methods. This has been replace with

Typos: methods -> method, and replace -> replaced
Comment 3 Victoria Kirst 2011-03-24 16:15:21 PDT
Created attachment 86851 [details]
Patch
Comment 4 Eric Carlson 2011-03-25 09:06:13 PDT
Comment on attachment 86851 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=86851&action=review

r- for now as I am not sure the details are quite right yet.

> Source/WebKit/chromium/public/WebMediaPlayer.h:103
> +    virtual bool setPreload(Preload) { return false; };

Does this function really  need to return a bool?


> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:190
> +    return static_cast<unsigned>(MediaPlayer::MetaData);

Don't you want to return m_preload here instead of hard coding MediaPlayer::MetaData?


> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:216
> +    Frame* frame = static_cast<HTMLMediaElement*>(
> +        m_mediaPlayer->mediaPlayerClient())->document()->frame();

This indentation is odd, I thought at first that a stray tab had snuck in. I am not sure that the line break helps readability.


> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:259
> +    if (m_delayingLoad)
> +        startDelayedLoad();

If you don't set m_delayingLoad to false before calling startDelayedLoad(), won't it ASSERT if this is called when m_preload == MediaPlayer::None?


> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:466
> +    if (m_delayingLoad && m_preload != MediaPlayer::None)
> +        startDelayedLoad();

Ditto.
Comment 5 Victoria Kirst 2011-03-28 15:44:59 PDT
Created attachment 87226 [details]
Patch
Comment 6 Victoria Kirst 2011-03-28 15:48:50 PDT
Comment on attachment 86851 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=86851&action=review

Thanks for looking! I uploaded a new patch with the fixes - let me know whatever questions/concerns you still have!

>> Source/WebKit/chromium/public/WebMediaPlayer.h:103
>> +    virtual bool setPreload(Preload) { return false; };
> 
> Does this function really  need to return a bool?

No it doesn't. Fixed!

>> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:190
>> +    return static_cast<unsigned>(MediaPlayer::MetaData);
> 
> Don't you want to return m_preload here instead of hard coding MediaPlayer::MetaData?

Yes, thanks! :) Fixed!

>> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:216
>> +        m_mediaPlayer->mediaPlayerClient())->document()->frame();
> 
> This indentation is odd, I thought at first that a stray tab had snuck in. I am not sure that the line break helps readability.

OK! Changed to all on one line.

>> Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:259
>> +        startDelayedLoad();
> 
> If you don't set m_delayingLoad to false before calling startDelayedLoad(), won't it ASSERT if this is called when m_preload == MediaPlayer::None?

It shouldn't - the assert is for m_delayingLoad, not !m_delayingLoad (i.e. m_delayingLoad must be true whenever you first call startDelayedLoad).
Comment 7 WebKit Commit Bot 2011-03-29 06:42:53 PDT
Comment on attachment 87226 [details]
Patch

Rejecting attachment 87226 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-3', 'apply-..." exit_code: 2

Last 500 characters of output:
s).
patching file Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
Hunk #1 FAILED at 76.
Hunk #2 succeeded at 88 (offset 1 line).
Hunk #3 succeeded at 108 (offset 1 line).
Hunk #4 succeeded at 131 (offset 1 line).
Hunk #5 succeeded at 144 (offset 1 line).
1 out of 5 hunks FAILED -- saving rejects to file Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--reviewer', u'Eric Carlson', u'--for..." exit_code: 1

Full output: http://queues.webkit.org/results/8273869
Comment 8 Victoria Kirst 2011-03-30 10:52:12 PDT
Since there were merge conflicts, I'll ask scherkus or someone to land by hand!
Comment 9 Eric Seidel (no email) 2011-06-18 13:40:34 PDT
Attachment 87226 [details] was posted by a committer and has review+, assigning to Victoria Kirst for commit.
Comment 10 Andrew Scherkus 2011-06-20 11:55:14 PDT
blah I landed this a while back:
http://trac.webkit.org/changeset/82641

apologies (again!) for not updating this bug
Comment 11 Andrew Scherkus 2011-06-20 11:56:42 PDT
Comment on attachment 87226 [details]
Patch

Obsoleting patch since it was landed a while ago.