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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8IteratorResultValue.cpp

Issue 1506023003: Response construction with a ReadableStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/V8IteratorResultValue.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8IteratorResultValue.cpp b/third_party/WebKit/Source/bindings/core/v8/V8IteratorResultValue.cpp
index 739e3a075c546e8039e9ae376604ed72ff869d5f..eeb1aa8768204eedfcbfe23384b41c7394af11a8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8IteratorResultValue.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8IteratorResultValue.cpp
@@ -18,4 +18,17 @@ v8::Local<v8::Object> v8IteratorResultValue(v8::Isolate* isolate, bool done, v8:
return result;
}
+v8::MaybeLocal<v8::Value> v8UnpackIteratorResult(ScriptState* scriptState, v8::Local<v8::Object> result, bool* done)
+{
+ v8::MaybeLocal<v8::Value> maybeValue = result->Get(scriptState->context(), v8String(scriptState->isolate(), "value"));
+ if (maybeValue.IsEmpty())
+ return maybeValue;
+ v8::Local<v8::Value> doneValue;
+ if (!v8Call(result->Get(scriptState->context(), v8String(scriptState->isolate(), "done")), doneValue)
+ || !v8Call(doneValue->BooleanValue(scriptState->context()), *done)) {
+ return v8::MaybeLocal<v8::Value>();
+ }
+ return maybeValue;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698