Chromium Code Reviews| Index: content/browser/plugin_service_impl.cc |
| diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc |
| index fa21c7d61491ed634706df8ba881793ef362d858..8d885c04f9132a1e7e5213a3832416797721ff9f 100644 |
| --- a/content/browser/plugin_service_impl.cc |
| +++ b/content/browser/plugin_service_impl.cc |
| @@ -264,11 +264,11 @@ PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess( |
| return new_host.release(); |
| } |
| +#if defined(ENABLE_PLUGINS) |
|
jam
2012/12/17 17:54:53
what would be the point of including this file whe
|
| PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( |
| const FilePath& plugin_path, |
| const FilePath& profile_data_directory, |
| PpapiPluginProcessHost::PluginClient* client) { |
| -#if defined(ENABLE_PLUGINS) |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| PpapiPluginProcessHost* plugin_host = |
| @@ -285,9 +285,6 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( |
| return PpapiPluginProcessHost::CreatePluginHost( |
| *info, profile_data_directory, |
| client->GetResourceContext()->GetHostResolver()); |
| -#else |
| - return NULL; |
| -#endif |
| } |
| PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( |
| @@ -309,6 +306,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( |
| // This broker isn't loaded by any broker process, so create a new process. |
| return PpapiPluginProcessHost::CreateBrokerHost(*info); |
| } |
| +#endif // defined(ENABLE_PLUGINS) |
| void PluginServiceImpl::OpenChannelToNpapiPlugin( |
| int render_process_id, |
| @@ -337,6 +335,7 @@ void PluginServiceImpl::OpenChannelToPpapiPlugin( |
| const FilePath& plugin_path, |
| const FilePath& profile_data_directory, |
| PpapiPluginProcessHost::PluginClient* client) { |
| +#if defined(ENABLE_PLUGINS) |
| PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( |
| plugin_path, profile_data_directory, client); |
| if (plugin_host) { |
| @@ -345,6 +344,7 @@ void PluginServiceImpl::OpenChannelToPpapiPlugin( |
| // Send error. |
| client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); |
| } |
| +#endif // defined(ENABLE_PLUGINS) |
| } |
| void PluginServiceImpl::OpenChannelToPpapiBroker( |
| @@ -566,17 +566,22 @@ void PluginServiceImpl::OnWaitableEventSignaled( |
| } |
| void PluginServiceImpl::RegisterPepperPlugins() { |
| +#if defined(ENABLE_PLUGINS) |
| // TODO(abarth): It seems like the PepperPluginRegistry should do this work. |
| PepperPluginRegistry::ComputeList(&ppapi_plugins_); |
| for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { |
| RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo(), true); |
| } |
| +#endif |
| } |
| // There should generally be very few plugins so a brute-force search is fine. |
| PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( |
| const FilePath& plugin_path) { |
| PepperPluginInfo* info = NULL; |
| +#if !defined(ENABLE_PLUGINS) |
| + return info; |
| +#else |
| for (size_t i = 0; i < ppapi_plugins_.size(); i++) { |
| if (ppapi_plugins_[i].path == plugin_path) { |
| info = &ppapi_plugins_[i]; |
| @@ -598,6 +603,7 @@ PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( |
| return NULL; |
| ppapi_plugins_.push_back(new_pepper_info); |
| return &ppapi_plugins_[ppapi_plugins_.size() - 1]; |
| +#endif |
| } |
| #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |