diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-03-18 13:16:26 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-20 15:55:39 +0100 |
commit | 3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch) | |
tree | 92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/content/utility | |
parent | e90d7c4b152c56919d963987e2503f9909a666d2 (diff) | |
download | qtwebengine-chromium-3f0f86b0caed75241fa71c95a5d73bc0164348c5.tar.gz |
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies
needed on Windows.
Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/content/utility')
-rw-r--r-- | chromium/content/utility/utility_main.cc | 47 | ||||
-rw-r--r-- | chromium/content/utility/utility_thread_impl.cc | 23 |
2 files changed, 47 insertions, 23 deletions
diff --git a/chromium/content/utility/utility_main.cc b/chromium/content/utility/utility_main.cc index c93c1eca536..a522427b6e7 100644 --- a/chromium/content/utility/utility_main.cc +++ b/chromium/content/utility/utility_main.cc @@ -3,11 +3,12 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/debug/leak_annotations.h" #include "base/message_loop/message_loop.h" #include "base/threading/platform_thread.h" #include "base/timer/hi_res_timer_manager.h" #include "content/child/child_process.h" -#include "content/common/sandbox_linux.h" +#include "content/common/sandbox_linux/sandbox_linux.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" #include "content/public/common/sandbox_init.h" @@ -17,6 +18,12 @@ #include "sandbox/win/src/sandbox.h" #endif +#if defined(TOOLKIT_GTK) +#include <gtk/gtk.h> + +#include "ui/gfx/gtk_util.h" +#endif + namespace content { // Mainline routine for running as the utility process. @@ -26,10 +33,40 @@ int UtilityMain(const MainFunctionParams& parameters) { base::PlatformThread::SetName("CrUtilityMain"); #if defined(OS_LINUX) - // Initialize the sandbox before any thread is created. + // Initializes the sandbox before any threads are created. + // TODO(jorgelo): move this after GTK initialization when we enable a strict + // Seccomp-BPF policy. LinuxSandbox::InitializeSandbox(); #endif +#if defined(OS_POSIX) + // The utility process is used to load plugins (see OnLoadPlugins() in + // utility_thread_impl.cc). Some plugins expect the browser to have loaded + // GLib/GTK. + // Due to bugs in GLib we need to initialize GLib/GTK before we start threads, + // see crbug.com/309093. + +#if defined(TOOLKIT_GTK) + bool is_sandboxed = false; + +#if defined(OS_LINUX) + // On Linux, we only initialize GLib/GTK if we're not sandboxed. + is_sandboxed = !parameters.command_line.HasSwitch(switches::kNoSandbox); +#endif + + if (!is_sandboxed) { + // g_thread_init() is deprecated since glib 2.31.0, please see release note: + // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.html +#if !(GLIB_CHECK_VERSION(2, 31, 0)) + if (!g_thread_get_initialized()) { + g_thread_init(NULL); + } +#endif + gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); + } +#endif +#endif + ChildProcess utility_process; utility_process.set_main_thread(new UtilityThreadImpl()); @@ -48,6 +85,12 @@ int UtilityMain(const MainFunctionParams& parameters) { base::MessageLoop::current()->Run(); +#if defined(LEAK_SANITIZER) + // Invoke LeakSanitizer before shutting down the utility thread, to avoid + // reporting shutdown-only leaks. + __lsan_do_leak_check(); +#endif + return 0; } diff --git a/chromium/content/utility/utility_thread_impl.cc b/chromium/content/utility/utility_thread_impl.cc index ca03da40981..6151de67e7c 100644 --- a/chromium/content/utility/utility_thread_impl.cc +++ b/chromium/content/utility/utility_thread_impl.cc @@ -19,12 +19,6 @@ #include "ipc/ipc_sync_channel.h" #include "third_party/WebKit/public/web/WebKit.h" -#if defined(TOOLKIT_GTK) -#include <gtk/gtk.h> - -#include "ui/gfx/gtk_util.h" -#endif - namespace content { namespace { @@ -55,7 +49,7 @@ void UtilityThreadImpl::Shutdown() { ChildThread::Shutdown(); if (!single_process_) - WebKit::shutdown(); + blink::shutdown(); } bool UtilityThreadImpl::Send(IPC::Message* msg) { @@ -98,7 +92,7 @@ void UtilityThreadImpl::Init() { // needs WebKit initialized in the utility process, they need to have // another path to support single process mode. webkit_platform_support_.reset(new WebKitPlatformSupportImpl); - WebKit::initialize(webkit_platform_support_.get()); + blink::initialize(webkit_platform_support_.get()); } GetContentClient()->utility()->UtilityThreadStarted(); } @@ -132,19 +126,6 @@ void UtilityThreadImpl::OnLoadPlugins( const std::vector<base::FilePath>& plugin_paths) { PluginList* plugin_list = PluginList::Singleton(); - // On Linux, some plugins expect the browser to have loaded glib/gtk. Do that - // before attempting to call into the plugin. - // g_thread_init API is deprecated since glib 2.31.0, please see release note: - // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.html -#if defined(TOOLKIT_GTK) -#if !(GLIB_CHECK_VERSION(2, 31, 0)) - if (!g_thread_get_initialized()) { - g_thread_init(NULL); - } -#endif - gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); -#endif - std::vector<WebPluginInfo> plugins; // TODO(bauerb): If we restart loading plug-ins, we might mess up the logic in // PluginList::ShouldLoadPlugin due to missing the previously loaded plug-ins |