electron/patches/chromium/blink_file_path.patch

35 строки
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:45:00 -0700
Subject: blink_file_path.patch
This is used by editors to obtain the filesystem path from a dragged file. See
documentation at https://electronjs.org/docs/api/file-object
diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h
index 05e05fb1631851009897f3789d3e770475ce1363..e2ad5fef884532847d035430c14c25e042e2ab24 100644
--- a/third_party/blink/renderer/core/fileapi/file.h
+++ b/third_party/blink/renderer/core/fileapi/file.h
@@ -201,6 +201,9 @@ class CORE_EXPORT File final : public Blob {
}
const String& name() const { return name_; }
+ // Getter for the path IDL attribute.
+ const String& path() const { return GetPath(); }
+
// Getter for the lastModified IDL attribute,
// http://dev.w3.org/2006/webapi/FileAPI/#file-attrs
int64_t lastModified() const;
diff --git a/third_party/blink/renderer/core/fileapi/file.idl b/third_party/blink/renderer/core/fileapi/file.idl
index 41b8183e858b6d955bacbb72281a08e750b6b29f..0db894ecfae63795724335d914f9f992c0755fd1 100644
--- a/third_party/blink/renderer/core/fileapi/file.idl
+++ b/third_party/blink/renderer/core/fileapi/file.idl
@@ -32,6 +32,7 @@
Serializable
] interface File : Blob {
readonly attribute DOMString name;
+ readonly attribute DOMString path;
readonly attribute long long lastModified;
// Non-standard APIs