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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.cpp

Issue 2438653002: Support serializable DOMFileSystem on the V8-based structured clone path. (Closed)
Patch Set: Created 4 years, 2 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/bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.cpp
index aedc902dbf5bebaa01c0ed5d401dbb93d8db2a82..3106170c90bcb2c655835b4970ff7f97cb18aa79 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.cpp
@@ -6,8 +6,10 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/modules/v8/V8CryptoKey.h"
+#include "bindings/modules/v8/V8DOMFileSystem.h"
#include "bindings/modules/v8/V8RTCCertificate.h"
#include "bindings/modules/v8/serialization/WebCryptoSubTags.h"
+#include "platform/FileSystemType.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCrypto.h"
#include "public/platform/WebCryptoKey.h"
@@ -30,6 +32,20 @@ bool V8ScriptValueSerializerForModules::writeDOMObject(
return writeCryptoKey(wrappable->toImpl<CryptoKey>()->key(),
exceptionState);
}
+ if (wrapperTypeInfo == &V8DOMFileSystem::wrapperTypeInfo) {
+ DOMFileSystem* fs = wrappable->toImpl<DOMFileSystem>();
+ if (!fs->clonable()) {
+ exceptionState.throwDOMException(
+ DataCloneError, "A FileSystem object could not be cloned.");
+ return false;
+ }
+ writeTag(DOMFileSystemTag);
+ // This locks in the values of the FileSystemType enumerators.
+ writeUint32(static_cast<uint32_t>(fs->type()));
+ writeUTF8String(fs->name());
+ writeUTF8String(fs->rootURL().getString());
+ return true;
+ }
if (wrapperTypeInfo == &V8RTCCertificate::wrapperTypeInfo) {
RTCCertificate* certificate = wrappable->toImpl<RTCCertificate>();
WebRTCCertificatePEM pem = certificate->certificate().toPEM();

Powered by Google App Engine
This is Rietveld 408576698