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

Side by Side Diff: mojo/edk/system/data_pipe_producer_dispatcher.h

Issue 1403773005: Ensure that DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock serializes the… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 2 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 | mojo/edk/system/data_pipe_producer_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ 5 #ifndef MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_
6 #define MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "mojo/edk/system/awakable_list.h" 9 #include "mojo/edk/system/awakable_list.h"
10 #include "mojo/edk/system/dispatcher.h" 10 #include "mojo/edk/system/dispatcher.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // |RawChannel::Delegate methods: 79 // |RawChannel::Delegate methods:
80 void OnReadMessage( 80 void OnReadMessage(
81 const MessageInTransit::View& message_view, 81 const MessageInTransit::View& message_view,
82 ScopedPlatformHandleVectorPtr platform_handles) override; 82 ScopedPlatformHandleVectorPtr platform_handles) override;
83 void OnError(Error error) override; 83 void OnError(Error error) override;
84 84
85 bool InTwoPhaseWrite() const; 85 bool InTwoPhaseWrite() const;
86 bool WriteDataIntoMessages(const void* elements, uint32_t num_bytes); 86 bool WriteDataIntoMessages(const void* elements, uint32_t num_bytes);
87 87
88 // See comment in MessagePipeDispatcher for this method.
89 void SerializeInternal();
90
88 MojoCreateDataPipeOptions options_; 91 MojoCreateDataPipeOptions options_;
89 92
90 // Protected by |lock()|: 93 // Protected by |lock()|:
91 RawChannel* channel_; // This will be null if closed. 94 RawChannel* channel_; // This will be null if closed.
92 95
93 AwakableList awakable_list_; 96 AwakableList awakable_list_;
94 97
95 // If DispatcherTransport is created. Must be set before lock() is called to 98 // If DispatcherTransport is created. Must be set before lock() is called to
96 // avoid deadlocks with RawChannel calling us. 99 // avoid deadlocks with RawChannel calling us.
97 base::Lock started_transport_; 100 base::Lock started_transport_;
98 101
99 bool error_; 102 bool error_;
100 103
104 bool serialized_;
101 ScopedPlatformHandle serialized_platform_handle_; 105 ScopedPlatformHandle serialized_platform_handle_;
102 std::vector<char> serialized_write_buffer_; 106 std::vector<char> serialized_write_buffer_;
103 std::vector<char> two_phase_data_; 107 std::vector<char> two_phase_data_;
104 108
105 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipeProducerDispatcher); 109 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipeProducerDispatcher);
106 }; 110 };
107 111
108 } // namespace edk 112 } // namespace edk
109 } // namespace mojo 113 } // namespace mojo
110 114
111 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ 115 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698