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

Side by Side Diff: Source/core/plugins/testing/DocumentFragmentPluginPlaceholder.h

Issue 1308633005: Make classes and structures in core/style, core/plugins and core/streams fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DocumentFragmentPluginPlaceholder_h 5 #ifndef DocumentFragmentPluginPlaceholder_h
6 #define DocumentFragmentPluginPlaceholder_h 6 #define DocumentFragmentPluginPlaceholder_h
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/DocumentFragment.h" 9 #include "core/dom/DocumentFragment.h"
10 #include "core/plugins/PluginPlaceholder.h" 10 #include "core/plugins/PluginPlaceholder.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 // Populates plugin placeholder content with a document fragment. 14 // Populates plugin placeholder content with a document fragment.
15 // Used for layout tests that contain a <template>. 15 // Used for layout tests that contain a <template>.
16 class DocumentFragmentPluginPlaceholder : public NoBaseWillBeGarbageCollected<Do cumentFragmentPluginPlaceholder>, public PluginPlaceholder { 16 class DocumentFragmentPluginPlaceholder final : public NoBaseWillBeGarbageCollec ted<DocumentFragmentPluginPlaceholder>, public PluginPlaceholder {
17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DocumentFragmentPluginPlaceholder); 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DocumentFragmentPluginPlaceholder);
18 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DocumentFragmentPluginPlaceholder);
18 public: 19 public:
19 static PassOwnPtrWillBeRawPtr<DocumentFragmentPluginPlaceholder> create(Pass RefPtrWillBeRawPtr<DocumentFragment> fragment) 20 static PassOwnPtrWillBeRawPtr<DocumentFragmentPluginPlaceholder> create(Pass RefPtrWillBeRawPtr<DocumentFragment> fragment)
20 { 21 {
21 return adoptPtrWillBeNoop(new DocumentFragmentPluginPlaceholder(fragment )); 22 return adoptPtrWillBeNoop(new DocumentFragmentPluginPlaceholder(fragment ));
22 } 23 }
23 24
24 #if !ENABLE(OILPAN) 25 #if !ENABLE(OILPAN)
25 ~DocumentFragmentPluginPlaceholder() override { } 26 ~DocumentFragmentPluginPlaceholder() override { }
26 #endif 27 #endif
27 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_fragment); } 28 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_fragment); }
28 29
29 void loadIntoContainer(ContainerNode& container) override 30 void loadIntoContainer(ContainerNode& container) override
30 { 31 {
31 RefPtrWillBeRawPtr<Node> clonedFragment = container.document().importNod e(m_fragment.get(), true /* deep */, ASSERT_NO_EXCEPTION); 32 RefPtrWillBeRawPtr<Node> clonedFragment = container.document().importNod e(m_fragment.get(), true /* deep */, ASSERT_NO_EXCEPTION);
32 container.appendChild(clonedFragment.release(), ASSERT_NO_EXCEPTION); 33 container.appendChild(clonedFragment.release(), ASSERT_NO_EXCEPTION);
33 } 34 }
34 35
35 private: 36 private:
36 DocumentFragmentPluginPlaceholder(PassRefPtrWillBeRawPtr<DocumentFragment> f ragment) : m_fragment(fragment) { } 37 DocumentFragmentPluginPlaceholder(PassRefPtrWillBeRawPtr<DocumentFragment> f ragment) : m_fragment(fragment) { }
37 38
38 RefPtrWillBeMember<DocumentFragment> m_fragment; 39 RefPtrWillBeMember<DocumentFragment> m_fragment;
39 }; 40 };
40 41
41 } // namespace blink 42 } // namespace blink
42 43
43 #endif // DocumentFragmentPluginPlaceholder_h 44 #endif // DocumentFragmentPluginPlaceholder_h
OLDNEW
« no previous file with comments | « Source/core/plugins/testing/DictionaryPluginPlaceholder.h ('k') | Source/core/streams/ReadableStreamImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698