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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 #endif | 289 #endif |
290 | 290 |
291 if (parsed_command_line_.HasSwitch(switches::kEnableSSLCachedInfo)) | 291 if (parsed_command_line_.HasSwitch(switches::kEnableSSLCachedInfo)) |
292 net::SSLConfigService::EnableCachedInfo(); | 292 net::SSLConfigService::EnableCachedInfo(); |
293 | 293 |
294 // TODO(abarth): Should this move to InitializeNetworkOptions? This doesn't | 294 // TODO(abarth): Should this move to InitializeNetworkOptions? This doesn't |
295 // seem dependent on SSL initialization(). | 295 // seem dependent on SSL initialization(). |
296 if (parsed_command_line_.HasSwitch(switches::kEnableTcpFastOpen)) | 296 if (parsed_command_line_.HasSwitch(switches::kEnableTcpFastOpen)) |
297 net::set_tcp_fastopen_enabled(true); | 297 net::set_tcp_fastopen_enabled(true); |
298 | 298 |
299 #if !defined(OS_IOS) | |
299 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) { | 300 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) { |
300 std::string limit_string = parsed_command_line_.GetSwitchValueASCII( | 301 std::string limit_string = parsed_command_line_.GetSwitchValueASCII( |
301 switches::kRendererProcessLimit); | 302 switches::kRendererProcessLimit); |
302 size_t process_limit; | 303 size_t process_limit; |
303 if (base::StringToSizeT(limit_string, &process_limit)) { | 304 if (base::StringToSizeT(limit_string, &process_limit)) { |
304 content::RenderProcessHost::SetMaxRendererProcessCount(process_limit); | 305 content::RenderProcessHost::SetMaxRendererProcessCount(process_limit); |
305 } | 306 } |
306 } | 307 } |
308 #endif // !defined(OS_IOS) | |
307 | 309 |
308 if (parts_.get()) | 310 if (parts_.get()) |
309 parts_->PostEarlyInitialization(); | 311 parts_->PostEarlyInitialization(); |
310 } | 312 } |
311 | 313 |
312 void BrowserMainLoop::MainMessageLoopStart() { | 314 void BrowserMainLoop::MainMessageLoopStart() { |
313 if (parts_.get()) | 315 if (parts_.get()) |
314 parts_->PreMainMessageLoopStart(); | 316 parts_->PreMainMessageLoopStart(); |
315 | 317 |
316 #if defined(OS_WIN) | 318 #if defined(OS_WIN) |
317 // If we're running tests (ui_task is non-null), then the ResourceBundle | 319 // If we're running tests (ui_task is non-null), then the ResourceBundle |
318 // has already been initialized. | 320 // has already been initialized. |
319 if (!parameters_.ui_task) { | 321 if (!parameters_.ui_task) { |
320 // Override the configured locale with the user's preferred UI language. | 322 // Override the configured locale with the user's preferred UI language. |
321 l10n_util::OverrideLocaleWithUILanguageList(); | 323 l10n_util::OverrideLocaleWithUILanguageList(); |
322 } | 324 } |
323 #endif | 325 #endif |
324 | 326 |
325 // Create a MessageLoop if one does not already exist for the current thread. | 327 // Create a MessageLoop if one does not already exist for the current thread. |
326 if (!MessageLoop::current()) | 328 if (!MessageLoop::current()) |
327 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 329 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
328 | 330 |
329 InitializeMainThread(); | 331 InitializeMainThread(); |
330 | 332 |
333 system_monitor_.reset(new base::SystemMonitor); | |
334 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | |
335 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | |
336 audio_manager_.reset(media::AudioManager::Create()); | |
337 #if !defined(OS_IOS) | |
jam
2012/09/06 16:25:45
nit: blank line before this for readability
leng
2012/09/06 16:29:42
Done.
| |
331 // Start tracing to a file if needed. | 338 // Start tracing to a file if needed. |
332 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { | 339 if (base::debug::TraceLog::GetInstance()->IsEnabled()) { |
333 TraceControllerImpl::GetInstance()->InitStartupTracing( | 340 TraceControllerImpl::GetInstance()->InitStartupTracing( |
334 parsed_command_line_); | 341 parsed_command_line_); |
335 } | 342 } |
336 | 343 |
337 system_monitor_.reset(new base::SystemMonitor); | |
338 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | |
339 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | |
340 audio_manager_.reset(media::AudioManager::Create()); | |
341 online_state_observer_.reset(new BrowserOnlineStateObserver); | 344 online_state_observer_.reset(new BrowserOnlineStateObserver); |
342 scoped_refptr<media_stream::AudioInputDeviceManager> | 345 scoped_refptr<media_stream::AudioInputDeviceManager> |
343 audio_input_device_manager( | 346 audio_input_device_manager( |
344 new media_stream::AudioInputDeviceManager(audio_manager_.get())); | 347 new media_stream::AudioInputDeviceManager(audio_manager_.get())); |
345 scoped_refptr<media_stream::VideoCaptureManager> video_capture_manager( | 348 scoped_refptr<media_stream::VideoCaptureManager> video_capture_manager( |
346 new media_stream::VideoCaptureManager()); | 349 new media_stream::VideoCaptureManager()); |
347 media_stream_manager_.reset(new media_stream::MediaStreamManager( | 350 media_stream_manager_.reset(new media_stream::MediaStreamManager( |
348 audio_input_device_manager, video_capture_manager)); | 351 audio_input_device_manager, video_capture_manager)); |
349 | 352 |
350 #if defined(OS_WIN) | |
351 system_message_window_.reset(new SystemMessageWindowWin); | |
352 #endif | |
353 | |
354 // Prior to any processing happening on the io thread, we create the | 353 // Prior to any processing happening on the io thread, we create the |
355 // plugin service as it is predominantly used from the io thread, | 354 // plugin service as it is predominantly used from the io thread, |
356 // but must be created on the main thread. The service ctor is | 355 // but must be created on the main thread. The service ctor is |
357 // inexpensive and does not invoke the io_thread() accessor. | 356 // inexpensive and does not invoke the io_thread() accessor. |
358 PluginService::GetInstance()->Init(); | 357 PluginService::GetInstance()->Init(); |
358 #endif // !defined(OS_IOS) | |
359 | |
360 #if defined(OS_WIN) | |
361 system_message_window_.reset(new SystemMessageWindowWin); | |
362 #endif | |
359 | 363 |
360 if (parts_.get()) | 364 if (parts_.get()) |
361 parts_->PostMainMessageLoopStart(); | 365 parts_->PostMainMessageLoopStart(); |
362 } | 366 } |
363 | 367 |
364 void BrowserMainLoop::CreateThreads() { | 368 void BrowserMainLoop::CreateThreads() { |
365 if (parts_.get()) | 369 if (parts_.get()) |
366 result_code_ = parts_->PreCreateThreads(); | 370 result_code_ = parts_->PreCreateThreads(); |
367 | 371 |
368 if (result_code_ > 0) | 372 if (result_code_ > 0) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 case BrowserThread::UI: | 425 case BrowserThread::UI: |
422 case BrowserThread::ID_COUNT: | 426 case BrowserThread::ID_COUNT: |
423 default: | 427 default: |
424 NOTREACHED(); | 428 NOTREACHED(); |
425 break; | 429 break; |
426 } | 430 } |
427 | 431 |
428 BrowserThread::ID id = static_cast<BrowserThread::ID>(thread_id); | 432 BrowserThread::ID id = static_cast<BrowserThread::ID>(thread_id); |
429 | 433 |
430 if (thread_id == BrowserThread::WEBKIT_DEPRECATED) { | 434 if (thread_id == BrowserThread::WEBKIT_DEPRECATED) { |
435 #if !defined(OS_IOS) | |
431 webkit_thread_.reset(new WebKitThread); | 436 webkit_thread_.reset(new WebKitThread); |
432 webkit_thread_->Initialize(); | 437 webkit_thread_->Initialize(); |
438 #endif | |
433 } else if (thread_to_start) { | 439 } else if (thread_to_start) { |
434 (*thread_to_start).reset(new BrowserProcessSubThread(id)); | 440 (*thread_to_start).reset(new BrowserProcessSubThread(id)); |
435 (*thread_to_start)->StartWithOptions(*options); | 441 (*thread_to_start)->StartWithOptions(*options); |
436 } else { | 442 } else { |
437 NOTREACHED(); | 443 NOTREACHED(); |
438 } | 444 } |
439 } | 445 } |
440 | 446 |
441 BrowserThreadsStarted(); | 447 BrowserThreadsStarted(); |
442 | 448 |
443 if (parts_.get()) | 449 if (parts_.get()) |
444 parts_->PreMainMessageLoopRun(); | 450 parts_->PreMainMessageLoopRun(); |
445 | 451 |
452 #if !defined(OS_IOS) | |
446 // When running the GPU thread in-process, avoid optimistically starting it | 453 // When running the GPU thread in-process, avoid optimistically starting it |
447 // since creating the GPU thread races against creation of the one-and-only | 454 // since creating the GPU thread races against creation of the one-and-only |
448 // ChildProcess instance which is created by the renderer thread. | 455 // ChildProcess instance which is created by the renderer thread. |
449 GpuDataManager* gpu_data_manager = content::GpuDataManager::GetInstance(); | 456 GpuDataManager* gpu_data_manager = content::GpuDataManager::GetInstance(); |
450 if (gpu_data_manager->GpuAccessAllowed() && | 457 if (gpu_data_manager->GpuAccessAllowed() && |
451 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && | 458 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && |
452 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && | 459 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && |
453 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { | 460 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { |
454 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); | 461 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); |
455 BrowserThread::PostTask( | 462 BrowserThread::PostTask( |
456 BrowserThread::IO, FROM_HERE, base::Bind( | 463 BrowserThread::IO, FROM_HERE, base::Bind( |
457 base::IgnoreResult(&GpuProcessHost::Get), | 464 base::IgnoreResult(&GpuProcessHost::Get), |
458 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 465 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
459 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); | 466 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); |
460 } | 467 } |
468 #endif // !defined(OS_IOS) | |
461 | 469 |
462 // If the UI thread blocks, the whole UI is unresponsive. | 470 // If the UI thread blocks, the whole UI is unresponsive. |
463 // Do not allow disk IO from the UI thread. | 471 // Do not allow disk IO from the UI thread. |
464 base::ThreadRestrictions::SetIOAllowed(false); | 472 base::ThreadRestrictions::SetIOAllowed(false); |
465 base::ThreadRestrictions::DisallowWaiting(); | 473 base::ThreadRestrictions::DisallowWaiting(); |
466 } | 474 } |
467 | 475 |
468 void BrowserMainLoop::RunMainMessageLoopParts() { | 476 void BrowserMainLoop::RunMainMessageLoopParts() { |
469 TRACE_EVENT_BEGIN_ETW("BrowserMain:MESSAGE_LOOP", 0, ""); | 477 TRACE_EVENT_BEGIN_ETW("BrowserMain:MESSAGE_LOOP", 0, ""); |
470 | 478 |
(...skipping 12 matching lines...) Expand all Loading... | |
483 // need to be able to perform IO. | 491 // need to be able to perform IO. |
484 base::ThreadRestrictions::SetIOAllowed(true); | 492 base::ThreadRestrictions::SetIOAllowed(true); |
485 BrowserThread::PostTask( | 493 BrowserThread::PostTask( |
486 BrowserThread::IO, FROM_HERE, | 494 BrowserThread::IO, FROM_HERE, |
487 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | 495 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), |
488 true)); | 496 true)); |
489 | 497 |
490 if (parts_.get()) | 498 if (parts_.get()) |
491 parts_->PostMainMessageLoopRun(); | 499 parts_->PostMainMessageLoopRun(); |
492 | 500 |
501 #if !defined(OS_IOS) | |
493 // Destroying the GpuProcessHostUIShims on the UI thread posts a task to | 502 // Destroying the GpuProcessHostUIShims on the UI thread posts a task to |
494 // delete related objects on the GPU thread. This must be done before | 503 // delete related objects on the GPU thread. This must be done before |
495 // stopping the GPU thread. The GPU thread will close IPC channels to renderer | 504 // stopping the GPU thread. The GPU thread will close IPC channels to renderer |
496 // processes so this has to happen before stopping the IO thread. | 505 // processes so this has to happen before stopping the IO thread. |
497 GpuProcessHostUIShim::DestroyAll(); | 506 GpuProcessHostUIShim::DestroyAll(); |
498 | 507 |
499 // Cancel pending requests and prevent new requests. | 508 // Cancel pending requests and prevent new requests. |
500 if (resource_dispatcher_host_.get()) | 509 if (resource_dispatcher_host_.get()) |
501 resource_dispatcher_host_.get()->Shutdown(); | 510 resource_dispatcher_host_.get()->Shutdown(); |
502 | 511 |
503 #if defined(USE_AURA) | 512 #if defined(USE_AURA) |
504 ImageTransportFactory::Terminate(); | 513 ImageTransportFactory::Terminate(); |
505 #endif | 514 #endif |
506 BrowserGpuChannelHostFactory::Terminate(); | 515 BrowserGpuChannelHostFactory::Terminate(); |
507 | 516 |
508 GamepadService::GetInstance()->Terminate(); | 517 GamepadService::GetInstance()->Terminate(); |
509 | 518 |
510 // The device monitors are using |system_monitor_| as dependency, so delete | 519 // The device monitors are using |system_monitor_| as dependency, so delete |
511 // them before |system_monitor_| goes away. | 520 // them before |system_monitor_| goes away. |
512 // On Mac and windows, the monitor needs to be destroyed on the same thread | 521 // On Mac and windows, the monitor needs to be destroyed on the same thread |
513 // as they were created. On Linux, the monitor will be deleted when IO thread | 522 // as they were created. On Linux, the monitor will be deleted when IO thread |
514 // goes away. | 523 // goes away. |
515 #if defined(OS_WIN) | 524 #if defined(OS_WIN) |
516 system_message_window_.reset(); | 525 system_message_window_.reset(); |
517 #elif defined(OS_MACOSX) | 526 #elif defined(OS_MACOSX) |
518 device_monitor_mac_.reset(); | 527 device_monitor_mac_.reset(); |
519 #endif | 528 #endif |
529 #endif // !defined(OS_IOS) | |
520 | 530 |
521 // Must be size_t so we can subtract from it. | 531 // Must be size_t so we can subtract from it. |
522 for (size_t thread_id = BrowserThread::ID_COUNT - 1; | 532 for (size_t thread_id = BrowserThread::ID_COUNT - 1; |
523 thread_id >= (BrowserThread::UI + 1); | 533 thread_id >= (BrowserThread::UI + 1); |
524 --thread_id) { | 534 --thread_id) { |
525 // Find the thread object we want to stop. Looping over all valid | 535 // Find the thread object we want to stop. Looping over all valid |
526 // BrowserThread IDs and DCHECKing on a missing case in the switch | 536 // BrowserThread IDs and DCHECKing on a missing case in the switch |
527 // statement helps avoid a mismatch between this code and the | 537 // statement helps avoid a mismatch between this code and the |
528 // BrowserThread::ID enumeration. | 538 // BrowserThread::ID enumeration. |
529 // | 539 // |
(...skipping 27 matching lines...) Expand all Loading... | |
557 // Need to destroy ResourceDispatcherHost before PluginService | 567 // Need to destroy ResourceDispatcherHost before PluginService |
558 // and since it caches a pointer to it. | 568 // and since it caches a pointer to it. |
559 resource_dispatcher_host_.reset(); | 569 resource_dispatcher_host_.reset(); |
560 break; | 570 break; |
561 case BrowserThread::FILE_USER_BLOCKING: | 571 case BrowserThread::FILE_USER_BLOCKING: |
562 thread_to_stop = &file_user_blocking_thread_; | 572 thread_to_stop = &file_user_blocking_thread_; |
563 break; | 573 break; |
564 case BrowserThread::FILE: | 574 case BrowserThread::FILE: |
565 thread_to_stop = &file_thread_; | 575 thread_to_stop = &file_thread_; |
566 | 576 |
577 #if !defined(OS_IOS) | |
567 // Clean up state that lives on or uses the file_thread_ before | 578 // Clean up state that lives on or uses the file_thread_ before |
568 // it goes away. | 579 // it goes away. |
569 if (resource_dispatcher_host_.get()) { | 580 if (resource_dispatcher_host_.get()) { |
570 resource_dispatcher_host_.get()->download_file_manager()->Shutdown(); | 581 resource_dispatcher_host_.get()->download_file_manager()->Shutdown(); |
571 resource_dispatcher_host_.get()->save_file_manager()->Shutdown(); | 582 resource_dispatcher_host_.get()->save_file_manager()->Shutdown(); |
572 } | 583 } |
584 #endif // !defined(OS_IOS) | |
573 break; | 585 break; |
574 case BrowserThread::PROCESS_LAUNCHER: | 586 case BrowserThread::PROCESS_LAUNCHER: |
575 thread_to_stop = &process_launcher_thread_; | 587 thread_to_stop = &process_launcher_thread_; |
576 break; | 588 break; |
577 case BrowserThread::CACHE: | 589 case BrowserThread::CACHE: |
578 thread_to_stop = &cache_thread_; | 590 thread_to_stop = &cache_thread_; |
579 break; | 591 break; |
580 case BrowserThread::IO: | 592 case BrowserThread::IO: |
581 thread_to_stop = &io_thread_; | 593 thread_to_stop = &io_thread_; |
582 break; | 594 break; |
583 case BrowserThread::UI: | 595 case BrowserThread::UI: |
584 case BrowserThread::ID_COUNT: | 596 case BrowserThread::ID_COUNT: |
585 default: | 597 default: |
586 NOTREACHED(); | 598 NOTREACHED(); |
587 break; | 599 break; |
588 } | 600 } |
589 | 601 |
590 BrowserThread::ID id = static_cast<BrowserThread::ID>(thread_id); | 602 BrowserThread::ID id = static_cast<BrowserThread::ID>(thread_id); |
591 | 603 |
592 if (id == BrowserThread::WEBKIT_DEPRECATED) { | 604 if (id == BrowserThread::WEBKIT_DEPRECATED) { |
605 #if !defined(OS_IOS) | |
593 webkit_thread_.reset(); | 606 webkit_thread_.reset(); |
607 #endif | |
594 } else if (thread_to_stop) { | 608 } else if (thread_to_stop) { |
595 thread_to_stop->reset(); | 609 thread_to_stop->reset(); |
596 } else { | 610 } else { |
597 NOTREACHED(); | 611 NOTREACHED(); |
598 } | 612 } |
599 } | 613 } |
600 | 614 |
601 // Close the blocking I/O pool after the other threads. Other threads such | 615 // Close the blocking I/O pool after the other threads. Other threads such |
602 // as the I/O thread may need to schedule work like closing files or flushing | 616 // as the I/O thread may need to schedule work like closing files or flushing |
603 // data during shutdown, so the blocking pool needs to be available. There | 617 // data during shutdown, so the blocking pool needs to be available. There |
(...skipping 12 matching lines...) Expand all Loading... | |
616 if (main_message_loop_.get()) | 630 if (main_message_loop_.get()) |
617 main_message_loop_->set_thread_name(kThreadName); | 631 main_message_loop_->set_thread_name(kThreadName); |
618 | 632 |
619 // Register the main thread by instantiating it, but don't call any methods. | 633 // Register the main thread by instantiating it, but don't call any methods. |
620 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, | 634 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, |
621 MessageLoop::current())); | 635 MessageLoop::current())); |
622 } | 636 } |
623 | 637 |
624 | 638 |
625 void BrowserMainLoop::BrowserThreadsStarted() { | 639 void BrowserMainLoop::BrowserThreadsStarted() { |
640 #if !defined(OS_IOS) | |
626 HistogramSynchronizer::GetInstance(); | 641 HistogramSynchronizer::GetInstance(); |
627 | 642 |
628 content::BrowserGpuChannelHostFactory::Initialize(); | 643 content::BrowserGpuChannelHostFactory::Initialize(); |
629 #if defined(USE_AURA) | 644 #if defined(USE_AURA) |
630 ImageTransportFactory::Initialize(); | 645 ImageTransportFactory::Initialize(); |
631 #endif | 646 #endif |
632 | 647 |
633 #if defined(OS_LINUX) | 648 #if defined(OS_LINUX) |
634 device_monitor_linux_.reset(new DeviceMonitorLinux()); | 649 device_monitor_linux_.reset(new DeviceMonitorLinux()); |
635 #elif defined(OS_MACOSX) | 650 #elif defined(OS_MACOSX) |
636 device_monitor_mac_.reset(new DeviceMonitorMac()); | 651 device_monitor_mac_.reset(new DeviceMonitorMac()); |
637 #endif | 652 #endif |
638 | 653 |
639 // RDH needs the IO thread to be created. | 654 // RDH needs the IO thread to be created. |
640 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl()); | 655 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl()); |
641 | 656 |
657 // Start the GpuDataManager before we set up the MessageLoops because | |
658 // otherwise we'll trigger the assertion about doing IO on the UI thread. | |
659 content::GpuDataManager::GetInstance(); | |
660 #endif // !OS_IOS | |
661 | |
642 #if defined(ENABLE_INPUT_SPEECH) | 662 #if defined(ENABLE_INPUT_SPEECH) |
643 speech_recognition_manager_.reset(new speech::SpeechRecognitionManagerImpl()); | 663 speech_recognition_manager_.reset(new speech::SpeechRecognitionManagerImpl()); |
644 #endif | 664 #endif |
645 | |
646 // Start the GpuDataManager before we set up the MessageLoops because | |
647 // otherwise we'll trigger the assertion about doing IO on the UI thread. | |
648 content::GpuDataManager::GetInstance(); | |
649 } | 665 } |
650 | 666 |
651 void BrowserMainLoop::InitializeToolkit() { | 667 void BrowserMainLoop::InitializeToolkit() { |
652 // TODO(evan): this function is rather subtle, due to the variety | 668 // TODO(evan): this function is rather subtle, due to the variety |
653 // of intersecting ifdefs we have. To keep it easy to follow, there | 669 // of intersecting ifdefs we have. To keep it easy to follow, there |
654 // are no #else branches on any #ifs. | 670 // are no #else branches on any #ifs. |
655 // TODO(stevenjb): Move platform specific code into platform specific Parts | 671 // TODO(stevenjb): Move platform specific code into platform specific Parts |
656 // (Need to add InitializeToolkit stage to BrowserParts). | 672 // (Need to add InitializeToolkit stage to BrowserParts). |
657 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 673 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
658 // Glib type system initialization. Needed at least for gconf, | 674 // Glib type system initialization. Needed at least for gconf, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
696 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 712 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
697 if (parameters_.ui_task) | 713 if (parameters_.ui_task) |
698 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 714 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
699 | 715 |
700 base::RunLoop run_loop; | 716 base::RunLoop run_loop; |
701 run_loop.Run(); | 717 run_loop.Run(); |
702 #endif | 718 #endif |
703 } | 719 } |
704 | 720 |
705 } // namespace content | 721 } // namespace content |
OLD | NEW |