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

Side by Side Diff: content/plugin/plugin_thread.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/plugin/plugin_thread.h" 5 #include "content/plugin/plugin_thread.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(TOOLKIT_GTK) 9 #if defined(TOOLKIT_GTK)
10 #include <gtk/gtk.h> 10 #include <gtk/gtk.h>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 ui::SetDefaultX11ErrorHandlers(); 111 ui::SetDefaultX11ErrorHandlers();
112 #endif 112 #endif
113 113
114 PatchNPNFunctions(); 114 PatchNPNFunctions();
115 115
116 // Preload the library to avoid loading, unloading then reloading 116 // Preload the library to avoid loading, unloading then reloading
117 preloaded_plugin_module_ = base::LoadNativeLibrary(plugin_path, NULL); 117 preloaded_plugin_module_ = base::LoadNativeLibrary(plugin_path, NULL);
118 118
119 scoped_refptr<webkit::npapi::PluginLib> plugin( 119 scoped_refptr<webkit::npapi::PluginLib> plugin(
120 webkit::npapi::PluginLib::CreatePluginLib(plugin_path)); 120 webkit::npapi::PluginLib::CreatePluginLib(plugin_path));
121 if (plugin) { 121 if (plugin.get()) {
122 plugin->NP_Initialize(); 122 plugin->NP_Initialize();
123 // For OOP plugins the plugin dll will be unloaded during process shutdown 123 // For OOP plugins the plugin dll will be unloaded during process shutdown
124 // time. 124 // time.
125 plugin->set_defer_unload(true); 125 plugin->set_defer_unload(true);
126 } 126 }
127 127
128 GetContentClient()->plugin()->PluginProcessStarted( 128 GetContentClient()->plugin()->PluginProcessStarted(
129 plugin.get() ? plugin->plugin_info().name : string16()); 129 plugin.get() ? plugin->plugin_info().name : string16());
130 130
131 GetContentClient()->AddNPAPIPlugins( 131 GetContentClient()->AddNPAPIPlugins(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 IPC_MESSAGE_UNHANDLED(handled = false) 167 IPC_MESSAGE_UNHANDLED(handled = false)
168 IPC_END_MESSAGE_MAP() 168 IPC_END_MESSAGE_MAP()
169 return handled; 169 return handled;
170 } 170 }
171 171
172 void PluginThread::OnCreateChannel(int renderer_id, 172 void PluginThread::OnCreateChannel(int renderer_id,
173 bool incognito) { 173 bool incognito) {
174 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( 174 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel(
175 renderer_id, ChildProcess::current()->io_message_loop_proxy())); 175 renderer_id, ChildProcess::current()->io_message_loop_proxy()));
176 IPC::ChannelHandle channel_handle; 176 IPC::ChannelHandle channel_handle;
177 if (channel) { 177 if (channel.get()) {
178 channel_handle.name = channel->channel_handle().name; 178 channel_handle.name = channel->channel_handle().name;
179 #if defined(OS_POSIX) 179 #if defined(OS_POSIX)
180 // On POSIX, pass the renderer-side FD. 180 // On POSIX, pass the renderer-side FD.
181 channel_handle.socket = 181 channel_handle.socket =
182 base::FileDescriptor(channel->TakeRendererFileDescriptor(), true); 182 base::FileDescriptor(channel->TakeRendererFileDescriptor(), true);
183 #endif 183 #endif
184 channel->set_incognito(incognito); 184 channel->set_incognito(incognito);
185 } 185 }
186 186
187 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); 187 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle));
188 } 188 }
189 189
190 void PluginThread::OnNotifyRenderersOfPendingShutdown() { 190 void PluginThread::OnNotifyRenderersOfPendingShutdown() {
191 PluginChannel::NotifyRenderersOfPendingShutdown(); 191 PluginChannel::NotifyRenderersOfPendingShutdown();
192 } 192 }
193 193
194 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698