Bug 30965 - Make MediaPlayer constructor private
Summary: Make MediaPlayer constructor private
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-30 14:47 PDT by Eric Carlson
Modified: 2009-10-30 15:04 PDT (History)
1 user (show)

See Also:


Attachments
proposed patch (2.58 KB, patch)
2009-10-30 14:54 PDT, Eric Carlson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2009-10-30 14:47:21 PDT
Every time the media element opens a new movie is creates a new MediaPlayer object, which it stores in an OwnPtr<>. It does this manually, so the code is ugly and confusing:

    m_player.clear();
    m_player.set(new MediaPlayer(this));

MediaPlayer constructor should be made private, and it should have a static create() method that returns a PassOwnPtr<> so that it can be assigned to m_player instead of using OwnPtr<>::set().
Comment 1 Eric Carlson 2009-10-30 14:54:52 PDT
Created attachment 42238 [details]
proposed patch
Comment 2 Eric Carlson 2009-10-30 15:04:33 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/html/HTMLMediaElement.cpp
Sending        WebCore/platform/graphics/MediaPlayer.h
Transmitting file data ...
Committed revision 50357.

trac.webkit.org/changeset/50357