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

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

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Support renderer-less plugin disposal 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) 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 } 626 }
627 627
628 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp e) const 628 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp e) const
629 { 629 {
630 if (!m_webFrame->client()) 630 if (!m_webFrame->client())
631 return false; 631 return false;
632 632
633 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); 633 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType);
634 } 634 }
635 635
636 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( 636 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createPlugin(
637 HTMLPlugInElement* element, 637 HTMLPlugInElement* element,
638 const KURL& url, 638 const KURL& url,
639 const Vector<String>& paramNames, 639 const Vector<String>& paramNames,
640 const Vector<String>& paramValues, 640 const Vector<String>& paramValues,
641 const String& mimeType, 641 const String& mimeType,
642 bool loadManually, 642 bool loadManually,
643 DetachedPluginPolicy policy) 643 DetachedPluginPolicy policy)
644 { 644 {
645 if (!m_webFrame->client()) 645 if (!m_webFrame->client())
646 return nullptr; 646 return nullptr;
647 647
648 WebPluginParams params; 648 WebPluginParams params;
649 params.url = url; 649 params.url = url;
650 params.mimeType = mimeType; 650 params.mimeType = mimeType;
651 params.attributeNames = paramNames; 651 params.attributeNames = paramNames;
652 params.attributeValues = paramValues; 652 params.attributeValues = paramValues;
653 params.loadManually = loadManually; 653 params.loadManually = loadManually;
654 654
655 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params ); 655 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params );
656 if (!webPlugin) 656 if (!webPlugin)
657 return nullptr; 657 return nullptr;
658 658
659 // The container takes ownership of the WebPlugin. 659 // The container takes ownership of the WebPlugin.
660 RefPtr<WebPluginContainerImpl> container = 660 RefPtrWillBeRawPtr<WebPluginContainerImpl> container =
661 WebPluginContainerImpl::create(element, webPlugin); 661 WebPluginContainerImpl::create(element, webPlugin);
662 662
663 if (!webPlugin->initialize(container.get())) 663 if (!webPlugin->initialize(container.get())) {
664 #if ENABLE(OILPAN)
665 container->dispose();
666 #endif
664 return nullptr; 667 return nullptr;
668 }
665 669
666 if (policy != AllowDetachedPlugin && !element->renderer()) 670 if (policy != AllowDetachedPlugin && !element->renderer()) {
671 #if ENABLE(OILPAN)
672 container->dispose();
673 #endif
667 return nullptr; 674 return nullptr;
675 }
668 676
669 return container; 677 return container;
670 } 678 }
671 679
672 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( 680 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
673 HTMLAppletElement* element, 681 HTMLAppletElement* element,
674 const KURL& /* baseURL */, 682 const KURL& /* baseURL */,
675 const Vector<String>& paramNames, 683 const Vector<String>& paramNames,
676 const Vector<String>& paramValues) 684 const Vector<String>& paramValues)
677 { 685 {
678 return createPlugin(element, KURL(), paramNames, paramValues, 686 return createPlugin(element, KURL(), paramNames, paramValues,
679 "application/x-java-applet", false, FailOnDetachedPlugin); 687 "application/x-java-applet", false, FailOnDetachedPlugin);
680 } 688 }
681 689
682 ObjectContentType FrameLoaderClientImpl::objectContentType( 690 ObjectContentType FrameLoaderClientImpl::objectContentType(
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 m_webFrame->client()->didAbortLoading(m_webFrame); 832 m_webFrame->client()->didAbortLoading(m_webFrame);
825 } 833 }
826 834
827 void FrameLoaderClientImpl::dispatchDidChangeManifest() 835 void FrameLoaderClientImpl::dispatchDidChangeManifest()
828 { 836 {
829 if (m_webFrame->client()) 837 if (m_webFrame->client())
830 m_webFrame->client()->didChangeManifest(m_webFrame); 838 m_webFrame->client()->didChangeManifest(m_webFrame);
831 } 839 }
832 840
833 } // namespace blink 841 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698