Chromium Code Reviews| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 8 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" | 9 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" |
| 9 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 10 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| 10 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h" | 11 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 15 namespace { | |
| 16 | |
| 17 class MojoInitializer { | |
| 18 public: | |
| 19 MojoInitializer() { | |
| 20 mojo::embedder::GetConfiguration()->max_message_num_bytes = | |
| 21 64 * 1024 * 1024; | |
| 22 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( | |
| 23 new mojo::embedder::SimplePlatformSupport())); | |
| 24 } | |
| 25 }; | |
| 26 | |
| 27 base::LazyInstance<MojoInitializer> mojo_initializer; | |
|
agl
2015/01/26 20:02:47
I suspect that you want base::LazyInstance<MojoIni
| |
| 28 | |
| 29 } // namespace | |
| 30 | |
| 14 void InitializeMojo() { | 31 void InitializeMojo() { |
| 15 // Things like content_shell and DevTools ocassionally send big | 32 mojo_initializer.Get(); |
| 16 // message which includes whole rendered screen or all loaded | |
| 17 // scripts. The buffer size has to be big enough to allow such use | |
| 18 // cases. | |
| 19 mojo::embedder::GetConfiguration()->max_message_num_bytes = 64*1024*1024; | |
| 20 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( | |
| 21 new mojo::embedder::SimplePlatformSupport())); | |
| 22 } | 33 } |
| 23 | 34 |
| 24 } // namespace content | 35 } // namespace content |
| OLD | NEW |