| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/plugin/plugin_thread.h" | 5 #include "chrome/plugin/plugin_thread.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/thread_local.h" | 12 #include "base/thread_local.h" |
| 13 #include "chrome/common/child_process.h" | 13 #include "chrome/common/child_process.h" |
| 14 #include "chrome/common/chrome_plugin_lib.h" | 14 #include "chrome/common/chrome_plugin_lib.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/plugin_messages.h" | 16 #include "chrome/common/plugin_messages.h" |
| 17 #include "chrome/common/render_messages.h" | 17 #include "chrome/common/render_messages.h" |
| 18 #include "chrome/plugin/chrome_plugin_host.h" | 18 #include "chrome/plugin/chrome_plugin_host.h" |
| 19 #include "chrome/plugin/npobject_util.h" | 19 #include "chrome/plugin/npobject_util.h" |
| 20 #include "chrome/renderer/render_thread.h" | 20 #include "chrome/renderer/render_thread.h" |
| 21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 22 #include "webkit/glue/plugins/plugin_lib.h" | 22 #include "webkit/glue/plugins/plugin_lib.h" |
| 23 #include "webkit/glue/webkit_glue.h" | 23 #include "webkit/glue/webkit_glue.h" |
| 24 | 24 |
| 25 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( | 25 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( |
| 26 base::LINKER_INITIALIZED); | 26 base::LINKER_INITIALIZED); |
| 27 | 27 |
| 28 PluginThread::PluginThread() | 28 PluginThread::PluginThread() |
| 29 : preloaded_plugin_module_(NULL) { | 29 : preloaded_plugin_module_(NULL) { |
| 30 plugin_path_ = FilePath::FromWStringHack( | 30 plugin_path_ = |
| 31 CommandLine::ForCurrentProcess()->GetSwitchValue(switches::kPluginPath)); | 31 CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 32 switches::kPluginPath); |
| 32 | 33 |
| 33 lazy_tls.Pointer()->Set(this); | 34 lazy_tls.Pointer()->Set(this); |
| 34 #if defined(OS_LINUX) | 35 #if defined(OS_LINUX) |
| 35 { | 36 { |
| 36 // XEmbed plugins assume they are hosted in a Gtk application, so we need | 37 // XEmbed plugins assume they are hosted in a Gtk application, so we need |
| 37 // to initialize Gtk in the plugin process. | 38 // to initialize Gtk in the plugin process. |
| 38 g_thread_init(NULL); | 39 g_thread_init(NULL); |
| 39 const std::vector<std::string>& args = | 40 const std::vector<std::string>& args = |
| 40 CommandLine::ForCurrentProcess()->argv(); | 41 CommandLine::ForCurrentProcess()->argv(); |
| 41 int argc = args.size(); | 42 int argc = args.size(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 245 } |
| 245 | 246 |
| 246 if (!result || net_error != net::OK) | 247 if (!result || net_error != net::OK) |
| 247 return false; | 248 return false; |
| 248 | 249 |
| 249 *proxy_list = proxy_result; | 250 *proxy_list = proxy_result; |
| 250 return true; | 251 return true; |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace webkit_glue | 254 } // namespace webkit_glue |
| OLD | NEW |