Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: content/app/mojo/mojo_init.cc

Issue 872973003: Make InitializeMojo() idempotent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698