Commit 0b39ee9e authored by sadrul's avatar sadrul Committed by Commit bot

mojo: Use TYPE_DEFAULT message-loop for browser-tests.

Use TYPE_DEFAULT message-loop for browser-tests, since that's what
mojo_runner uses by default. We would normally use TYPE_DEFAULT
message-loops for chrome --mash too, but keep using TYPE_UI for now,
since mojo:ui needs that, and it is not known whether mojo:ui will be
run at the type of the message-loop creation.

Also, remove references to MessagePumpMojo since that has been removed.

BUG=none
TBR=jam@ for base/threading/

Review-Url: https://codereview.chromium.org/2351603002
Cr-Commit-Position: refs/heads/master@{#419486}
parent f1c70e45
...@@ -54,9 +54,6 @@ namespace gpu { ...@@ -54,9 +54,6 @@ namespace gpu {
class GpuChannelHost; class GpuChannelHost;
} }
namespace mojo { namespace mojo {
namespace common {
class MessagePumpMojo;
}
class SyncCallRestrictions; class SyncCallRestrictions;
} }
namespace ui { namespace ui {
...@@ -208,7 +205,6 @@ class BASE_EXPORT ThreadRestrictions { ...@@ -208,7 +205,6 @@ class BASE_EXPORT ThreadRestrictions {
friend class ThreadTestHelper; friend class ThreadTestHelper;
friend class PlatformThread; friend class PlatformThread;
friend class android::JavaHandlerThread; friend class android::JavaHandlerThread;
friend class mojo::common::MessagePumpMojo;
friend class mojo::SyncCallRestrictions; friend class mojo::SyncCallRestrictions;
friend class ui::CommandBufferClientImpl; friend class ui::CommandBufferClientImpl;
friend class ui::CommandBufferLocal; friend class ui::CommandBufferLocal;
......
...@@ -126,7 +126,10 @@ void MashRunner::RunChild() { ...@@ -126,7 +126,10 @@ void MashRunner::RunChild() {
void MashRunner::StartChildApp( void MashRunner::StartChildApp(
shell::mojom::ServiceRequest service_request) { shell::mojom::ServiceRequest service_request) {
// TODO(sky): use MessagePumpMojo. // TODO(sad): Normally, this would be a TYPE_DEFAULT message loop. However,
// TYPE_UI is needed for mojo:ui. But it is not known whether the child app is
// going to be mojo:ui at this point. So always create a TYPE_UI message loop
// for now.
base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); base::MessageLoop message_loop(base::MessageLoop::TYPE_UI);
service_.reset(new mash::MashPackagedService); service_.reset(new mash::MashPackagedService);
service_->set_context(base::MakeUnique<shell::ServiceContext>( service_->set_context(base::MakeUnique<shell::ServiceContext>(
...@@ -148,7 +151,6 @@ int MashMain() { ...@@ -148,7 +151,6 @@ int MashMain() {
true, // Timestamp true, // Timestamp
true); // Tick count true); // Tick count
// TODO(sky): use MessagePumpMojo.
std::unique_ptr<base::MessageLoop> message_loop; std::unique_ptr<base::MessageLoop> message_loop;
#if defined(OS_LINUX) #if defined(OS_LINUX)
base::AtExitManager exit_manager; base::AtExitManager exit_manager;
......
...@@ -121,7 +121,7 @@ std::unique_ptr<content::MojoShellConnection> CreateMojoShellConnection( ...@@ -121,7 +121,7 @@ std::unique_ptr<content::MojoShellConnection> CreateMojoShellConnection(
} }
void StartChildApp(shell::mojom::ServiceRequest service_request) { void StartChildApp(shell::mojom::ServiceRequest service_request) {
base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); base::MessageLoop message_loop(base::MessageLoop::TYPE_DEFAULT);
base::RunLoop run_loop; base::RunLoop run_loop;
mash::MashPackagedService service; mash::MashPackagedService service;
std::unique_ptr<shell::ServiceContext> context = std::unique_ptr<shell::ServiceContext> context =
......
...@@ -61,8 +61,7 @@ class ServiceRunner { ...@@ -61,8 +61,7 @@ class ServiceRunner {
private: private:
std::unique_ptr<Service> service_; std::unique_ptr<Service> service_;
// MessageLoop type. TYPE_CUSTOM is default (MessagePumpMojo will be used as // MessageLoop type. Default is TYPE_DEFAULT.
// the underlying message pump).
base::MessageLoop::Type message_loop_type_; base::MessageLoop::Type message_loop_type_;
// Whether Run() has been called. // Whether Run() has been called.
bool has_run_; bool has_run_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment