Chromium Code Reviews| Index: content/app/mojo/mojo_init.cc |
| diff --git a/content/app/mojo/mojo_init.cc b/content/app/mojo/mojo_init.cc |
| index f2b21fa8ff492a51a6603dd75eaf7910323000df..d75346c2633cf0366a590c58e8b70cac11bee0e8 100644 |
| --- a/content/app/mojo/mojo_init.cc |
| +++ b/content/app/mojo/mojo_init.cc |
| @@ -4,6 +4,7 @@ |
| #include "content/app/mojo/mojo_init.h" |
| +#include "base/lazy_instance.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" |
| #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| @@ -11,14 +12,24 @@ |
| namespace content { |
| +namespace { |
| + |
| +class MojoInitializer { |
| + public: |
| + MojoInitializer() { |
| + mojo::embedder::GetConfiguration()->max_message_num_bytes = |
| + 64 * 1024 * 1024; |
| + mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( |
| + new mojo::embedder::SimplePlatformSupport())); |
| + } |
| +}; |
| + |
| +base::LazyInstance<MojoInitializer> mojo_initializer; |
|
agl
2015/01/26 20:02:47
I suspect that you want base::LazyInstance<MojoIni
|
| + |
| +} // namespace |
| + |
| void InitializeMojo() { |
| - // Things like content_shell and DevTools ocassionally send big |
| - // message which includes whole rendered screen or all loaded |
| - // scripts. The buffer size has to be big enough to allow such use |
| - // cases. |
| - mojo::embedder::GetConfiguration()->max_message_num_bytes = 64*1024*1024; |
| - mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( |
| - new mojo::embedder::SimplePlatformSupport())); |
| + mojo_initializer.Get(); |
| } |
| } // namespace content |