electron/patches/common/chromium/blink_file_path.patch
2019-03-08 15:04:32 -08:00

34 lines
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 4a2b3a42364b57e3a0e4514ac40f5576ba5d6689..b89dd3b2ad409b3c23a3a05de241a6c8358fedb1 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
long long lastModified() const;
diff --git a/third_party/blink/renderer/core/fileapi/file.idl b/third_party/blink/renderer/core/fileapi/file.idl
index 940f8e62ce228beaf71f5a4be88539a431415ab1..0cf315636afe0e5e1533b3372cdfe2c09ec581e1 100644
--- a/third_party/blink/renderer/core/fileapi/file.idl
+++ b/third_party/blink/renderer/core/fileapi/file.idl
@@ -33,6 +33,7 @@
Serializable
] interface File : Blob {
readonly attribute DOMString name;
+ readonly attribute DOMString path;
readonly attribute long long lastModified;
// Non-standard APIs