| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebDataConsumerHandle_h | 5 #ifndef WebDataConsumerHandle_h |
| 6 #define WebDataConsumerHandle_h | 6 #define WebDataConsumerHandle_h |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #if INSIDE_BLINK | 10 #if INSIDE_BLINK |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include "public/platform/WebCommon.h" | 14 #include "public/platform/WebCommon.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 // WebDataConsumerHandle represents the "consumer" side of a data pipe. A user | 18 // WebDataConsumerHandle represents the "consumer" side of a data pipe. A user |
| 19 // can read data from it. | 19 // can read data from it. |
| 20 // | 20 // |
| 21 // A WebDataConsumerHandle is a thread-safe object. A user can call | 21 // A WebDataConsumerHandle is a thread-safe object. A user can call |
| 22 // |obtainReader| or destruct the object on any thread. | 22 // |obtainReader| or destruct the object on any thread. |
| 23 // A WebDataConsumerHandle having a reader is called "locked". A | 23 // A WebDataConsumerHandle having a reader is called "locked". A |
| 24 // WebDataConsumerHandle or its reader are called "waiting" when reading from | 24 // WebDataConsumerHandle or its reader are called "waiting" when reading from |
| 25 // the handle or reader returns ShouldWait. | 25 // the handle or reader returns ShouldWait. |
| 26 class WebDataConsumerHandle { | 26 class BLINK_PLATFORM_EXPORT WebDataConsumerHandle { |
| 27 public: | 27 public: |
| 28 using Flags = unsigned; | 28 using Flags = unsigned; |
| 29 static const Flags FlagNone = 0; | 29 static const Flags FlagNone = 0; |
| 30 | 30 |
| 31 enum Result { | 31 enum Result { |
| 32 Ok, | 32 Ok, |
| 33 Done, | 33 Done, |
| 34 Busy, | 34 Busy, |
| 35 ShouldWait, | 35 ShouldWait, |
| 36 ResourceExhausted, | 36 ResourceExhausted, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 virtual Reader* obtainReaderInternal(Client* client) | 121 virtual Reader* obtainReaderInternal(Client* client) |
| 122 { | 122 { |
| 123 BLINK_ASSERT_NOT_REACHED(); | 123 BLINK_ASSERT_NOT_REACHED(); |
| 124 return nullptr; | 124 return nullptr; |
| 125 } | 125 } |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| 129 | 129 |
| 130 #endif // WebDataConsumerHandle_h | 130 #endif // WebDataConsumerHandle_h |
| OLD | NEW |