| 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/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #include <commctrl.h> | 67 #include <commctrl.h> |
| 68 #include <shellapi.h> | 68 #include <shellapi.h> |
| 69 | 69 |
| 70 #include "base/win/text_services_message_filter.h" | 70 #include "base/win/text_services_message_filter.h" |
| 71 #include "content/browser/system_message_window_win.h" | 71 #include "content/browser/system_message_window_win.h" |
| 72 #include "content/common/sandbox_win.h" | 72 #include "content/common/sandbox_win.h" |
| 73 #include "net/base/winsock_init.h" | 73 #include "net/base/winsock_init.h" |
| 74 #include "ui/base/l10n/l10n_util_win.h" | 74 #include "ui/base/l10n/l10n_util_win.h" |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 77 #if defined(OS_LINUX) || defined(OS_BSD) |
| 78 #include <glib-object.h> | 78 #include <glib-object.h> |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 #if defined(OS_LINUX) | 81 #if defined(OS_LINUX) |
| 82 #include "content/browser/device_monitor_linux.h" | 82 #include "content/browser/device_monitor_linux.h" |
| 83 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 83 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 84 #include "content/browser/device_monitor_mac.h" | 84 #include "content/browser/device_monitor_mac.h" |
| 85 #endif | 85 #endif |
| 86 | 86 |
| 87 #if defined(TOOLKIT_GTK) | 87 #if defined(TOOLKIT_GTK) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 std::string sandbox_cmd; | 129 std::string sandbox_cmd; |
| 130 if (sandbox_binary && !parsed_command_line.HasSwitch(switches::kNoSandbox)) | 130 if (sandbox_binary && !parsed_command_line.HasSwitch(switches::kNoSandbox)) |
| 131 sandbox_cmd = sandbox_binary; | 131 sandbox_cmd = sandbox_binary; |
| 132 | 132 |
| 133 // Tickle the sandbox host and zygote host so they fork now. | 133 // Tickle the sandbox host and zygote host so they fork now. |
| 134 RenderSandboxHostLinux::GetInstance()->Init(sandbox_cmd); | 134 RenderSandboxHostLinux::GetInstance()->Init(sandbox_cmd); |
| 135 ZygoteHostImpl::GetInstance()->Init(sandbox_cmd); | 135 ZygoteHostImpl::GetInstance()->Init(sandbox_cmd); |
| 136 } | 136 } |
| 137 #endif | 137 #endif |
| 138 | 138 |
| 139 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 139 #if defined(OS_LINUX) || defined(OS_BSD) |
| 140 static void GLibLogHandler(const gchar* log_domain, | 140 static void GLibLogHandler(const gchar* log_domain, |
| 141 GLogLevelFlags log_level, | 141 GLogLevelFlags log_level, |
| 142 const gchar* message, | 142 const gchar* message, |
| 143 gpointer userdata) { | 143 gpointer userdata) { |
| 144 if (!log_domain) | 144 if (!log_domain) |
| 145 log_domain = "<unknown>"; | 145 log_domain = "<unknown>"; |
| 146 if (!message) | 146 if (!message) |
| 147 message = "<no message>"; | 147 message = "<no message>"; |
| 148 | 148 |
| 149 if (strstr(message, "Loading IM context type") || | 149 if (strstr(message, "Loading IM context type") || |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 #endif // !defined(OS_IOS) | 813 #endif // !defined(OS_IOS) |
| 814 } | 814 } |
| 815 | 815 |
| 816 void BrowserMainLoop::InitializeToolkit() { | 816 void BrowserMainLoop::InitializeToolkit() { |
| 817 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit") | 817 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit") |
| 818 // TODO(evan): this function is rather subtle, due to the variety | 818 // TODO(evan): this function is rather subtle, due to the variety |
| 819 // of intersecting ifdefs we have. To keep it easy to follow, there | 819 // of intersecting ifdefs we have. To keep it easy to follow, there |
| 820 // are no #else branches on any #ifs. | 820 // are no #else branches on any #ifs. |
| 821 // TODO(stevenjb): Move platform specific code into platform specific Parts | 821 // TODO(stevenjb): Move platform specific code into platform specific Parts |
| 822 // (Need to add InitializeToolkit stage to BrowserParts). | 822 // (Need to add InitializeToolkit stage to BrowserParts). |
| 823 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 823 #if defined(OS_LINUX) || defined(OS_BSD) |
| 824 // g_type_init will be deprecated in 2.36. 2.35 is the development | 824 // g_type_init will be deprecated in 2.36. 2.35 is the development |
| 825 // version for 2.36, hence do not call g_type_init starting 2.35. | 825 // version for 2.36, hence do not call g_type_init starting 2.35. |
| 826 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g
-type-init | 826 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g
-type-init |
| 827 #if !GLIB_CHECK_VERSION(2, 35, 0) | 827 #if !GLIB_CHECK_VERSION(2, 35, 0) |
| 828 // Glib type system initialization. Needed at least for gconf, | 828 // Glib type system initialization. Needed at least for gconf, |
| 829 // used in net/proxy/proxy_config_service_linux.cc. Most likely | 829 // used in net/proxy/proxy_config_service_linux.cc. Most likely |
| 830 // this is superfluous as gtk_init() ought to do this. It's | 830 // this is superfluous as gtk_init() ought to do this. It's |
| 831 // definitely harmless, so retained as a reminder of this | 831 // definitely harmless, so retained as a reminder of this |
| 832 // requirement for gconf. | 832 // requirement for gconf. |
| 833 g_type_init(); | 833 g_type_init(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 if (parameters_.ui_task) | 868 if (parameters_.ui_task) |
| 869 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 869 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
| 870 *parameters_.ui_task); | 870 *parameters_.ui_task); |
| 871 | 871 |
| 872 base::RunLoop run_loop; | 872 base::RunLoop run_loop; |
| 873 run_loop.Run(); | 873 run_loop.Run(); |
| 874 #endif | 874 #endif |
| 875 } | 875 } |
| 876 | 876 |
| 877 } // namespace content | 877 } // namespace content |
| OLD | NEW |