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

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

Issue 2297043002: Web expose FileSystemFileEntry, FileSystemDirectoryEntry and friends (Closed)
Patch Set: Rebased Created 4 years, 1 month 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/ScriptValueSerializerForModules.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp
index 334f4a9434b239eb0344d009c664f2985c4a795c..76e8c2c545e0b2cb28dee294d2b22780be94051c 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp
@@ -7,10 +7,10 @@
#include "bindings/core/v8/SerializationTag.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/modules/v8/V8CryptoKey.h"
-#include "bindings/modules/v8/V8DOMFileSystem.h"
+#include "bindings/modules/v8/V8FileSystem.h"
#include "bindings/modules/v8/V8RTCCertificate.h"
#include "bindings/modules/v8/serialization/WebCryptoSubTags.h"
-#include "modules/filesystem/DOMFileSystem.h"
+#include "modules/filesystem/FileSystem.h"
#include "modules/peerconnection/RTCCertificate.h"
#include "public/platform/Platform.h"
#include "public/platform/WebRTCCertificate.h"
@@ -27,16 +27,16 @@ ScriptValueSerializerForModules::ScriptValueSerializerForModules(
: ScriptValueSerializer(writer, blobInfo, scriptState) {}
ScriptValueSerializer::StateBase*
-ScriptValueSerializerForModules::writeDOMFileSystem(v8::Local<v8::Value> value,
- StateBase* next) {
- DOMFileSystem* fs = V8DOMFileSystem::toImpl(value.As<v8::Object>());
+ScriptValueSerializerForModules::writeFileSystem(v8::Local<v8::Value> value,
+ StateBase* next) {
+ FileSystem* fs = V8FileSystem::toImpl(value.As<v8::Object>());
if (!fs)
return 0;
if (!fs->clonable())
return handleError(Status::DataCloneError,
"A FileSystem object could not be cloned.", next);
- toSerializedScriptValueWriterForModules(writer()).writeDOMFileSystem(
+ toSerializedScriptValueWriterForModules(writer()).writeFileSystem(
fs->type(), fs->name(), fs->rootURL().getString());
return 0;
}
@@ -63,11 +63,10 @@ ScriptValueSerializerForModules::writeRTCCertificate(v8::Local<v8::Value> value,
return nullptr;
}
-void SerializedScriptValueWriterForModules::writeDOMFileSystem(
- int type,
- const String& name,
- const String& url) {
- append(DOMFileSystemTag);
+void SerializedScriptValueWriterForModules::writeFileSystem(int type,
+ const String& name,
+ const String& url) {
+ append(FileSystemTag);
doWriteUint32(type);
doWriteWebCoreString(name);
doWriteWebCoreString(url);
@@ -275,9 +274,9 @@ ScriptValueSerializerForModules::doSerializeObject(
StateBase* next) {
DCHECK(!jsObject.IsEmpty());
- if (V8DOMFileSystem::hasInstance(jsObject, isolate())) {
+ if (V8FileSystem::hasInstance(jsObject, isolate())) {
greyObject(jsObject);
- return writeDOMFileSystem(jsObject, next);
+ return writeFileSystem(jsObject, next);
}
if (V8CryptoKey::hasInstance(jsObject, isolate())) {
greyObject(jsObject);
@@ -301,8 +300,8 @@ bool SerializedScriptValueReaderForModules::read(
if (!readTag(&tag))
return false;
switch (tag) {
- case DOMFileSystemTag:
- if (!readDOMFileSystem(value))
+ case FileSystemTag:
+ if (!readFileSystem(value))
return false;
deserializer.pushObjectReference(*value);
break;
@@ -322,7 +321,7 @@ bool SerializedScriptValueReaderForModules::read(
return !value->IsEmpty();
}
-bool SerializedScriptValueReaderForModules::readDOMFileSystem(
+bool SerializedScriptValueReaderForModules::readFileSystem(
v8::Local<v8::Value>* value) {
uint32_t type;
String name;
@@ -333,9 +332,9 @@ bool SerializedScriptValueReaderForModules::readDOMFileSystem(
return false;
if (!readWebCoreString(&url))
return false;
- DOMFileSystem* fs = DOMFileSystem::create(
- getScriptState()->getExecutionContext(), name,
- static_cast<FileSystemType>(type), KURL(ParsedURLString, url));
+ FileSystem* fs = FileSystem::create(getScriptState()->getExecutionContext(),
+ name, static_cast<FileSystemType>(type),
+ KURL(ParsedURLString, url));
*value = toV8(fs, getScriptState()->context()->Global(), isolate());
return !value->IsEmpty();
}

Powered by Google App Engine
This is Rietveld 408576698