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

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

Issue 611733002: Mojo: Convert OVERRIDE -> override in mojo/{embedder,system}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « mojo/system/dispatcher_unittest.cc ('k') | mojo/system/local_message_pipe_endpoint.h » ('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_SYSTEM_LOCAL_DATA_PIPE_H_ 5 #ifndef MOJO_SYSTEM_LOCAL_DATA_PIPE_H_
6 #define MOJO_SYSTEM_LOCAL_DATA_PIPE_H_ 6 #define MOJO_SYSTEM_LOCAL_DATA_PIPE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/aligned_memory.h" 9 #include "base/memory/aligned_memory.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 12 matching lines...) Expand all
23 // |validated_options| should be the output of |DataPipe::ValidateOptions()|. 23 // |validated_options| should be the output of |DataPipe::ValidateOptions()|.
24 // In particular: |struct_size| is ignored (so |validated_options| must be the 24 // In particular: |struct_size| is ignored (so |validated_options| must be the
25 // current version of the struct) and |capacity_num_bytes| must be nonzero. 25 // current version of the struct) and |capacity_num_bytes| must be nonzero.
26 explicit LocalDataPipe(const MojoCreateDataPipeOptions& validated_options); 26 explicit LocalDataPipe(const MojoCreateDataPipeOptions& validated_options);
27 27
28 private: 28 private:
29 friend class base::RefCountedThreadSafe<LocalDataPipe>; 29 friend class base::RefCountedThreadSafe<LocalDataPipe>;
30 virtual ~LocalDataPipe(); 30 virtual ~LocalDataPipe();
31 31
32 // |DataPipe| implementation: 32 // |DataPipe| implementation:
33 virtual void ProducerCloseImplNoLock() OVERRIDE; 33 virtual void ProducerCloseImplNoLock() override;
34 virtual MojoResult ProducerWriteDataImplNoLock( 34 virtual MojoResult ProducerWriteDataImplNoLock(
35 UserPointer<const void> elements, 35 UserPointer<const void> elements,
36 UserPointer<uint32_t> num_bytes, 36 UserPointer<uint32_t> num_bytes,
37 uint32_t max_num_bytes_to_write, 37 uint32_t max_num_bytes_to_write,
38 uint32_t min_num_bytes_to_write) OVERRIDE; 38 uint32_t min_num_bytes_to_write) override;
39 virtual MojoResult ProducerBeginWriteDataImplNoLock( 39 virtual MojoResult ProducerBeginWriteDataImplNoLock(
40 UserPointer<void*> buffer, 40 UserPointer<void*> buffer,
41 UserPointer<uint32_t> buffer_num_bytes, 41 UserPointer<uint32_t> buffer_num_bytes,
42 uint32_t min_num_bytes_to_write) OVERRIDE; 42 uint32_t min_num_bytes_to_write) override;
43 virtual MojoResult ProducerEndWriteDataImplNoLock( 43 virtual MojoResult ProducerEndWriteDataImplNoLock(
44 uint32_t num_bytes_written) OVERRIDE; 44 uint32_t num_bytes_written) override;
45 virtual HandleSignalsState ProducerGetHandleSignalsStateImplNoLock() 45 virtual HandleSignalsState ProducerGetHandleSignalsStateImplNoLock()
46 const OVERRIDE; 46 const override;
47 virtual void ConsumerCloseImplNoLock() OVERRIDE; 47 virtual void ConsumerCloseImplNoLock() override;
48 virtual MojoResult ConsumerReadDataImplNoLock( 48 virtual MojoResult ConsumerReadDataImplNoLock(
49 UserPointer<void> elements, 49 UserPointer<void> elements,
50 UserPointer<uint32_t> num_bytes, 50 UserPointer<uint32_t> num_bytes,
51 uint32_t max_num_bytes_to_read, 51 uint32_t max_num_bytes_to_read,
52 uint32_t min_num_bytes_to_read) OVERRIDE; 52 uint32_t min_num_bytes_to_read) override;
53 virtual MojoResult ConsumerDiscardDataImplNoLock( 53 virtual MojoResult ConsumerDiscardDataImplNoLock(
54 UserPointer<uint32_t> num_bytes, 54 UserPointer<uint32_t> num_bytes,
55 uint32_t max_num_bytes_to_discard, 55 uint32_t max_num_bytes_to_discard,
56 uint32_t min_num_bytes_to_discard) OVERRIDE; 56 uint32_t min_num_bytes_to_discard) override;
57 virtual MojoResult ConsumerQueryDataImplNoLock( 57 virtual MojoResult ConsumerQueryDataImplNoLock(
58 UserPointer<uint32_t> num_bytes) OVERRIDE; 58 UserPointer<uint32_t> num_bytes) override;
59 virtual MojoResult ConsumerBeginReadDataImplNoLock( 59 virtual MojoResult ConsumerBeginReadDataImplNoLock(
60 UserPointer<const void*> buffer, 60 UserPointer<const void*> buffer,
61 UserPointer<uint32_t> buffer_num_bytes, 61 UserPointer<uint32_t> buffer_num_bytes,
62 uint32_t min_num_bytes_to_read) OVERRIDE; 62 uint32_t min_num_bytes_to_read) override;
63 virtual MojoResult ConsumerEndReadDataImplNoLock( 63 virtual MojoResult ConsumerEndReadDataImplNoLock(
64 uint32_t num_bytes_read) OVERRIDE; 64 uint32_t num_bytes_read) override;
65 virtual HandleSignalsState ConsumerGetHandleSignalsStateImplNoLock() 65 virtual HandleSignalsState ConsumerGetHandleSignalsStateImplNoLock()
66 const OVERRIDE; 66 const override;
67 67
68 void EnsureBufferNoLock(); 68 void EnsureBufferNoLock();
69 void DestroyBufferNoLock(); 69 void DestroyBufferNoLock();
70 70
71 // Get the maximum (single) write/read size right now (in number of elements); 71 // Get the maximum (single) write/read size right now (in number of elements);
72 // result fits in a |uint32_t|. 72 // result fits in a |uint32_t|.
73 size_t GetMaxNumBytesToWriteNoLock(); 73 size_t GetMaxNumBytesToWriteNoLock();
74 size_t GetMaxNumBytesToReadNoLock(); 74 size_t GetMaxNumBytesToReadNoLock();
75 75
76 // Marks the given number of bytes as consumed/discarded. |num_bytes| must be 76 // Marks the given number of bytes as consumed/discarded. |num_bytes| must be
77 // greater than |current_num_bytes_|. 77 // greater than |current_num_bytes_|.
78 void MarkDataAsConsumedNoLock(size_t num_bytes); 78 void MarkDataAsConsumedNoLock(size_t num_bytes);
79 79
80 // The members below are protected by |DataPipe|'s |lock_|: 80 // The members below are protected by |DataPipe|'s |lock_|:
81 scoped_ptr<char, base::AlignedFreeDeleter> buffer_; 81 scoped_ptr<char, base::AlignedFreeDeleter> buffer_;
82 // Circular buffer. 82 // Circular buffer.
83 size_t start_index_; 83 size_t start_index_;
84 size_t current_num_bytes_; 84 size_t current_num_bytes_;
85 85
86 DISALLOW_COPY_AND_ASSIGN(LocalDataPipe); 86 DISALLOW_COPY_AND_ASSIGN(LocalDataPipe);
87 }; 87 };
88 88
89 } // namespace system 89 } // namespace system
90 } // namespace mojo 90 } // namespace mojo
91 91
92 #endif // MOJO_SYSTEM_LOCAL_DATA_PIPE_H_ 92 #endif // MOJO_SYSTEM_LOCAL_DATA_PIPE_H_
OLDNEW
« no previous file with comments | « mojo/system/dispatcher_unittest.cc ('k') | mojo/system/local_message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698