| 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
| 6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
| 7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
| 8 // abstraction. | 8 // abstraction. |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 } else if (process_type == switches::kUtilityProcess) { | 459 } else if (process_type == switches::kUtilityProcess) { |
| 460 rv = UtilityMain(main_params); | 460 rv = UtilityMain(main_params); |
| 461 } else if (process_type == switches::kWorkerProcess) { | 461 } else if (process_type == switches::kWorkerProcess) { |
| 462 #if defined(OS_WIN) | 462 #if defined(OS_WIN) |
| 463 rv = WorkerMain(main_params); | 463 rv = WorkerMain(main_params); |
| 464 #else | 464 #else |
| 465 NOTIMPLEMENTED(); | 465 NOTIMPLEMENTED(); |
| 466 #endif | 466 #endif |
| 467 } else if (process_type.empty()) { | 467 } else if (process_type.empty()) { |
| 468 #if defined(OS_LINUX) | 468 #if defined(OS_LINUX) |
| 469 // Glib/GDK type system and threading initializations. Needed at | 469 // Glib type system initialization. Needed at least for gconf, |
| 470 // least for gconf usage in net/proxy/proxy_config_service_linux.cc. | 470 // used in net/proxy/proxy_config_service_linux.cc. Most likely |
| 471 // TODO(sdoyon): confirm whether gconf truly needs this. If so, | 471 // this is superfluous as gtk_init() ought to do this. It's |
| 472 // the GTK main loop (message pump) must also be made to call | 472 // definitely harmless, so retained as a reminder of this |
| 473 // gdk_threads_enter/leave(). Similar issue with the clipboard | 473 // requirement for gconf. |
| 474 // (estade@ deanm@). | |
| 475 g_type_init(); | 474 g_type_init(); |
| 476 #if 0 // gconf temporarily disabled because of races. | |
| 477 // See http://crbug.com/11442. | |
| 478 g_thread_init(NULL); | |
| 479 gdk_threads_init(); | |
| 480 #endif // 0 (gconf disabled) | |
| 481 // gtk_init() can change |argc| and |argv|, but nobody else uses them. | 475 // gtk_init() can change |argc| and |argv|, but nobody else uses them. |
| 482 gtk_init(&argc, const_cast<char***>(&argv)); | 476 gtk_init(&argc, const_cast<char***>(&argv)); |
| 483 SetUpGLibLogHandler(); | 477 SetUpGLibLogHandler(); |
| 484 #endif | 478 #endif |
| 485 | 479 |
| 486 ScopedOleInitializer ole_initializer; | 480 ScopedOleInitializer ole_initializer; |
| 487 rv = BrowserMain(main_params); | 481 rv = BrowserMain(main_params); |
| 488 } else { | 482 } else { |
| 489 NOTREACHED() << "Unknown process type"; | 483 NOTREACHED() << "Unknown process type"; |
| 490 } | 484 } |
| 491 | 485 |
| 492 if (!process_type.empty()) { | 486 if (!process_type.empty()) { |
| 493 ResourceBundle::CleanupSharedInstance(); | 487 ResourceBundle::CleanupSharedInstance(); |
| 494 } | 488 } |
| 495 | 489 |
| 496 #if defined(OS_WIN) | 490 #if defined(OS_WIN) |
| 497 #ifdef _CRTDBG_MAP_ALLOC | 491 #ifdef _CRTDBG_MAP_ALLOC |
| 498 _CrtDumpMemoryLeaks(); | 492 _CrtDumpMemoryLeaks(); |
| 499 #endif // _CRTDBG_MAP_ALLOC | 493 #endif // _CRTDBG_MAP_ALLOC |
| 500 | 494 |
| 501 _Module.Term(); | 495 _Module.Term(); |
| 502 #endif | 496 #endif |
| 503 | 497 |
| 504 logging::CleanupChromeLogging(); | 498 logging::CleanupChromeLogging(); |
| 505 | 499 |
| 506 return rv; | 500 return rv; |
| 507 } | 501 } |
| OLD | NEW |