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

Side by Side Diff: mojo/shell/app_child_process.cc

Issue 231353002: Make mojo_system static and mojo_system_impl a component, never use both (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/shell/app_child_process.h" 5 #include "mojo/shell/app_child_process.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // Should be created and initialized on the main thread. 85 // Should be created and initialized on the main thread.
86 class AppContext { 86 class AppContext {
87 public: 87 public:
88 AppContext() 88 AppContext()
89 : io_thread_("io_thread"), 89 : io_thread_("io_thread"),
90 controller_thread_("controller_thread") {} 90 controller_thread_("controller_thread") {}
91 ~AppContext() {} 91 ~AppContext() {}
92 92
93 void Init() { 93 void Init() {
94 // Initialize Mojo before starting any threads.
95 embedder::Init();
96
97 // Create and start our I/O thread. 94 // Create and start our I/O thread.
98 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); 95 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0);
99 CHECK(io_thread_.StartWithOptions(io_thread_options)); 96 CHECK(io_thread_.StartWithOptions(io_thread_options));
100 io_runner_ = io_thread_.message_loop_proxy().get(); 97 io_runner_ = io_thread_.message_loop_proxy().get();
101 CHECK(io_runner_); 98 CHECK(io_runner_);
102 99
103 // Create and start our controller thread. 100 // Create and start our controller thread.
104 base::Thread::Options controller_thread_options; 101 base::Thread::Options controller_thread_options;
105 controller_thread_options.message_loop_type = 102 controller_thread_options.message_loop_type =
106 base::MessageLoop::TYPE_CUSTOM; 103 base::MessageLoop::TYPE_CUSTOM;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 blocker.Block(); 290 blocker.Block();
294 291
295 app_context.controller_runner()->PostTask( 292 app_context.controller_runner()->PostTask(
296 FROM_HERE, 293 FROM_HERE,
297 base::Bind(&AppChildControllerImpl::Shutdown, 294 base::Bind(&AppChildControllerImpl::Shutdown,
298 base::Unretained(app_context.controller()))); 295 base::Unretained(app_context.controller())));
299 } 296 }
300 297
301 } // namespace shell 298 } // namespace shell
302 } // namespace mojo 299 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698