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

Unified Diff: mojo/edk/system/data_pipe.h

Issue 1412183009: EDK: Stop having MojoCreateDataPipeOptions as a member of DataPipe. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | mojo/edk/system/data_pipe.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/data_pipe.h
diff --git a/mojo/edk/system/data_pipe.h b/mojo/edk/system/data_pipe.h
index 62fe5aa85bb4783816334f166f5ad78a9424a9dd..0d776687e8e11c91f419225e9379e0c2471f49bb 100644
--- a/mojo/edk/system/data_pipe.h
+++ b/mojo/edk/system/data_pipe.h
@@ -9,7 +9,6 @@
#include <memory>
-#include "base/compiler_specific.h"
#include "mojo/edk/embedder/platform_handle_vector.h"
#include "mojo/edk/system/channel_endpoint_client.h"
#include "mojo/edk/system/handle_signals_state.h"
@@ -174,15 +173,14 @@ class DataPipe final : public ChannelEndpointClient {
void ConsumerCloseNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
// Thread-safe and fast (they don't take |mutex_|):
- const MojoCreateDataPipeOptions& validated_options() const {
- return validated_options_;
- }
- size_t element_num_bytes() const {
- return validated_options_.element_num_bytes;
- }
- size_t capacity_num_bytes() const {
- return validated_options_.capacity_num_bytes;
+ MojoCreateDataPipeOptions validated_options() const {
+ MojoCreateDataPipeOptions rv = {sizeof(MojoCreateDataPipeOptions),
+ MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
+ element_num_bytes_, capacity_num_bytes_};
+ return rv;
}
+ size_t element_num_bytes() const { return element_num_bytes_; }
+ size_t capacity_num_bytes() const { return capacity_num_bytes_; }
// Must be called under |mutex_|.
bool producer_open_no_lock() const MOJO_SHARED_LOCKS_REQUIRED(mutex_) {
@@ -262,8 +260,8 @@ class DataPipe final : public ChannelEndpointClient {
return !!consumer_awakable_list_;
}
- MSVC_SUPPRESS_WARNING(4324)
- const MojoCreateDataPipeOptions validated_options_;
+ const uint32_t element_num_bytes_;
+ const uint32_t capacity_num_bytes_;
mutable util::Mutex mutex_;
// *Known* state of producer or consumer.
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698