| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 : m_destructionTimer(this, &WebHelperPluginImpl::reallyDestroy) | 53 : m_destructionTimer(this, &WebHelperPluginImpl::reallyDestroy) |
| 54 { | 54 { |
| 55 } | 55 } |
| 56 | 56 |
| 57 WebHelperPluginImpl::~WebHelperPluginImpl() | 57 WebHelperPluginImpl::~WebHelperPluginImpl() |
| 58 { | 58 { |
| 59 #if ENABLE(OILPAN) | 59 #if ENABLE(OILPAN) |
| 60 // FIXME: Oilpan: it is potentially problematic to support plugin | 60 // FIXME: Oilpan: it is potentially problematic to support plugin |
| 61 // disposal during an Oilpan GC. If it happens, we need to know | 61 // disposal during an Oilpan GC. If it happens, we need to know |
| 62 // and evaluate possible ways to handle it. | 62 // and evaluate possible ways to handle it. |
| 63 ASSERT(!ThreadState::current()->sweepForbidden()); | 63 DCHECK(!ThreadState::current()->sweepForbidden()); |
| 64 if (m_pluginContainer) | 64 if (m_pluginContainer) |
| 65 m_pluginContainer->dispose(); | 65 m_pluginContainer->dispose(); |
| 66 #endif | 66 #endif |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl
* frame) | 69 bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl
* frame) |
| 70 { | 70 { |
| 71 ASSERT(!m_objectElement && !m_pluginContainer); | 71 DCHECK(!m_objectElement && !m_pluginContainer); |
| 72 if (!frame->frame()->loader().client()) | 72 if (!frame->frame()->loader().client()) |
| 73 return false; | 73 return false; |
| 74 | 74 |
| 75 m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0,
false); | 75 m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0,
false); |
| 76 Vector<String> attributeNames; | 76 Vector<String> attributeNames; |
| 77 Vector<String> attributeValues; | 77 Vector<String> attributeValues; |
| 78 ASSERT(frame->frame()->document()->url().isValid()); | 78 DCHECK(frame->frame()->document()->url().isValid()); |
| 79 m_pluginContainer = toWebPluginContainerImpl(frame->frame()->loader().client
()->createPlugin( | 79 m_pluginContainer = toWebPluginContainerImpl(frame->frame()->loader().client
()->createPlugin( |
| 80 m_objectElement.get(), | 80 m_objectElement.get(), |
| 81 frame->frame()->document()->url(), | 81 frame->frame()->document()->url(), |
| 82 attributeNames, | 82 attributeNames, |
| 83 attributeValues, | 83 attributeValues, |
| 84 pluginType, | 84 pluginType, |
| 85 false, | 85 false, |
| 86 FrameLoaderClient::AllowDetachedPlugin).leakRef()); | 86 FrameLoaderClient::AllowDetachedPlugin).leakRef()); |
| 87 | 87 |
| 88 if (!m_pluginContainer) | 88 if (!m_pluginContainer) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 102 // Defer deletion so we don't do too much work when called via stopActiveDOM
Objects(). | 102 // Defer deletion so we don't do too much work when called via stopActiveDOM
Objects(). |
| 103 // FIXME: It's not clear why we still need this. The original code held a Pa
ge and a | 103 // FIXME: It's not clear why we still need this. The original code held a Pa
ge and a |
| 104 // WebFrame, and destroying it would cause JavaScript triggered by frame det
ach to run, | 104 // WebFrame, and destroying it would cause JavaScript triggered by frame det
ach to run, |
| 105 // which isn't allowed inside stopActiveDOMObjects(). Removing this causes o
ne Chrome test | 105 // which isn't allowed inside stopActiveDOMObjects(). Removing this causes o
ne Chrome test |
| 106 // to fail with a timeout. | 106 // to fail with a timeout. |
| 107 m_destructionTimer.startOneShot(0, BLINK_FROM_HERE); | 107 m_destructionTimer.startOneShot(0, BLINK_FROM_HERE); |
| 108 } | 108 } |
| 109 | 109 |
| 110 WebPlugin* WebHelperPluginImpl::getPlugin() | 110 WebPlugin* WebHelperPluginImpl::getPlugin() |
| 111 { | 111 { |
| 112 ASSERT(m_pluginContainer); | 112 DCHECK(m_pluginContainer); |
| 113 ASSERT(m_pluginContainer->plugin()); | 113 DCHECK(m_pluginContainer->plugin()); |
| 114 return m_pluginContainer->plugin(); | 114 return m_pluginContainer->plugin(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace blink | 117 } // namespace blink |
| OLD | NEW |