| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ | 5 #ifndef CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ |
| 6 #define CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ | 6 #define CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 kApplyBackpressure, | 24 kApplyBackpressure, |
| 25 kDoNotApplyBackpressure, | 25 kDoNotApplyBackpressure, |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 class CONTENT_EXPORT Writer final { | 28 class CONTENT_EXPORT Writer final { |
| 29 public: | 29 public: |
| 30 Writer(const scoped_refptr<Context>& context, BackpressureMode mode); | 30 Writer(const scoped_refptr<Context>& context, BackpressureMode mode); |
| 31 ~Writer(); | 31 ~Writer(); |
| 32 void AddData(scoped_ptr<RequestPeer::ReceivedData> data); | 32 void AddData(scoped_ptr<RequestPeer::ReceivedData> data); |
| 33 void Close(); | 33 void Close(); |
| 34 // TODO(yhirano): Consider providing error code. |
| 35 void Error(); |
| 34 | 36 |
| 35 private: | 37 private: |
| 36 scoped_refptr<Context> context_; | 38 scoped_refptr<Context> context_; |
| 37 BackpressureMode mode_; | 39 BackpressureMode mode_; |
| 38 | 40 |
| 39 DISALLOW_COPY_AND_ASSIGN(Writer); | 41 DISALLOW_COPY_AND_ASSIGN(Writer); |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 class ReaderImpl final : public Reader { | 44 class ReaderImpl final : public Reader { |
| 43 public: | 45 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 scoped_refptr<Context> context_; | 77 scoped_refptr<Context> context_; |
| 76 // This is an implicitly acquired reader for deprecated APIs. | 78 // This is an implicitly acquired reader for deprecated APIs. |
| 77 scoped_ptr<Reader> reader_; | 79 scoped_ptr<Reader> reader_; |
| 78 | 80 |
| 79 DISALLOW_COPY_AND_ASSIGN(SharedMemoryDataConsumerHandle); | 81 DISALLOW_COPY_AND_ASSIGN(SharedMemoryDataConsumerHandle); |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 } // namespace content | 84 } // namespace content |
| 83 | 85 |
| 84 #endif // CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ | 86 #endif // CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ |
| OLD | NEW |