| OLD | NEW |
| 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/utility/utility_thread_impl.h" | 5 #include "content/utility/utility_thread_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "content/child/child_process.h" | 12 #include "content/child/child_process.h" |
| 13 #include "content/child/webkitplatformsupport_impl.h" | 13 #include "content/child/webkitplatformsupport_impl.h" |
| 14 #include "content/common/child_process_messages.h" | 14 #include "content/common/child_process_messages.h" |
| 15 #include "content/common/plugin_list.h" |
| 15 #include "content/common/utility_messages.h" | 16 #include "content/common/utility_messages.h" |
| 16 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 17 #include "content/public/utility/content_utility_client.h" | 18 #include "content/public/utility/content_utility_client.h" |
| 18 #include "ipc/ipc_sync_channel.h" | 19 #include "ipc/ipc_sync_channel.h" |
| 19 #include "third_party/WebKit/public/web/WebKit.h" | 20 #include "third_party/WebKit/public/web/WebKit.h" |
| 20 #include "webkit/plugins/npapi/plugin_list.h" | |
| 21 | 21 |
| 22 #if defined(TOOLKIT_GTK) | 22 #if defined(TOOLKIT_GTK) |
| 23 #include <gtk/gtk.h> | 23 #include <gtk/gtk.h> |
| 24 | 24 |
| 25 #include "ui/gfx/gtk_util.h" | 25 #include "ui/gfx/gtk_util.h" |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 batch_mode_ = true; | 121 batch_mode_ = true; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void UtilityThreadImpl::OnBatchModeFinished() { | 124 void UtilityThreadImpl::OnBatchModeFinished() { |
| 125 ChildProcess::current()->ReleaseProcess(); | 125 ChildProcess::current()->ReleaseProcess(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 #if defined(OS_POSIX) | 128 #if defined(OS_POSIX) |
| 129 void UtilityThreadImpl::OnLoadPlugins( | 129 void UtilityThreadImpl::OnLoadPlugins( |
| 130 const std::vector<base::FilePath>& plugin_paths) { | 130 const std::vector<base::FilePath>& plugin_paths) { |
| 131 webkit::npapi::PluginList* plugin_list = | 131 PluginList* plugin_list = PluginList::Singleton(); |
| 132 webkit::npapi::PluginList::Singleton(); | |
| 133 | 132 |
| 134 // On Linux, some plugins expect the browser to have loaded glib/gtk. Do that | 133 // On Linux, some plugins expect the browser to have loaded glib/gtk. Do that |
| 135 // before attempting to call into the plugin. | 134 // before attempting to call into the plugin. |
| 136 // g_thread_init API is deprecated since glib 2.31.0, please see release note: | 135 // g_thread_init API is deprecated since glib 2.31.0, please see release note: |
| 137 // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.ht
ml | 136 // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.ht
ml |
| 138 #if defined(TOOLKIT_GTK) | 137 #if defined(TOOLKIT_GTK) |
| 139 #if !(GLIB_CHECK_VERSION(2, 31, 0)) | 138 #if !(GLIB_CHECK_VERSION(2, 31, 0)) |
| 140 if (!g_thread_get_initialized()) { | 139 if (!g_thread_get_initialized()) { |
| 141 g_thread_init(NULL); | 140 g_thread_init(NULL); |
| 142 } | 141 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 155 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); | 154 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |
| 156 else | 155 else |
| 157 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); | 156 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); |
| 158 } | 157 } |
| 159 | 158 |
| 160 ReleaseProcessIfNeeded(); | 159 ReleaseProcessIfNeeded(); |
| 161 } | 160 } |
| 162 #endif | 161 #endif |
| 163 | 162 |
| 164 } // namespace content | 163 } // namespace content |
| OLD | NEW |