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/browser/browser_main.h" | 5 #include "content/browser/browser_main.h" |
6 | 6 |
7 #include "base/allocator/allocator_shim.h" | 7 #include "base/allocator/allocator_shim.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/logging.h" | 10 #include "base/logging.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 #include <commctrl.h> | 30 #include <commctrl.h> |
31 #include <ole2.h> | 31 #include <ole2.h> |
32 #include <shellapi.h> | 32 #include <shellapi.h> |
33 | 33 |
34 #include "base/win/scoped_com_initializer.h" | 34 #include "base/win/scoped_com_initializer.h" |
35 #include "net/base/winsock_init.h" | 35 #include "net/base/winsock_init.h" |
36 #include "sandbox/src/sandbox.h" | 36 #include "sandbox/src/sandbox.h" |
37 #include "ui/base/l10n/l10n_util_win.h" | 37 #include "ui/base/l10n/l10n_util_win.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_CHROMEOS) | |
41 #include <dbus/dbus-glib.h> | |
42 #endif | |
43 | |
40 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 44 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
41 #include <dbus/dbus-glib.h> | |
42 #include <sys/stat.h> | 45 #include <sys/stat.h> |
43 | 46 |
44 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 47 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
45 #include "content/browser/zygote_host_linux.h" | 48 #include "content/browser/zygote_host_linux.h" |
46 #endif | 49 #endif |
47 | 50 |
48 #if defined(TOOLKIT_USES_GTK) | 51 #if defined(TOOLKIT_USES_GTK) |
49 #include "ui/gfx/gtk_util.h" | 52 #include "ui/gfx/gtk_util.h" |
50 #endif | 53 #endif |
51 | 54 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 // check is actually equivalent and sufficient to work around the | 280 // check is actually equivalent and sufficient to work around the |
278 // error. | 281 // error. |
279 if (!g_thread_supported()) | 282 if (!g_thread_supported()) |
280 g_thread_init(NULL); | 283 g_thread_init(NULL); |
281 // Glib type system initialization. Needed at least for gconf, | 284 // Glib type system initialization. Needed at least for gconf, |
282 // used in net/proxy/proxy_config_service_linux.cc. Most likely | 285 // used in net/proxy/proxy_config_service_linux.cc. Most likely |
283 // this is superfluous as gtk_init() ought to do this. It's | 286 // this is superfluous as gtk_init() ought to do this. It's |
284 // definitely harmless, so retained as a reminder of this | 287 // definitely harmless, so retained as a reminder of this |
285 // requirement for gconf. | 288 // requirement for gconf. |
286 g_type_init(); | 289 g_type_init(); |
287 // We use glib-dbus for geolocation and it's possible other libraries | 290 #if defined(OS_CHROMEOS) |
288 // (e.g. gnome-keyring) will use it, so initialize its threading here | 291 // ChromeOS still uses dbus-glib, so initialize its threading here. |
289 // as well. | 292 // TODO(satorux, stevenjb): remove this once it is no longer needed. |
satorux1
2011/09/12 19:28:57
Thank you for updating this!
| |
290 dbus_g_thread_init(); | 293 dbus_g_thread_init(); |
294 #endif | |
291 gfx::GtkInitFromCommandLine(parameters().command_line_); | 295 gfx::GtkInitFromCommandLine(parameters().command_line_); |
292 SetUpGLibLogHandler(); | 296 SetUpGLibLogHandler(); |
293 #endif | 297 #endif |
294 | 298 |
295 #if defined(TOOLKIT_GTK) | 299 #if defined(TOOLKIT_GTK) |
296 // It is important for this to happen before the first run dialog, as it | 300 // It is important for this to happen before the first run dialog, as it |
297 // styles the dialog as well. | 301 // styles the dialog as well. |
298 gfx::InitRCStyles(); | 302 gfx::InitRCStyles(); |
299 #endif | 303 #endif |
300 | 304 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 #endif // OS_WIN | 402 #endif // OS_WIN |
399 | 403 |
400 // Initialize histogram statistics gathering system. | 404 // Initialize histogram statistics gathering system. |
401 base::StatisticsRecorder statistics; | 405 base::StatisticsRecorder statistics; |
402 | 406 |
403 parts->RunMainMessageLoopParts(); | 407 parts->RunMainMessageLoopParts(); |
404 | 408 |
405 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 409 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
406 return parts->result_code(); | 410 return parts->result_code(); |
407 } | 411 } |
OLD | NEW |