Home | History | Annotate | Download | only in embedder
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef MOJO_CORE_EMBEDDER_CONFIGURATION_H_
      6 #define MOJO_CORE_EMBEDDER_CONFIGURATION_H_
      7 
      8 #include <stddef.h>
      9 #include <stdint.h>
     10 
     11 namespace mojo {
     12 namespace core {
     13 
     14 // A set of configuration parameters that the Mojo system uses internally. The
     15 // configuration used can be overridden from the default by passing a
     16 // Configuration into |mojo::core::Init()|. See embedder.h.
     17 //
     18 // NOTE: Please ensure that this type remains a simple aggregate of POD fields.
     19 struct Configuration {
     20   // Indicates whether this process should act as the sole broker process within
     21   // its graph of interconnected Mojo-embedder processes. This setting is only
     22   // relevant in multiprocess environments.
     23   bool is_broker_process = false;
     24 
     25   // If |true|, this process will always attempt to allocate shared memory
     26   // directly rather than synchronously delegating to a broker process where
     27   // applicable.
     28   //
     29   // This is useful to set in processes which are not acting as the broker but
     30   // which are otherwise sufficiently privileged to allocate named shared memory
     31   // objects.
     32   bool force_direct_shared_memory_allocation = false;
     33 
     34   // Maximum number of active memory mappings.
     35   size_t max_mapping_table_size = 1000000;
     36 
     37   // Maximum data size of messages sent over message pipes, in bytes.
     38   size_t max_message_num_bytes = 256 * 1024 * 1024;
     39 
     40   // Maximum size of a single shared memory segment, in bytes.
     41   size_t max_shared_memory_num_bytes = 1024 * 1024 * 1024;
     42 };
     43 
     44 }  // namespace core
     45 }  // namespace mojo
     46 
     47 #endif  // MOJO_CORE_EMBEDDER_CONFIGURATION_H_
     48