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

Side by Side Diff: Source/web/WebHelperPluginImpl.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased upto r183571 Created 6 years, 2 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 if (!toWebHelperPluginImpl(plugin.get())->initialize(pluginType, toWebLocalF rameImpl(frame))) 48 if (!toWebHelperPluginImpl(plugin.get())->initialize(pluginType, toWebLocalF rameImpl(frame)))
49 return 0; 49 return 0;
50 return plugin.leakPtr(); 50 return plugin.leakPtr();
51 } 51 }
52 52
53 WebHelperPluginImpl::WebHelperPluginImpl() 53 WebHelperPluginImpl::WebHelperPluginImpl()
54 : m_destructionTimer(this, &WebHelperPluginImpl::reallyDestroy) 54 : m_destructionTimer(this, &WebHelperPluginImpl::reallyDestroy)
55 { 55 {
56 } 56 }
57 57
58 WebHelperPluginImpl::~WebHelperPluginImpl() 58 WebHelperPluginImpl::~WebHelperPluginImpl()
haraken 2014/10/11 17:33:03 Just to confirm: Isn't it possible that ~WebHelper
sof 2014/10/12 08:16:22 WebHelperPlugin is a wrapping layer that the embed
haraken 2014/10/12 12:56:04 Thanks, understood. Can we add an ASSERT to verif
sof 2014/10/12 18:35:36 I'm not super comfortable with having such an asse
59 { 59 {
60 #if ENABLE(OILPAN)
61 if (m_pluginContainer)
62 m_pluginContainer->dispose();
63 #endif
60 } 64 }
61 65
62 bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl * frame) 66 bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl * frame)
63 { 67 {
64 ASSERT(!m_objectElement && !m_pluginContainer); 68 ASSERT(!m_objectElement && !m_pluginContainer);
65 if (!frame->frame()->loader().client()) 69 if (!frame->frame()->loader().client())
66 return false; 70 return false;
67 71
68 m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0, false); 72 m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0, false);
69 Vector<String> attributeNames; 73 Vector<String> attributeNames;
70 Vector<String> attributeValues; 74 Vector<String> attributeValues;
71 ASSERT(frame->frame()->document()->url().isValid()); 75 ASSERT(frame->frame()->document()->url().isValid());
72 m_pluginContainer = adoptRef(toWebPluginContainerImpl(frame->frame()->loader ().client()->createPlugin( 76 m_pluginContainer = adoptRefWillBeNoop(toWebPluginContainerImpl(frame->frame ()->loader().client()->createPlugin(
73 m_objectElement.get(), 77 m_objectElement.get(),
74 frame->frame()->document()->url(), 78 frame->frame()->document()->url(),
75 attributeNames, 79 attributeNames,
76 attributeValues, 80 attributeValues,
77 pluginType, 81 pluginType,
78 false, 82 false,
79 FrameLoaderClient::AllowDetachedPlugin).leakRef())); 83 FrameLoaderClient::AllowDetachedPlugin).leakRef()));
80 84
81 if (!m_pluginContainer) 85 if (!m_pluginContainer)
82 return false; 86 return false;
(...skipping 18 matching lines...) Expand all
101 } 105 }
102 106
103 WebPlugin* WebHelperPluginImpl::getPlugin() 107 WebPlugin* WebHelperPluginImpl::getPlugin()
104 { 108 {
105 ASSERT(m_pluginContainer); 109 ASSERT(m_pluginContainer);
106 ASSERT(m_pluginContainer->plugin()); 110 ASSERT(m_pluginContainer->plugin());
107 return m_pluginContainer->plugin(); 111 return m_pluginContainer->plugin();
108 } 112 }
109 113
110 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698