Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2916823002: Move Mus into chrome's process when running with --mus.
Patch Set: Addressing most feedback, making this work on device. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 task_scheduler_init_params = GetDefaultTaskSchedulerInitParams(); 951 task_scheduler_init_params = GetDefaultTaskSchedulerInitParams();
952 DCHECK(task_scheduler_init_params); 952 DCHECK(task_scheduler_init_params);
953 base::TaskScheduler::GetInstance()->Start( 953 base::TaskScheduler::GetInstance()->Start(
954 *task_scheduler_init_params.get()); 954 *task_scheduler_init_params.get());
955 } 955 }
956 956
957 GetContentClient()->browser()->PerformExperimentalTaskSchedulerRedirections(); 957 GetContentClient()->browser()->PerformExperimentalTaskSchedulerRedirections();
958 958
959 base::Thread::Options io_message_loop_options; 959 base::Thread::Options io_message_loop_options;
960 io_message_loop_options.message_loop_type = base::MessageLoop::TYPE_IO; 960 io_message_loop_options.message_loop_type = base::MessageLoop::TYPE_IO;
961 base::Thread::Options ui_message_loop_options;
962 ui_message_loop_options.message_loop_type = base::MessageLoop::TYPE_UI;
963 961
964 const bool redirect_nonUInonIO_browser_threads = 962 const bool redirect_nonUInonIO_browser_threads =
965 GetContentClient() 963 GetContentClient()
966 ->browser() 964 ->browser()
967 ->RedirectNonUINonIOBrowserThreadsToTaskScheduler(); 965 ->RedirectNonUINonIOBrowserThreadsToTaskScheduler();
968 966
969 // Start threads in the order they occur in the BrowserThread::ID enumeration, 967 // Start threads in the order they occur in the BrowserThread::ID enumeration,
970 // except for BrowserThread::UI which is the main thread. 968 // except for BrowserThread::UI which is the main thread.
971 // 969 //
972 // Must be size_t so we can increment it. 970 // Must be size_t so we can increment it.
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 base::Unretained(coordinator))); 1605 base::Unretained(coordinator)));
1608 } 1606 }
1609 } 1607 }
1610 1608
1611 auto* swap_metrics_observer = SwapMetricsObserver::GetInstance(); 1609 auto* swap_metrics_observer = SwapMetricsObserver::GetInstance();
1612 if (swap_metrics_observer) 1610 if (swap_metrics_observer)
1613 swap_metrics_observer->Start(); 1611 swap_metrics_observer->Start();
1614 } 1612 }
1615 1613
1616 bool BrowserMainLoop::InitializeToolkit() { 1614 bool BrowserMainLoop::InitializeToolkit() {
1615 LOG(ERROR) << "BrowserMainLoop::InitializeToolkit()";
1617 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); 1616 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit");
1618 1617
1619 // TODO(evan): this function is rather subtle, due to the variety 1618 // TODO(evan): this function is rather subtle, due to the variety
1620 // of intersecting ifdefs we have. To keep it easy to follow, there 1619 // of intersecting ifdefs we have. To keep it easy to follow, there
1621 // are no #else branches on any #ifs. 1620 // are no #else branches on any #ifs.
1622 // TODO(stevenjb): Move platform specific code into platform specific Parts 1621 // TODO(stevenjb): Move platform specific code into platform specific Parts
1623 // (Need to add InitializeToolkit stage to BrowserParts). 1622 // (Need to add InitializeToolkit stage to BrowserParts).
1624 // See also GTK setup in EarlyInitialization, above, and associated comments. 1623 // See also GTK setup in EarlyInitialization, above, and associated comments.
1625 1624
1626 #if defined(OS_WIN) 1625 #if defined(OS_WIN)
1627 // Init common control sex. 1626 // Init common control sex.
1628 INITCOMMONCONTROLSEX config; 1627 INITCOMMONCONTROLSEX config;
1629 config.dwSize = sizeof(config); 1628 config.dwSize = sizeof(config);
1630 config.dwICC = ICC_WIN95_CLASSES; 1629 config.dwICC = ICC_WIN95_CLASSES;
1631 if (!InitCommonControlsEx(&config)) 1630 if (!InitCommonControlsEx(&config))
1632 PLOG(FATAL); 1631 PLOG(FATAL);
1633 #endif 1632 #endif
1634 1633
1635 #if defined(USE_AURA) 1634 #if defined(USE_AURA)
1636 1635
1637 #if defined(USE_X11) 1636 #if defined(USE_X11)
1638 if (!parsed_command_line_.HasSwitch(switches::kHeadless) && 1637 if (!parsed_command_line_.HasSwitch(switches::kHeadless) &&
1639 !gfx::GetXDisplay()) { 1638 !gfx::GetXDisplay()) {
1640 LOG(ERROR) << "Unable to open X display."; 1639 LOG(ERROR) << "Unable to open X display.";
1641 return false; 1640 return false;
1642 } 1641 }
1643 #endif 1642 #endif
1644 1643
1644 LOG(ERROR) << 1;
1645 // Env creates the compositor. Aura widgets need the compositor to be created 1645 // Env creates the compositor. Aura widgets need the compositor to be created
1646 // before they can be initialized by the browser. 1646 // before they can be initialized by the browser.
1647 env_ = aura::Env::CreateInstance(parameters_.env_mode); 1647 env_ = aura::Env::CreateInstance(parameters_.env_mode);
1648 #endif // defined(USE_AURA) 1648 #endif // defined(USE_AURA)
1649 1649
1650 if (parts_) 1650 if (parts_)
1651 parts_->ToolkitInitialized(); 1651 parts_->ToolkitInitialized();
1652 1652
1653 return true; 1653 return true;
1654 } 1654 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1770 base::MakeUnique<media::AudioThreadImpl>(), 1770 base::MakeUnique<media::AudioThreadImpl>(),
1771 MediaInternals::GetInstance()); 1771 MediaInternals::GetInstance());
1772 } 1772 }
1773 CHECK(audio_manager_); 1773 CHECK(audio_manager_);
1774 1774
1775 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1775 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1776 CHECK(audio_system_); 1776 CHECK(audio_system_);
1777 } 1777 }
1778 1778
1779 } // namespace content 1779 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698