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

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

Issue 129163003: Mojo: DataPipe: Implement "may discard" for two-phase writes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 6 years, 11 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/local_data_pipe.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_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/basictypes.h" 8 #include "base/basictypes.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 virtual MojoWaitFlags ConsumerSatisfiableFlagsNoLock() OVERRIDE; 58 virtual MojoWaitFlags ConsumerSatisfiableFlagsNoLock() OVERRIDE;
59 59
60 void EnsureBufferNoLock(); 60 void EnsureBufferNoLock();
61 void DestroyBufferNoLock(); 61 void DestroyBufferNoLock();
62 62
63 // Get the maximum (single) write/read size right now (in number of elements); 63 // Get the maximum (single) write/read size right now (in number of elements);
64 // result fits in a |uint32_t|. 64 // result fits in a |uint32_t|.
65 size_t GetMaxNumBytesToWriteNoLock(); 65 size_t GetMaxNumBytesToWriteNoLock();
66 size_t GetMaxNumBytesToReadNoLock(); 66 size_t GetMaxNumBytesToReadNoLock();
67 67
68 // Marks the given number of bytes as consumed/discarded. |num_bytes| must be
69 // greater than |current_num_bytes_|.
70 void MarkDataAsConsumedNoLock(size_t num_bytes);
71
68 // The members below are protected by |DataPipe|'s |lock_|: 72 // The members below are protected by |DataPipe|'s |lock_|:
69 scoped_ptr_malloc<char, base::ScopedPtrAlignedFree> buffer_; 73 scoped_ptr_malloc<char, base::ScopedPtrAlignedFree> buffer_;
70 // Circular buffer. 74 // Circular buffer.
71 size_t start_index_; 75 size_t start_index_;
72 size_t current_num_bytes_; 76 size_t current_num_bytes_;
73 77
74 DISALLOW_COPY_AND_ASSIGN(LocalDataPipe); 78 DISALLOW_COPY_AND_ASSIGN(LocalDataPipe);
75 }; 79 };
76 80
77 } // namespace system 81 } // namespace system
78 } // namespace mojo 82 } // namespace mojo
79 83
80 #endif // MOJO_SYSTEM_LOCAL_DATA_PIPE_H_ 84 #endif // MOJO_SYSTEM_LOCAL_DATA_PIPE_H_
OLDNEW
« no previous file with comments | « mojo/system/data_pipe.cc ('k') | mojo/system/local_data_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698