OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008,2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008,2009 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 25 matching lines...) Expand all Loading... |
36 { | 36 { |
37 return adoptRef(new MediaDocument(frame, url)); | 37 return adoptRef(new MediaDocument(frame, url)); |
38 } | 38 } |
39 virtual ~MediaDocument(); | 39 virtual ~MediaDocument(); |
40 | 40 |
41 void mediaElementSawUnsupportedTracks(); | 41 void mediaElementSawUnsupportedTracks(); |
42 | 42 |
43 private: | 43 private: |
44 MediaDocument(Frame*, const KURL&); | 44 MediaDocument(Frame*, const KURL&); |
45 | 45 |
46 virtual bool isMediaDocument() const { return true; } | |
47 virtual PassRefPtr<DocumentParser> createParser(); | 46 virtual PassRefPtr<DocumentParser> createParser(); |
48 | 47 |
49 virtual void defaultEventHandler(Event*); | 48 virtual void defaultEventHandler(Event*); |
50 | 49 |
51 void replaceMediaElementTimerFired(Timer<MediaDocument>*); | 50 void replaceMediaElementTimerFired(Timer<MediaDocument>*); |
52 | 51 |
53 Timer<MediaDocument> m_replaceMediaElementTimer; | 52 Timer<MediaDocument> m_replaceMediaElementTimer; |
54 }; | 53 }; |
55 | 54 |
56 inline MediaDocument* toMediaDocument(Document* document) | 55 inline MediaDocument* toMediaDocument(Document* document) |
57 { | 56 { |
58 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isMediaDocument()); | 57 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isMediaDocument()); |
59 return static_cast<MediaDocument*>(document); | 58 return static_cast<MediaDocument*>(document); |
60 } | 59 } |
61 | 60 |
62 inline const MediaDocument* toMediaDocument(const Document* document) | 61 inline const MediaDocument* toMediaDocument(const Document* document) |
63 { | 62 { |
64 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isMediaDocument()); | 63 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isMediaDocument()); |
65 return static_cast<const MediaDocument*>(document); | 64 return static_cast<const MediaDocument*>(document); |
66 } | 65 } |
67 | 66 |
68 // This will catch anyone doing an unnecessary cast. | 67 // This will catch anyone doing an unnecessary cast. |
69 void toMediaDocument(const MediaDocument*); | 68 void toMediaDocument(const MediaDocument*); |
70 | 69 |
71 } | 70 } |
72 | 71 |
73 #endif | 72 #endif |
OLD | NEW |