| 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 |
| 11 #if defined(USE_CHROME_EDK) |
| 12 #include "mojo/edk/embedder/embedder.h" |
| 13 #include "mojo/edk/embedder/simple_platform_support.h" |
| 14 #else |
| 10 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" | 15 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" |
| 11 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 16 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| 12 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h" | 17 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h" |
| 18 #endif |
| 13 | 19 |
| 14 namespace content { | 20 namespace content { |
| 15 | 21 |
| 16 namespace { | 22 namespace { |
| 17 | 23 |
| 18 class MojoInitializer { | 24 class MojoInitializer { |
| 19 public: | 25 public: |
| 20 MojoInitializer() { | 26 MojoInitializer() { |
| 27 #if defined(USE_CHROME_EDK) |
| 28 mojo::embedder::SetMaxMessageSize(IPC::Channel::kMaximumMessageSize); |
| 29 #else |
| 21 mojo::embedder::GetConfiguration()->max_message_num_bytes = | 30 mojo::embedder::GetConfiguration()->max_message_num_bytes = |
| 22 IPC::Channel::kMaximumMessageSize; | 31 IPC::Channel::kMaximumMessageSize; |
| 32 #endif |
| 23 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( | 33 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( |
| 24 new mojo::embedder::SimplePlatformSupport())); | 34 new mojo::embedder::SimplePlatformSupport())); |
| 25 } | 35 } |
| 26 }; | 36 }; |
| 27 | 37 |
| 28 base::LazyInstance<MojoInitializer>::Leaky mojo_initializer; | 38 base::LazyInstance<MojoInitializer>::Leaky mojo_initializer; |
| 29 | 39 |
| 30 } // namespace | 40 } // namespace |
| 31 | 41 |
| 32 void InitializeMojo() { | 42 void InitializeMojo() { |
| 33 mojo_initializer.Get(); | 43 mojo_initializer.Get(); |
| 34 } | 44 } |
| 35 | 45 |
| 36 } // namespace content | 46 } // namespace content |
| OLD | NEW |