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

Unified Diff: third_party/WebKit/Source/modules/cachestorage/Cache.cpp

Issue 2810843002: bindings: Make the sequence conversion code more complaint with WebIDL. (Closed)
Patch Set: Adjust even more tests Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/cachestorage/Cache.cpp
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
index 174bd4d0684106d2a7583054faffab56eaeda3d3..12821c0d9d2690ae8a9e18ee59677310c13af88b 100644
--- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -4,8 +4,12 @@
#include "modules/cachestorage/Cache.h"
+#include <memory>
+#include <utility>
#include "bindings/core/v8/CallbackPromiseAdapter.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/IDLTypes.h"
+#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8Binding.h"
@@ -22,8 +26,6 @@
#include "platform/HTTPNames.h"
#include "platform/Histogram.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerCache.h"
-#include <memory>
-#include <utility>
namespace blink {
@@ -236,9 +238,9 @@ class Cache::FetchResolvedForAdd final : public ScriptFunction {
ScriptValue Call(ScriptValue value) override {
NonThrowableExceptionState exception_state;
- HeapVector<Member<Response>> responses = ToMemberNativeArray<Response>(
- value.V8Value(), requests_.size(), GetScriptState()->GetIsolate(),
- exception_state);
+ HeapVector<Member<Response>> responses =
+ NativeValueTraits<IDLSequence<Response>>::NativeValue(
+ GetScriptState()->GetIsolate(), value.V8Value(), exception_state);
for (const auto& response : responses) {
if (!response->ok()) {
« no previous file with comments | « third_party/WebKit/Source/core/testing/SequenceTest.idl ('k') | third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698