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