OLD | NEW |
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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ipc/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
10 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" | |
11 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 10 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
12 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h" | |
13 | 11 |
14 namespace content { | 12 namespace content { |
15 | 13 |
16 namespace { | 14 namespace { |
17 | 15 |
18 class MojoInitializer { | 16 class MojoInitializer { |
19 public: | 17 public: |
20 MojoInitializer() { | 18 MojoInitializer() { |
21 mojo::embedder::GetConfiguration()->max_message_num_bytes = | 19 mojo::embedder::SetMaxMessageSize(IPC::Channel::kMaximumMessageSize); |
22 IPC::Channel::kMaximumMessageSize; | 20 mojo::embedder::Init(); |
23 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( | |
24 new mojo::embedder::SimplePlatformSupport())); | |
25 } | 21 } |
26 }; | 22 }; |
27 | 23 |
28 base::LazyInstance<MojoInitializer>::Leaky mojo_initializer; | 24 base::LazyInstance<MojoInitializer>::Leaky mojo_initializer; |
29 | 25 |
30 } // namespace | 26 } // namespace |
31 | 27 |
32 void InitializeMojo() { | 28 void InitializeMojo() { |
33 mojo_initializer.Get(); | 29 mojo_initializer.Get(); |
34 } | 30 } |
35 | 31 |
36 } // namespace content | 32 } // namespace content |
OLD | NEW |