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

Side by Side Diff: third_party/WebKit/Source/core/html/PluginDocument.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
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 27 matching lines...) Expand all
38 #include "core/loader/FrameLoaderClient.h" 38 #include "core/loader/FrameLoaderClient.h"
39 #include "core/plugins/PluginView.h" 39 #include "core/plugins/PluginView.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 using namespace HTMLNames; 43 using namespace HTMLNames;
44 44
45 // FIXME: Share more code with MediaDocumentParser. 45 // FIXME: Share more code with MediaDocumentParser.
46 class PluginDocumentParser : public RawDataDocumentParser { 46 class PluginDocumentParser : public RawDataDocumentParser {
47 public: 47 public:
48 static PassRefPtrWillBeRawPtr<PluginDocumentParser> create(PluginDocument* d ocument) 48 static RawPtr<PluginDocumentParser> create(PluginDocument* document)
49 { 49 {
50 return adoptRefWillBeNoop(new PluginDocumentParser(document)); 50 return (new PluginDocumentParser(document));
51 } 51 }
52 52
53 DEFINE_INLINE_VIRTUAL_TRACE() 53 DEFINE_INLINE_VIRTUAL_TRACE()
54 { 54 {
55 visitor->trace(m_embedElement); 55 visitor->trace(m_embedElement);
56 RawDataDocumentParser::trace(visitor); 56 RawDataDocumentParser::trace(visitor);
57 } 57 }
58 58
59 private: 59 private:
60 PluginDocumentParser(Document* document) 60 PluginDocumentParser(Document* document)
61 : RawDataDocumentParser(document) 61 : RawDataDocumentParser(document)
62 , m_embedElement(nullptr) 62 , m_embedElement(nullptr)
63 { 63 {
64 } 64 }
65 65
66 void appendBytes(const char*, size_t) override; 66 void appendBytes(const char*, size_t) override;
67 67
68 void finish() override; 68 void finish() override;
69 69
70 void createDocumentStructure(); 70 void createDocumentStructure();
71 71
72 PluginView* pluginView() const; 72 PluginView* pluginView() const;
73 73
74 RefPtrWillBeMember<HTMLEmbedElement> m_embedElement; 74 Member<HTMLEmbedElement> m_embedElement;
75 }; 75 };
76 76
77 void PluginDocumentParser::createDocumentStructure() 77 void PluginDocumentParser::createDocumentStructure()
78 { 78 {
79 // FIXME: Assert we have a loader to figure out why the original null checks 79 // FIXME: Assert we have a loader to figure out why the original null checks
80 // and assert were added for the security bug in http://trac.webkit.org/chan geset/87566 80 // and assert were added for the security bug in http://trac.webkit.org/chan geset/87566
81 ASSERT(document()); 81 ASSERT(document());
82 RELEASE_ASSERT(document()->loader()); 82 RELEASE_ASSERT(document()->loader());
83 83
84 LocalFrame* frame = document()->frame(); 84 LocalFrame* frame = document()->frame();
85 if (!frame) 85 if (!frame)
86 return; 86 return;
87 87
88 // FIXME: Why does this check settings? 88 // FIXME: Why does this check settings?
89 if (!frame->settings() || !frame->loader().allowPlugins(NotAboutToInstantiat ePlugin)) 89 if (!frame->settings() || !frame->loader().allowPlugins(NotAboutToInstantiat ePlugin))
90 return; 90 return;
91 91
92 RefPtrWillBeRawPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*d ocument()); 92 RawPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*document());
93 rootElement->insertedByParser(); 93 rootElement->insertedByParser();
94 document()->appendChild(rootElement); 94 document()->appendChild(rootElement);
95 frame->loader().dispatchDocumentElementAvailable(); 95 frame->loader().dispatchDocumentElementAvailable();
96 96
97 RefPtrWillBeRawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document ()); 97 RawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document());
98 body->setAttribute(styleAttr, "background-color: rgb(38,38,38); height: 100% ; width: 100%; overflow: hidden; margin: 0"); 98 body->setAttribute(styleAttr, "background-color: rgb(38,38,38); height: 100% ; width: 100%; overflow: hidden; margin: 0");
99 rootElement->appendChild(body); 99 rootElement->appendChild(body);
100 100
101 m_embedElement = HTMLEmbedElement::create(*document()); 101 m_embedElement = HTMLEmbedElement::create(*document());
102 m_embedElement->setAttribute(widthAttr, "100%"); 102 m_embedElement->setAttribute(widthAttr, "100%");
103 m_embedElement->setAttribute(heightAttr, "100%"); 103 m_embedElement->setAttribute(heightAttr, "100%");
104 m_embedElement->setAttribute(nameAttr, "plugin"); 104 m_embedElement->setAttribute(nameAttr, "plugin");
105 m_embedElement->setAttribute(idAttr, "plugin"); 105 m_embedElement->setAttribute(idAttr, "plugin");
106 m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().string( ))); 106 m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().string( )));
107 m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType()); 107 m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return 0; 147 return 0;
148 } 148 }
149 149
150 PluginDocument::PluginDocument(const DocumentInit& initializer) 150 PluginDocument::PluginDocument(const DocumentInit& initializer)
151 : HTMLDocument(initializer, PluginDocumentClass) 151 : HTMLDocument(initializer, PluginDocumentClass)
152 { 152 {
153 setCompatibilityMode(QuirksMode); 153 setCompatibilityMode(QuirksMode);
154 lockCompatibilityMode(); 154 lockCompatibilityMode();
155 } 155 }
156 156
157 PassRefPtrWillBeRawPtr<DocumentParser> PluginDocument::createParser() 157 RawPtr<DocumentParser> PluginDocument::createParser()
158 { 158 {
159 return PluginDocumentParser::create(this); 159 return PluginDocumentParser::create(this);
160 } 160 }
161 161
162 Widget* PluginDocument::pluginWidget() 162 Widget* PluginDocument::pluginWidget()
163 { 163 {
164 if (m_pluginNode && m_pluginNode->layoutObject()) { 164 if (m_pluginNode && m_pluginNode->layoutObject()) {
165 ASSERT(m_pluginNode->layoutObject()->isEmbeddedObject()); 165 ASSERT(m_pluginNode->layoutObject()->isEmbeddedObject());
166 return toLayoutEmbeddedObject(m_pluginNode->layoutObject())->widget(); 166 return toLayoutEmbeddedObject(m_pluginNode->layoutObject())->widget();
167 } 167 }
(...skipping 12 matching lines...) Expand all
180 HTMLDocument::detach(context); 180 HTMLDocument::detach(context);
181 } 181 }
182 182
183 DEFINE_TRACE(PluginDocument) 183 DEFINE_TRACE(PluginDocument)
184 { 184 {
185 visitor->trace(m_pluginNode); 185 visitor->trace(m_pluginNode);
186 HTMLDocument::trace(visitor); 186 HTMLDocument::trace(visitor);
187 } 187 }
188 188
189 } // namespace blink 189 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698