OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 } | 629 } |
630 | 630 |
631 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
e) const | 631 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
e) const |
632 { | 632 { |
633 if (!m_webFrame->client()) | 633 if (!m_webFrame->client()) |
634 return false; | 634 return false; |
635 | 635 |
636 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); | 636 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); |
637 } | 637 } |
638 | 638 |
639 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( | 639 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createPlugin( |
640 HTMLPlugInElement* element, | 640 HTMLPlugInElement* element, |
641 const KURL& url, | 641 const KURL& url, |
642 const Vector<String>& paramNames, | 642 const Vector<String>& paramNames, |
643 const Vector<String>& paramValues, | 643 const Vector<String>& paramValues, |
644 const String& mimeType, | 644 const String& mimeType, |
645 bool loadManually, | 645 bool loadManually, |
646 DetachedPluginPolicy policy) | 646 DetachedPluginPolicy policy) |
647 { | 647 { |
648 if (!m_webFrame->client()) | 648 if (!m_webFrame->client()) |
649 return nullptr; | 649 return nullptr; |
650 | 650 |
651 WebPluginParams params; | 651 WebPluginParams params; |
652 params.url = url; | 652 params.url = url; |
653 params.mimeType = mimeType; | 653 params.mimeType = mimeType; |
654 params.attributeNames = paramNames; | 654 params.attributeNames = paramNames; |
655 params.attributeValues = paramValues; | 655 params.attributeValues = paramValues; |
656 params.loadManually = loadManually; | 656 params.loadManually = loadManually; |
657 | 657 |
658 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); | 658 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); |
659 if (!webPlugin) | 659 if (!webPlugin) |
660 return nullptr; | 660 return nullptr; |
661 | 661 |
662 // The container takes ownership of the WebPlugin. | 662 // The container takes ownership of the WebPlugin. |
663 RefPtr<WebPluginContainerImpl> container = | 663 RefPtrWillBeRawPtr<WebPluginContainerImpl> container = |
664 WebPluginContainerImpl::create(element, webPlugin); | 664 WebPluginContainerImpl::create(element, webPlugin); |
665 | 665 |
666 if (!webPlugin->initialize(container.get())) | 666 if (!webPlugin->initialize(container.get())) { |
| 667 #if ENABLE(OILPAN) |
| 668 container->dispose(); |
| 669 #endif |
667 return nullptr; | 670 return nullptr; |
| 671 } |
668 | 672 |
669 if (policy != AllowDetachedPlugin && !element->renderer()) | 673 if (policy != AllowDetachedPlugin && !element->renderer()) { |
| 674 #if ENABLE(OILPAN) |
| 675 container->dispose(); |
| 676 #endif |
670 return nullptr; | 677 return nullptr; |
| 678 } |
671 | 679 |
672 return container; | 680 return container; |
673 } | 681 } |
674 | 682 |
675 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( | 683 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( |
676 HTMLAppletElement* element, | 684 HTMLAppletElement* element, |
677 const KURL& /* baseURL */, | 685 const KURL& /* baseURL */, |
678 const Vector<String>& paramNames, | 686 const Vector<String>& paramNames, |
679 const Vector<String>& paramValues) | 687 const Vector<String>& paramValues) |
680 { | 688 { |
681 return createPlugin(element, KURL(), paramNames, paramValues, | 689 return createPlugin(element, KURL(), paramNames, paramValues, |
682 "application/x-java-applet", false, FailOnDetachedPlugin); | 690 "application/x-java-applet", false, FailOnDetachedPlugin); |
683 } | 691 } |
684 | 692 |
685 ObjectContentType FrameLoaderClientImpl::objectContentType( | 693 ObjectContentType FrameLoaderClientImpl::objectContentType( |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 m_webFrame->client()->didAbortLoading(m_webFrame); | 835 m_webFrame->client()->didAbortLoading(m_webFrame); |
828 } | 836 } |
829 | 837 |
830 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 838 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
831 { | 839 { |
832 if (m_webFrame->client()) | 840 if (m_webFrame->client()) |
833 m_webFrame->client()->didChangeManifest(m_webFrame); | 841 m_webFrame->client()->didChangeManifest(m_webFrame); |
834 } | 842 } |
835 | 843 |
836 } // namespace blink | 844 } // namespace blink |
OLD | NEW |