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

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

Issue 23549009: Add toPluginDocument() convenience method that takes a reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/HTMLPlugInImageElement.cpp ('k') | no next file » | 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) 2006, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isPluginDocument()); 66 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isPluginDocument());
67 return static_cast<PluginDocument*>(document); 67 return static_cast<PluginDocument*>(document);
68 } 68 }
69 69
70 inline const PluginDocument* toPluginDocument(const Document* document) 70 inline const PluginDocument* toPluginDocument(const Document* document)
71 { 71 {
72 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isPluginDocument()); 72 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isPluginDocument());
73 return static_cast<const PluginDocument*>(document); 73 return static_cast<const PluginDocument*>(document);
74 } 74 }
75 75
76 inline PluginDocument& toPluginDocument(Document& document)
77 {
78 ASSERT_WITH_SECURITY_IMPLICATION(document.isPluginDocument());
79 return static_cast<PluginDocument&>(document);
80 }
81
76 // This will catch anyone doing an unnecessary cast. 82 // This will catch anyone doing an unnecessary cast.
77 void toPluginDocument(const PluginDocument*); 83 void toPluginDocument(const PluginDocument*);
78 84
79 } 85 }
80 86
81 #endif // PluginDocument_h 87 #endif // PluginDocument_h
OLDNEW
« no previous file with comments | « Source/core/html/HTMLPlugInImageElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698