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

Side by Side Diff: components/nacl/loader/nacl_main.cc

Issue 2617713002: [WIP] Add DCHECK for mojo::edk::Init().
Patch Set: test Created 3 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <utility> 5 #include <utility>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/power_monitor/power_monitor.h" 9 #include "base/power_monitor/power_monitor.h"
10 #include "base/power_monitor/power_monitor_device_source.h" 10 #include "base/power_monitor/power_monitor_device_source.h"
11 #include "base/timer/hi_res_timer_manager.h" 11 #include "base/timer/hi_res_timer_manager.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "components/nacl/loader/nacl_listener.h" 13 #include "components/nacl/loader/nacl_listener.h"
14 #include "components/nacl/loader/nacl_main_platform_delegate.h" 14 #include "components/nacl/loader/nacl_main_platform_delegate.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "content/public/common/main_function_params.h" 16 #include "content/public/common/main_function_params.h"
17 #include "mojo/edk/embedder/embedder.h" 17 #include "mojo/edk/embedder/embedder.h"
18 18
19 // main() routine for the NaCl loader process. 19 // main() routine for the NaCl loader process.
20 int NaClMain(const content::MainFunctionParams& parameters) { 20 int NaClMain(const content::MainFunctionParams& parameters) {
21 const base::CommandLine& parsed_command_line = parameters.command_line; 21 const base::CommandLine& parsed_command_line = parameters.command_line;
22 22
23 // The Mojo EDK must be initialized before using IPC.
24 mojo::edk::Init();
25
26 // The main thread of the plugin services IO. 23 // The main thread of the plugin services IO.
27 base::MessageLoopForIO main_message_loop; 24 base::MessageLoopForIO main_message_loop;
28 base::PlatformThread::SetName("CrNaClMain"); 25 base::PlatformThread::SetName("CrNaClMain");
29 26
30 std::unique_ptr<base::PowerMonitorSource> power_monitor_source( 27 std::unique_ptr<base::PowerMonitorSource> power_monitor_source(
31 new base::PowerMonitorDeviceSource()); 28 new base::PowerMonitorDeviceSource());
32 base::PowerMonitor power_monitor(std::move(power_monitor_source)); 29 base::PowerMonitor power_monitor(std::move(power_monitor_source));
33 base::HighResolutionTimerManager hi_res_timer_manager; 30 base::HighResolutionTimerManager hi_res_timer_manager;
34 31
35 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ 32 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
(...skipping 14 matching lines...) Expand all
50 #if defined(OS_POSIX) 47 #if defined(OS_POSIX)
51 listener.set_number_of_cores(number_of_cores); 48 listener.set_number_of_cores(number_of_cores);
52 #endif 49 #endif
53 50
54 listener.Listen(); 51 listener.Listen();
55 #else 52 #else
56 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; 53 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc.";
57 #endif 54 #endif
58 return 0; 55 return 0;
59 } 56 }
OLDNEW
« no previous file with comments | « components/nacl/loader/nacl_helper_win_64.cc ('k') | content/browser/dom_storage/local_storage_context_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698