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

Side by Side Diff: content/app/mojo/mojo_init.cc

Issue 1465183005: Rename mojo::TokenSerializer to mojo::Broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win component Created 5 years 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 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 "content/app/mojo/mojo_init.h" 5 #include "content/app/mojo/mojo_init.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
11 #include "ipc/ipc_channel.h" 11 #include "ipc/ipc_channel.h"
12 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" 12 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 namespace { 16 namespace {
17 17
18 class MojoInitializer { 18 class MojoInitializer {
19 public: 19 public:
20 MojoInitializer() { 20 MojoInitializer() {
21 #if defined(OS_WIN)
22 const base::CommandLine& command_line = 21 const base::CommandLine& command_line =
23 *base::CommandLine::ForCurrentProcess(); 22 *base::CommandLine::ForCurrentProcess();
24 if (command_line.HasSwitch("use-new-edk")) { 23 if (command_line.HasSwitch("use-new-edk")) {
25 std::string process_type = 24 std::string process_type =
26 command_line.GetSwitchValueASCII(switches::kProcessType); 25 command_line.GetSwitchValueASCII(switches::kProcessType);
27 if (process_type.empty()) { 26 if (process_type.empty()) {
28 mojo::embedder::PreInitializeParentProcess(); 27 mojo::embedder::PreInitializeParentProcess();
29 } else { 28 } else {
30 mojo::embedder::PreInitializeChildProcess(); 29 mojo::embedder::PreInitializeChildProcess();
31 } 30 }
32 } 31 }
33 #endif
34 32
35 mojo::embedder::SetMaxMessageSize(IPC::Channel::kMaximumMessageSize); 33 mojo::embedder::SetMaxMessageSize(IPC::Channel::kMaximumMessageSize);
36 mojo::embedder::Init(); 34 mojo::embedder::Init();
37 } 35 }
38 }; 36 };
39 37
40 base::LazyInstance<MojoInitializer>::Leaky mojo_initializer; 38 base::LazyInstance<MojoInitializer>::Leaky mojo_initializer;
41 39
42 } // namespace 40 } // namespace
43 41
44 void InitializeMojo() { 42 void InitializeMojo() {
45 mojo_initializer.Get(); 43 mojo_initializer.Get();
46 } 44 }
47 45
48 } // namespace content 46 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/browser_child_process_host_impl.cc » ('j') | mojo/edk/system/child_broker.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698