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

Unified Diff: mojo/system/data_pipe.cc

Issue 320343002: Mojo: Make default Options directly accessible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/system/data_pipe.h ('k') | mojo/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/data_pipe.cc
diff --git a/mojo/system/data_pipe.cc b/mojo/system/data_pipe.cc
index 226c381aa8d05a9463c5a7e177f7f318fca8b122..7f05c04236fad06d573bf178110042b59666d783 100644
--- a/mojo/system/data_pipe.cc
+++ b/mojo/system/data_pipe.cc
@@ -20,19 +20,21 @@ namespace mojo {
namespace system {
// static
+const MojoCreateDataPipeOptions DataPipe::kDefaultCreateOptions = {
+ static_cast<uint32_t>(sizeof(MojoCreateDataPipeOptions)),
+ MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
+ 1u,
+ static_cast<uint32_t>(kDefaultDataPipeCapacityBytes)
+};
+
+// static
MojoResult DataPipe::ValidateCreateOptions(
const MojoCreateDataPipeOptions* in_options,
MojoCreateDataPipeOptions* out_options) {
const MojoCreateDataPipeOptionsFlags kKnownFlags =
MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD;
- static const MojoCreateDataPipeOptions kDefaultOptions = {
- static_cast<uint32_t>(sizeof(MojoCreateDataPipeOptions)),
- MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
- 1u,
- static_cast<uint32_t>(kDefaultDataPipeCapacityBytes)
- };
-
- *out_options = kDefaultOptions;
+
+ *out_options = kDefaultCreateOptions;
if (!in_options)
return MOJO_RESULT_OK;
« no previous file with comments | « mojo/system/data_pipe.h ('k') | mojo/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698