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