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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1162053003: Move BrowserPluginDelegate's lifetime mgmt out of content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync @tott Created 5 years, 6 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 } 1792 }
1793 1793
1794 blink::WebPlugin* RenderFrameImpl::CreatePlugin( 1794 blink::WebPlugin* RenderFrameImpl::CreatePlugin(
1795 blink::WebFrame* frame, 1795 blink::WebFrame* frame,
1796 const WebPluginInfo& info, 1796 const WebPluginInfo& info,
1797 const blink::WebPluginParams& params, 1797 const blink::WebPluginParams& params,
1798 scoped_ptr<content::PluginInstanceThrottler> throttler) { 1798 scoped_ptr<content::PluginInstanceThrottler> throttler) {
1799 DCHECK_EQ(frame_, frame); 1799 DCHECK_EQ(frame_, frame);
1800 #if defined(ENABLE_PLUGINS) 1800 #if defined(ENABLE_PLUGINS)
1801 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { 1801 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
1802 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( 1802 return BrowserPluginManager::Get()->CreateBrowserPlugin(
1803 this,
1803 GetContentClient()->renderer()->CreateBrowserPluginDelegate( 1804 GetContentClient()->renderer()->CreateBrowserPluginDelegate(
1804 this, params.mimeType.utf8(), GURL(params.url))); 1805 this, params.mimeType.utf8(), GURL(params.url)));
1805 return BrowserPluginManager::Get()->CreateBrowserPlugin(
1806 this, browser_plugin_delegate.Pass());
1807 } 1806 }
1808 1807
1809 bool pepper_plugin_was_registered = false; 1808 bool pepper_plugin_was_registered = false;
1810 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( 1809 scoped_refptr<PluginModule> pepper_module(PluginModule::Create(
1811 this, info, &pepper_plugin_was_registered)); 1810 this, info, &pepper_plugin_was_registered));
1812 if (pepper_plugin_was_registered) { 1811 if (pepper_plugin_was_registered) {
1813 if (pepper_module.get()) { 1812 if (pepper_module.get()) {
1814 return new PepperWebPluginImpl( 1813 return new PepperWebPluginImpl(
1815 pepper_module.get(), params, this, 1814 pepper_module.get(), params, this,
1816 make_scoped_ptr( 1815 make_scoped_ptr(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 blink::WebLocalFrame* frame, 1911 blink::WebLocalFrame* frame,
1913 const blink::WebPluginParams& params) { 1912 const blink::WebPluginParams& params) {
1914 DCHECK_EQ(frame_, frame); 1913 DCHECK_EQ(frame_, frame);
1915 blink::WebPlugin* plugin = NULL; 1914 blink::WebPlugin* plugin = NULL;
1916 if (GetContentClient()->renderer()->OverrideCreatePlugin( 1915 if (GetContentClient()->renderer()->OverrideCreatePlugin(
1917 this, frame, params, &plugin)) { 1916 this, frame, params, &plugin)) {
1918 return plugin; 1917 return plugin;
1919 } 1918 }
1920 1919
1921 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { 1920 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) {
1922 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( 1921 return BrowserPluginManager::Get()->CreateBrowserPlugin(
1922 this,
1923 GetContentClient()->renderer()->CreateBrowserPluginDelegate(this, 1923 GetContentClient()->renderer()->CreateBrowserPluginDelegate(this,
1924 kBrowserPluginMimeType, GURL(params.url))); 1924 kBrowserPluginMimeType, GURL(params.url)));
1925 return BrowserPluginManager::Get()->CreateBrowserPlugin(
1926 this, browser_plugin_delegate.Pass());
1927 } 1925 }
1928 1926
1929 #if defined(ENABLE_PLUGINS) 1927 #if defined(ENABLE_PLUGINS)
1930 WebPluginInfo info; 1928 WebPluginInfo info;
1931 std::string mime_type; 1929 std::string mime_type;
1932 bool found = false; 1930 bool found = false;
1933 Send(new FrameHostMsg_GetPluginInfo( 1931 Send(new FrameHostMsg_GetPluginInfo(
1934 routing_id_, params.url, frame->top()->document().url(), 1932 routing_id_, params.url, frame->top()->document().url(),
1935 params.mimeType.utf8(), &found, &info, &mime_type)); 1933 params.mimeType.utf8(), &found, &info, &mime_type));
1936 if (!found) 1934 if (!found)
(...skipping 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after
4953 #elif defined(ENABLE_BROWSER_CDMS) 4951 #elif defined(ENABLE_BROWSER_CDMS)
4954 cdm_manager_, 4952 cdm_manager_,
4955 #endif 4953 #endif
4956 this); 4954 this);
4957 } 4955 }
4958 4956
4959 return cdm_factory_; 4957 return cdm_factory_;
4960 } 4958 }
4961 4959
4962 } // namespace content 4960 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698