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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include <commctrl.h> | 75 #include <commctrl.h> |
76 #include <shellapi.h> | 76 #include <shellapi.h> |
77 | 77 |
78 #include "base/win/text_services_message_filter.h" | 78 #include "base/win/text_services_message_filter.h" |
79 #include "content/browser/system_message_window_win.h" | 79 #include "content/browser/system_message_window_win.h" |
80 #include "content/common/sandbox_win.h" | 80 #include "content/common/sandbox_win.h" |
81 #include "net/base/winsock_init.h" | 81 #include "net/base/winsock_init.h" |
82 #include "ui/base/l10n/l10n_util_win.h" | 82 #include "ui/base/l10n/l10n_util_win.h" |
83 #endif | 83 #endif |
84 | 84 |
85 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 85 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
86 #include <glib-object.h> | 86 #include <glib-object.h> |
87 #endif | 87 #endif |
88 | 88 |
89 #if defined(OS_LINUX) | 89 #if defined(OS_LINUX) |
90 #include "content/browser/device_monitor_linux.h" | 90 #include "content/browser/device_monitor_linux.h" |
91 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 91 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
92 #include "content/browser/device_monitor_mac.h" | 92 #include "content/browser/device_monitor_mac.h" |
93 #endif | 93 #endif |
94 | 94 |
95 #if defined(TOOLKIT_GTK) | 95 #if defined(TOOLKIT_GTK) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 LOG(ERROR) << no_suid_error; | 168 LOG(ERROR) << no_suid_error; |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 // Tickle the sandbox host and zygote host so they fork now. | 172 // Tickle the sandbox host and zygote host so they fork now. |
173 RenderSandboxHostLinux::GetInstance()->Init(sandbox_binary.value()); | 173 RenderSandboxHostLinux::GetInstance()->Init(sandbox_binary.value()); |
174 ZygoteHostImpl::GetInstance()->Init(sandbox_binary.value()); | 174 ZygoteHostImpl::GetInstance()->Init(sandbox_binary.value()); |
175 } | 175 } |
176 #endif | 176 #endif |
177 | 177 |
178 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 178 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
179 static void GLibLogHandler(const gchar* log_domain, | 179 static void GLibLogHandler(const gchar* log_domain, |
180 GLogLevelFlags log_level, | 180 GLogLevelFlags log_level, |
181 const gchar* message, | 181 const gchar* message, |
182 gpointer userdata) { | 182 gpointer userdata) { |
183 if (!log_domain) | 183 if (!log_domain) |
184 log_domain = "<unknown>"; | 184 log_domain = "<unknown>"; |
185 if (!message) | 185 if (!message) |
186 message = "<no message>"; | 186 message = "<no message>"; |
187 | 187 |
188 if (strstr(message, "Loading IM context type") || | 188 if (strstr(message, "Loading IM context type") || |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 return result_code_; | 987 return result_code_; |
988 } | 988 } |
989 | 989 |
990 void BrowserMainLoop::InitializeToolkit() { | 990 void BrowserMainLoop::InitializeToolkit() { |
991 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit") | 991 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit") |
992 // TODO(evan): this function is rather subtle, due to the variety | 992 // TODO(evan): this function is rather subtle, due to the variety |
993 // of intersecting ifdefs we have. To keep it easy to follow, there | 993 // of intersecting ifdefs we have. To keep it easy to follow, there |
994 // are no #else branches on any #ifs. | 994 // are no #else branches on any #ifs. |
995 // TODO(stevenjb): Move platform specific code into platform specific Parts | 995 // TODO(stevenjb): Move platform specific code into platform specific Parts |
996 // (Need to add InitializeToolkit stage to BrowserParts). | 996 // (Need to add InitializeToolkit stage to BrowserParts). |
997 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 997 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
998 // g_type_init will be deprecated in 2.36. 2.35 is the development | 998 // g_type_init will be deprecated in 2.36. 2.35 is the development |
999 // version for 2.36, hence do not call g_type_init starting 2.35. | 999 // version for 2.36, hence do not call g_type_init starting 2.35. |
1000 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g
-type-init | 1000 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g
-type-init |
1001 #if !GLIB_CHECK_VERSION(2, 35, 0) | 1001 #if !GLIB_CHECK_VERSION(2, 35, 0) |
1002 // Glib type system initialization. Needed at least for gconf, | 1002 // Glib type system initialization. Needed at least for gconf, |
1003 // used in net/proxy/proxy_config_service_linux.cc. Most likely | 1003 // used in net/proxy/proxy_config_service_linux.cc. Most likely |
1004 // this is superfluous as gtk_init() ought to do this. It's | 1004 // this is superfluous as gtk_init() ought to do this. It's |
1005 // definitely harmless, so retained as a reminder of this | 1005 // definitely harmless, so retained as a reminder of this |
1006 // requirement for gconf. | 1006 // requirement for gconf. |
1007 g_type_init(); | 1007 g_type_init(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 if (parameters_.ui_task) | 1042 if (parameters_.ui_task) |
1043 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 1043 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
1044 *parameters_.ui_task); | 1044 *parameters_.ui_task); |
1045 | 1045 |
1046 base::RunLoop run_loop; | 1046 base::RunLoop run_loop; |
1047 run_loop.Run(); | 1047 run_loop.Run(); |
1048 #endif | 1048 #endif |
1049 } | 1049 } |
1050 | 1050 |
1051 } // namespace content | 1051 } // namespace content |
OLD | NEW |