Index: third_party/grpc/src/objective-c/RxLibrary/GRXWriter+Immediate.h |
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.h b/third_party/grpc/src/objective-c/RxLibrary/GRXWriter+Immediate.h |
similarity index 50% |
copy from third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.h |
copy to third_party/grpc/src/objective-c/RxLibrary/GRXWriter+Immediate.h |
index fbb8d7b8582b8370265e71150fd5646e558191df..be880151f4f79ff49f5ad50a38d76ac5bc7d2fa6 100644 |
--- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.h |
+++ b/third_party/grpc/src/objective-c/RxLibrary/GRXWriter+Immediate.h |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2009 Google Inc. All rights reserved. |
+ * |
+ * Copyright 2015, Google Inc. |
+ * All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -26,28 +28,51 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * |
*/ |
-#ifndef SQLTransactionClient_h |
-#define SQLTransactionClient_h |
+#import "GRXWriter.h" |
-#include "wtf/Allocator.h" |
-#include "wtf/Noncopyable.h" |
+@interface GRXWriter (Immediate) |
-namespace blink { |
+/** |
+ * Returns a writer that pulls values from the passed NSEnumerator instance and pushes them to |
+ * its writeable. The NSEnumerator is released when it finishes. |
+ */ |
++ (instancetype)writerWithEnumerator:(NSEnumerator *)enumerator; |
-class Database; |
+/** |
+ * Returns a writer that pushes to its writeable the successive values returned by the passed |
+ * block. When the block first returns nil, it is released. |
+ */ |
++ (instancetype)writerWithValueSupplier:(id (^)())block; |
-// A client to the SQLTransaction class. Allows SQLTransaction to notify interested |
-// parties that certain things have happened in a transaction. |
-class SQLTransactionClient { |
- WTF_MAKE_NONCOPYABLE(SQLTransactionClient); USING_FAST_MALLOC(SQLTransactionClient); |
-public: |
- SQLTransactionClient() { } |
- void didCommitWriteTransaction(Database*); |
- bool didExceedQuota(Database*); |
-}; |
+/** |
+ * Returns a writer that iterates over the values of the passed container and pushes them to |
+ * its writeable. The container is released when the iteration is over. |
+ * |
+ * Note that the usual speed gain of NSFastEnumeration over NSEnumerator results from not having to |
+ * call one method per element. Because GRXWriteable instances accept values one by one, that speed |
+ * gain doesn't happen here. |
+ */ |
++ (instancetype)writerWithContainer:(id<NSFastEnumeration>)container; |
-} // namespace blink |
+/** |
+ * Returns a writer that sends the passed value to its writeable and then finishes (releasing the |
+ * value). |
+ */ |
++ (instancetype)writerWithValue:(id)value; |
+ |
+/** |
+ * Returns a writer that, as part of its start method, sends the passed error to the writeable |
+ * (then releasing the error). |
+ */ |
++ (instancetype)writerWithError:(NSError *)error; |
+ |
+/** |
+ * Returns a writer that, as part of its start method, finishes immediately without sending any |
+ * values to its writeable. |
+ */ |
++ (instancetype)emptyWriter; |
-#endif // SQLTransactionClient_h |
+@end |