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

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: Switch LocalFrame::m_pluginElements rep to HashSet<HTMLPlugInElement*> 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 params.loadManually = loadManually; 654 params.loadManually = loadManually;
655 655
656 OwnPtr<WebPluginPlaceholder> webPluginPlaceholder = adoptPtr( 656 OwnPtr<WebPluginPlaceholder> webPluginPlaceholder = adoptPtr(
657 m_webFrame->client()->createPluginPlaceholder(m_webFrame, params)); 657 m_webFrame->client()->createPluginPlaceholder(m_webFrame, params));
658 if (!webPluginPlaceholder) 658 if (!webPluginPlaceholder)
659 return nullptr; 659 return nullptr;
660 660
661 return PluginPlaceholderImpl::create(webPluginPlaceholder.release(), documen t); 661 return PluginPlaceholderImpl::create(webPluginPlaceholder.release(), documen t);
662 } 662 }
663 663
664 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( 664 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createPlugin(
665 HTMLPlugInElement* element, 665 HTMLPlugInElement* element,
666 const KURL& url, 666 const KURL& url,
667 const Vector<String>& paramNames, 667 const Vector<String>& paramNames,
668 const Vector<String>& paramValues, 668 const Vector<String>& paramValues,
669 const String& mimeType, 669 const String& mimeType,
670 bool loadManually, 670 bool loadManually,
671 DetachedPluginPolicy policy) 671 DetachedPluginPolicy policy)
672 { 672 {
673 if (!m_webFrame->client()) 673 if (!m_webFrame->client())
674 return nullptr; 674 return nullptr;
675 675
676 WebPluginParams params; 676 WebPluginParams params;
677 params.url = url; 677 params.url = url;
678 params.mimeType = mimeType; 678 params.mimeType = mimeType;
679 params.attributeNames = paramNames; 679 params.attributeNames = paramNames;
680 params.attributeValues = paramValues; 680 params.attributeValues = paramValues;
681 params.loadManually = loadManually; 681 params.loadManually = loadManually;
682 682
683 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params ); 683 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params );
684 if (!webPlugin) 684 if (!webPlugin)
685 return nullptr; 685 return nullptr;
686 686
687 // The container takes ownership of the WebPlugin. 687 // The container takes ownership of the WebPlugin.
688 RefPtr<WebPluginContainerImpl> container = 688 RefPtrWillBeRawPtr<WebPluginContainerImpl> container =
689 WebPluginContainerImpl::create(element, webPlugin); 689 WebPluginContainerImpl::create(element, webPlugin);
690 690
691 if (!webPlugin->initialize(container.get())) 691 if (!webPlugin->initialize(container.get())) {
692 #if ENABLE(OILPAN)
693 container->dispose();
694 #endif
692 return nullptr; 695 return nullptr;
696 }
693 697
694 if (policy != AllowDetachedPlugin && !element->renderer()) 698 if (policy != AllowDetachedPlugin && !element->renderer()) {
699 #if ENABLE(OILPAN)
700 container->dispose();
701 #endif
695 return nullptr; 702 return nullptr;
703 }
696 704
697 return container; 705 return container;
698 } 706 }
699 707
700 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( 708 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
701 HTMLAppletElement* element, 709 HTMLAppletElement* element,
702 const KURL& /* baseURL */, 710 const KURL& /* baseURL */,
703 const Vector<String>& paramNames, 711 const Vector<String>& paramNames,
704 const Vector<String>& paramValues) 712 const Vector<String>& paramValues)
705 { 713 {
706 return createPlugin(element, KURL(), paramNames, paramValues, 714 return createPlugin(element, KURL(), paramNames, paramValues,
707 "application/x-java-applet", false, FailOnDetachedPlugin); 715 "application/x-java-applet", false, FailOnDetachedPlugin);
708 } 716 }
709 717
710 ObjectContentType FrameLoaderClientImpl::objectContentType( 718 ObjectContentType FrameLoaderClientImpl::objectContentType(
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 m_webFrame->client()->didAbortLoading(m_webFrame); 860 m_webFrame->client()->didAbortLoading(m_webFrame);
853 } 861 }
854 862
855 void FrameLoaderClientImpl::dispatchDidChangeManifest() 863 void FrameLoaderClientImpl::dispatchDidChangeManifest()
856 { 864 {
857 if (m_webFrame->client()) 865 if (m_webFrame->client())
858 m_webFrame->client()->didChangeManifest(m_webFrame); 866 m_webFrame->client()->didChangeManifest(m_webFrame);
859 } 867 }
860 868
861 } // namespace blink 869 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698