| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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(USE_X11) | 9 #if defined(TOOLKIT_USES_GTK) |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| 11 #elif defined(OS_MACOSX) | 11 #elif defined(OS_MACOSX) |
| 12 #include <CoreFoundation/CoreFoundation.h> | 12 #include <CoreFoundation/CoreFoundation.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/lazy_instance.h" | 19 #include "base/lazy_instance.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 42 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( | 42 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( |
| 43 base::LINKER_INITIALIZED); | 43 base::LINKER_INITIALIZED); |
| 44 | 44 |
| 45 PluginThread::PluginThread() | 45 PluginThread::PluginThread() |
| 46 : preloaded_plugin_module_(NULL) { | 46 : preloaded_plugin_module_(NULL) { |
| 47 plugin_path_ = | 47 plugin_path_ = |
| 48 CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 48 CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 49 switches::kPluginPath); | 49 switches::kPluginPath); |
| 50 | 50 |
| 51 lazy_tls.Pointer()->Set(this); | 51 lazy_tls.Pointer()->Set(this); |
| 52 #if defined(OS_LINUX) | 52 #if defined(TOOLKIT_USES_GTK) |
| 53 { | 53 { |
| 54 // XEmbed plugins assume they are hosted in a Gtk application, so we need | 54 // XEmbed plugins assume they are hosted in a Gtk application, so we need |
| 55 // to initialize Gtk in the plugin process. | 55 // to initialize Gtk in the plugin process. |
| 56 g_thread_init(NULL); | 56 g_thread_init(NULL); |
| 57 | 57 |
| 58 // Flash has problems receiving clicks with newer GTKs due to the | 58 // Flash has problems receiving clicks with newer GTKs due to the |
| 59 // client-side windows change. To be safe, we just always set the | 59 // client-side windows change. To be safe, we just always set the |
| 60 // backwards-compat environment variable. | 60 // backwards-compat environment variable. |
| 61 setenv("GDK_NATIVE_WINDOWS", "1", 1); | 61 setenv("GDK_NATIVE_WINDOWS", "1", 1); |
| 62 | 62 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 bool result = ChildThread::current()->Send( | 151 bool result = ChildThread::current()->Send( |
| 152 new ChildProcessHostMsg_ResolveProxy(url, &net_error, &proxy_result)); | 152 new ChildProcessHostMsg_ResolveProxy(url, &net_error, &proxy_result)); |
| 153 if (!result || net_error != net::OK) | 153 if (!result || net_error != net::OK) |
| 154 return false; | 154 return false; |
| 155 | 155 |
| 156 *proxy_list = proxy_result; | 156 *proxy_list = proxy_result; |
| 157 return true; | 157 return true; |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace webkit_glue | 160 } // namespace webkit_glue |
| OLD | NEW |