Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: Source/core/html/MediaDocument.h

Issue 14839007: Devirtualize Document class type checking (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Try again Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/ImageDocument.cpp ('k') | Source/core/html/MediaDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/html/ImageDocument.cpp ('k') | Source/core/html/MediaDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698