| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |