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

Side by Side Diff: mojo/system/shared_buffer_dispatcher.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/system/data_pipe.cc ('k') | mojo/system/shared_buffer_dispatcher.cc » ('j') | 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 #ifndef MOJO_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ 5 #ifndef MOJO_SYSTEM_SHARED_BUFFER_DISPATCHER_H_
6 #define MOJO_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ 6 #define MOJO_SYSTEM_SHARED_BUFFER_DISPATCHER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "mojo/system/raw_shared_buffer.h" 9 #include "mojo/system/raw_shared_buffer.h"
10 #include "mojo/system/simple_dispatcher.h" 10 #include "mojo/system/simple_dispatcher.h"
11 #include "mojo/system/system_impl_export.h" 11 #include "mojo/system/system_impl_export.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace system { 14 namespace system {
15 15
16 // TODO(vtl): We derive from SimpleDispatcher, even though we don't currently 16 // TODO(vtl): We derive from SimpleDispatcher, even though we don't currently
17 // have anything that's waitable. I want to add a "transferrable" wait flag. 17 // have anything that's waitable. I want to add a "transferrable" wait flag.
18 class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher : public SimpleDispatcher { 18 class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher : public SimpleDispatcher {
19 public: 19 public:
20 // The default options to use for |MojoCreateSharedBuffer()|. (Real uses
21 // should obtain this via |ValidateCreateOptions()| with a null |in_options|;
22 // this is exposed directly for testing convenience.)
23 static const MojoCreateSharedBufferOptions kDefaultCreateOptions;
24
20 // Validates and/or sets default options for |MojoCreateSharedBufferOptions|. 25 // Validates and/or sets default options for |MojoCreateSharedBufferOptions|.
21 // If non-null, |in_options| must point to a struct of at least 26 // If non-null, |in_options| must point to a struct of at least
22 // |in_options->struct_size| bytes. |out_options| must point to a (current) 27 // |in_options->struct_size| bytes. |out_options| must point to a (current)
23 // |MojoCreateSharedBufferOptions| and will be entirely overwritten on success 28 // |MojoCreateSharedBufferOptions| and will be entirely overwritten on success
24 // (it may be partly overwritten on failure). 29 // (it may be partly overwritten on failure).
25 static MojoResult ValidateCreateOptions( 30 static MojoResult ValidateCreateOptions(
26 const MojoCreateSharedBufferOptions* in_options, 31 const MojoCreateSharedBufferOptions* in_options,
27 MojoCreateSharedBufferOptions* out_options); 32 MojoCreateSharedBufferOptions* out_options);
28 33
29 // Static factory method: |validated_options| must be validated (obviously). 34 // Static factory method: |validated_options| must be validated (obviously).
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 90
86 scoped_refptr<RawSharedBuffer> shared_buffer_; 91 scoped_refptr<RawSharedBuffer> shared_buffer_;
87 92
88 DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher); 93 DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher);
89 }; 94 };
90 95
91 } // namespace system 96 } // namespace system
92 } // namespace mojo 97 } // namespace mojo
93 98
94 #endif // MOJO_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ 99 #endif // MOJO_SYSTEM_SHARED_BUFFER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « mojo/system/data_pipe.cc ('k') | mojo/system/shared_buffer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698