OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class PluginDocumentParser : public RawDataDocumentParser { | 47 class PluginDocumentParser : public RawDataDocumentParser { |
48 public: | 48 public: |
49 static PassRefPtr<PluginDocumentParser> create(PluginDocument* document) | 49 static PassRefPtr<PluginDocumentParser> create(PluginDocument* document) |
50 { | 50 { |
51 return adoptRef(new PluginDocumentParser(document)); | 51 return adoptRef(new PluginDocumentParser(document)); |
52 } | 52 } |
53 | 53 |
54 private: | 54 private: |
55 PluginDocumentParser(Document* document) | 55 PluginDocumentParser(Document* document) |
56 : RawDataDocumentParser(document) | 56 : RawDataDocumentParser(document) |
57 , m_embedElement(0) | 57 , m_embedElement(nullptr) |
58 { | 58 { |
59 } | 59 } |
60 | 60 |
61 virtual void appendBytes(const char*, size_t) OVERRIDE; | 61 virtual void appendBytes(const char*, size_t) OVERRIDE; |
62 | 62 |
63 virtual void finish() OVERRIDE; | 63 virtual void finish() OVERRIDE; |
64 | 64 |
65 void createDocumentStructure(); | 65 void createDocumentStructure(); |
66 | 66 |
67 PluginView* pluginView() const; | 67 PluginView* pluginView() const; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } | 127 } |
128 | 128 |
129 void PluginDocumentParser::finish() | 129 void PluginDocumentParser::finish() |
130 { | 130 { |
131 if (PluginView* view = pluginView()) { | 131 if (PluginView* view = pluginView()) { |
132 const ResourceError& error = document()->loader()->mainDocumentError(); | 132 const ResourceError& error = document()->loader()->mainDocumentError(); |
133 if (error.isNull()) | 133 if (error.isNull()) |
134 view->didFinishLoading(); | 134 view->didFinishLoading(); |
135 else | 135 else |
136 view->didFailLoading(error); | 136 view->didFailLoading(error); |
137 m_embedElement = 0; | 137 m_embedElement = nullptr; |
138 } | 138 } |
139 RawDataDocumentParser::finish(); | 139 RawDataDocumentParser::finish(); |
140 } | 140 } |
141 | 141 |
142 PluginView* PluginDocumentParser::pluginView() const | 142 PluginView* PluginDocumentParser::pluginView() const |
143 { | 143 { |
144 if (Widget* widget = toPluginDocument(document())->pluginWidget()) { | 144 if (Widget* widget = toPluginDocument(document())->pluginWidget()) { |
145 ASSERT_WITH_SECURITY_IMPLICATION(widget->isPluginContainer()); | 145 ASSERT_WITH_SECURITY_IMPLICATION(widget->isPluginContainer()); |
146 return toPluginView(widget); | 146 return toPluginView(widget); |
147 } | 147 } |
(...skipping 23 matching lines...) Expand all Loading... |
171 } | 171 } |
172 | 172 |
173 Node* PluginDocument::pluginNode() | 173 Node* PluginDocument::pluginNode() |
174 { | 174 { |
175 return m_pluginNode.get(); | 175 return m_pluginNode.get(); |
176 } | 176 } |
177 | 177 |
178 void PluginDocument::detach(const AttachContext& context) | 178 void PluginDocument::detach(const AttachContext& context) |
179 { | 179 { |
180 // Release the plugin node so that we don't have a circular reference. | 180 // Release the plugin node so that we don't have a circular reference. |
181 m_pluginNode = 0; | 181 m_pluginNode = nullptr; |
182 HTMLDocument::detach(context); | 182 HTMLDocument::detach(context); |
183 } | 183 } |
184 | 184 |
185 void PluginDocument::cancelManualPluginLoad() | 185 void PluginDocument::cancelManualPluginLoad() |
186 { | 186 { |
187 // PluginDocument::cancelManualPluginLoad should only be called once, but th
ere are issues | 187 // PluginDocument::cancelManualPluginLoad should only be called once, but th
ere are issues |
188 // with how many times we call beforeload on object elements. <rdar://proble
m/8441094>. | 188 // with how many times we call beforeload on object elements. <rdar://proble
m/8441094>. |
189 if (!shouldLoadPluginManually()) | 189 if (!shouldLoadPluginManually()) |
190 return; | 190 return; |
191 | 191 |
192 DocumentLoader* documentLoader = frame()->loader().documentLoader(); | 192 DocumentLoader* documentLoader = frame()->loader().documentLoader(); |
193 documentLoader->cancelMainResourceLoad(ResourceError::cancelledError(documen
tLoader->request().url())); | 193 documentLoader->cancelMainResourceLoad(ResourceError::cancelledError(documen
tLoader->request().url())); |
194 setShouldLoadPluginManually(false); | 194 setShouldLoadPluginManually(false); |
195 } | 195 } |
196 | 196 |
197 } | 197 } |
OLD | NEW |