| OLD | NEW |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() |
| 59 { | 59 { |
| 60 #if ENABLE(OILPAN) |
| 61 // FIXME: Oilpan: it is potentially problematic to support plugin |
| 62 // disposal during an Oilpan GC. If it happens, we need to know |
| 63 // and evaluate possible ways to handle it. |
| 64 ASSERT(!ThreadState::current()->isSweepInProgress()); |
| 65 if (m_pluginContainer) |
| 66 m_pluginContainer->dispose(); |
| 67 #endif |
| 60 } | 68 } |
| 61 | 69 |
| 62 bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl
* frame) | 70 bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl
* frame) |
| 63 { | 71 { |
| 64 ASSERT(!m_objectElement && !m_pluginContainer); | 72 ASSERT(!m_objectElement && !m_pluginContainer); |
| 65 if (!frame->frame()->loader().client()) | 73 if (!frame->frame()->loader().client()) |
| 66 return false; | 74 return false; |
| 67 | 75 |
| 68 m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0,
false); | 76 m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0,
false); |
| 69 Vector<String> attributeNames; | 77 Vector<String> attributeNames; |
| 70 Vector<String> attributeValues; | 78 Vector<String> attributeValues; |
| 71 ASSERT(frame->frame()->document()->url().isValid()); | 79 ASSERT(frame->frame()->document()->url().isValid()); |
| 72 m_pluginContainer = adoptRef(toWebPluginContainerImpl(frame->frame()->loader
().client()->createPlugin( | 80 m_pluginContainer = adoptRefWillBeNoop(toWebPluginContainerImpl(frame->frame
()->loader().client()->createPlugin( |
| 73 m_objectElement.get(), | 81 m_objectElement.get(), |
| 74 frame->frame()->document()->url(), | 82 frame->frame()->document()->url(), |
| 75 attributeNames, | 83 attributeNames, |
| 76 attributeValues, | 84 attributeValues, |
| 77 pluginType, | 85 pluginType, |
| 78 false, | 86 false, |
| 79 FrameLoaderClient::AllowDetachedPlugin).leakRef())); | 87 FrameLoaderClient::AllowDetachedPlugin).leakRef())); |
| 80 | 88 |
| 81 if (!m_pluginContainer) | 89 if (!m_pluginContainer) |
| 82 return false; | 90 return false; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 101 } | 109 } |
| 102 | 110 |
| 103 WebPlugin* WebHelperPluginImpl::getPlugin() | 111 WebPlugin* WebHelperPluginImpl::getPlugin() |
| 104 { | 112 { |
| 105 ASSERT(m_pluginContainer); | 113 ASSERT(m_pluginContainer); |
| 106 ASSERT(m_pluginContainer->plugin()); | 114 ASSERT(m_pluginContainer->plugin()); |
| 107 return m_pluginContainer->plugin(); | 115 return m_pluginContainer->plugin(); |
| 108 } | 116 } |
| 109 | 117 |
| 110 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |