~jconti/ubuntu/oneiric/webkit/fix_doc_path

« back to all changes in this revision

Viewing changes to WebCore/platform/graphics/MediaPlayer.h

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey
  • Date: 2008-09-27 08:57:48 UTC
  • mfrom: (3.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080927085748-yhzld00w0rekp961
Tags: 1.0.1-4
WebCore/dom/Document.*, WebCore/loader/DocLoader.*: Avoid DoS via
crafted CSS import statements. Fixes: CVE-2008-3632. Closes: #499771.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2007 Apple Inc. All rights reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions
 
6
 * are met:
 
7
 * 1. Redistributions of source code must retain the above copyright
 
8
 *    notice, this list of conditions and the following disclaimer.
 
9
 * 2. Redistributions in binary form must reproduce the above copyright
 
10
 *    notice, this list of conditions and the following disclaimer in the
 
11
 *    documentation and/or other materials provided with the distribution.
 
12
 *
 
13
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
24
 */
 
25
 
 
26
#ifndef MediaPlayer_h
 
27
#define MediaPlayer_h
 
28
 
 
29
#if ENABLE(VIDEO)
 
30
 
 
31
#include "IntRect.h"
 
32
#include "StringHash.h"
 
33
#include <wtf/HashSet.h>
 
34
#include <wtf/Noncopyable.h>
 
35
 
 
36
namespace WebCore {
 
37
 
 
38
class FrameView;
 
39
class GraphicsContext;
 
40
class IntSize;
 
41
class MediaPlayer;
 
42
class MediaPlayerPrivate;
 
43
class String;
 
44
 
 
45
class MediaPlayerClient {
 
46
public:
 
47
    virtual ~MediaPlayerClient() { }
 
48
    virtual void mediaPlayerNetworkStateChanged(MediaPlayer*) { }
 
49
    virtual void mediaPlayerReadyStateChanged(MediaPlayer*) { }
 
50
    virtual void mediaPlayerVolumeChanged(MediaPlayer*) { }
 
51
    virtual void mediaPlayerTimeChanged(MediaPlayer*) { }
 
52
    virtual void mediaPlayerRepaint(MediaPlayer*) { }
 
53
};
 
54
 
 
55
class MediaPlayer : Noncopyable {
 
56
public:
 
57
    MediaPlayer(MediaPlayerClient*);
 
58
    virtual ~MediaPlayer();
 
59
    
 
60
    static bool isAvailable();
 
61
    static void getSupportedTypes(HashSet<String>&);
 
62
    
 
63
    IntSize naturalSize();
 
64
    bool hasVideo();
 
65
    
 
66
    void setFrameView(FrameView* frameView) { m_frameView = frameView; }
 
67
    
 
68
    IntRect rect() const { return m_rect; }
 
69
    void setRect(const IntRect& r);
 
70
    
 
71
    void load(const String& url);
 
72
    void cancelLoad();
 
73
    
 
74
    bool visible() const;
 
75
    void setVisible(bool);
 
76
    
 
77
    void play();
 
78
    void pause();    
 
79
    
 
80
    bool paused() const;
 
81
    bool seeking() const;
 
82
    
 
83
    float duration() const;
 
84
    float currentTime() const;
 
85
    void seek(float time);
 
86
    
 
87
    void setEndTime(float time);
 
88
    
 
89
    float rate() const;
 
90
    void setRate(float);
 
91
    
 
92
    float maxTimeBuffered();
 
93
    float maxTimeSeekable();
 
94
    
 
95
    unsigned bytesLoaded();
 
96
    bool totalBytesKnown();
 
97
    unsigned totalBytes();
 
98
    
 
99
    float volume() const;
 
100
    void setVolume(float);
 
101
    
 
102
    int dataRate() const;
 
103
    
 
104
    void paint(GraphicsContext*, const IntRect&);
 
105
    
 
106
    enum NetworkState { Empty, LoadFailed, Loading, LoadedMetaData, LoadedFirstFrame, Loaded };
 
107
    NetworkState networkState();
 
108
 
 
109
    enum ReadyState  { DataUnavailable, CanShowCurrentFrame, CanPlay, CanPlayThrough };
 
110
    ReadyState readyState();
 
111
    
 
112
    void networkStateChanged();
 
113
    void readyStateChanged();
 
114
    void volumeChanged();
 
115
    void timeChanged();
 
116
 
 
117
    void repaint();
 
118
    
 
119
private:
 
120
        
 
121
    friend class MediaPlayerPrivate;
 
122
    
 
123
    MediaPlayerClient* m_mediaPlayerClient;
 
124
    MediaPlayerPrivate* m_private;
 
125
    FrameView* m_frameView;
 
126
    IntRect m_rect;
 
127
    bool m_visible;
 
128
    float m_rate;
 
129
    float m_volume;
 
130
};
 
131
 
 
132
}
 
133
 
 
134
#endif
 
135
#endif