New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 671811 link

Starred by 11 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

File drag&drop does now work from Drive

Project Member Reported by zelidrag@chromium.org, Dec 6 2016

Issue description

Chrome Version       : 56.0.2924.12
OS Version: 9000.15.0

What steps will reproduce the problem?
1. Open http://drive.google.com (or Dropbox or similar svc) for an account that isn't the one used to log in to Chrome OS.

2. Open Chrome OS Files.app, find a file on its Downloads section and try to drag it into tab from (1)

3. Open Files.app, find a file on its Drive section and try to drag it into tab from (1)

What is the expected result?

Both (2) and (3) should copy files into the file from Files.app to target website.

What happens instead of that?

(2) works, (3) doesn't.

I believe this used to work in the past.



 
Cc: yamaguchi@chromium.org hirono@chromium.org satorux@chromium.org oka@chromium.org
Owner: fukino@chromium.org
Status: Assigned (was: Untriaged)
I just tested (3) with Gmail desktop web version and it failed. I think it used to work.

Just a wild guess but maybe hirono@'s uploading changes, that were done some time ago, could be related?
Note that the snippet correctly loads data from dropped drive files.
https://jsfiddle.net/5z34e89s/

We still need to check how Google Drive web interface loads data from dropped files.
Tested on a simple internal site go/screenshots and it failed to upload.
Cc: -hirono@chromium.org fukino@chromium.org
Owner: hirono@chromium.org
Bisecting...
Cc: mtomasz@chromium.org
 Issue 588486  has been merged into this issue.
Cc: weifangsun@chromium.org
 Issue 658121  has been merged into this issue.
The issue does not happen R47-7520.67.0.

The issue happens on R48.7647.84.0

#8 was wrong. The issue started between R52-8350.74.0 and R53-8530.96.0.
I'm building linux local build to proceed bisect. But linux chrome OS around that version consistently crashes when launching...
Cc: hush@chromium.org
After bisecting, crrev.com/1723763002 seems to cause the problem.

+hashimoto, +kinaba who are familiar with the code of drag & drop non-native files.

After observing the issue, the logic look like:

1. DropData contains two isolate file system:
  A) Isolated file system for native files
  B) isolated file system for filesystem API files (e.g. Google Drive file).

2. crrev.com/1723763002 stopped creating the file system A when DropData does not contain native files. It seems correct.

3. The problem is in webkitGetAsEntry() which backs a JS function converting DataTransferItem to FileEntry. Before crrev.com/1723763002 it returns FileEntry that refers the file system A even for filesystem API files, though it must refer the file system B. The returned FileEntry is invalid and we cannot operate file operations for it.

4. After applying crrev.com/1723763002, webkitGetAsEntry cannot refer the file system A thus it start returning null.

5. I'm guessing Google Drive web invokes webkitGetAsEntry. It cannot read data from FileEntry returned by webkitGetAsEntry so it may use getAsFile() instead to read data. After applying crrev.com/1723763002, webkitGetAsEntry returns null. In this case Google Drive seems to skip the file.
Cc: hashimoto@chromium.org kinaba@chromium.org
Talked with hashimoto@-san offline.

1. Google Drive web actually invokes webkitGetAsEntry. (Maybe to handle folder drop?)
2. To fix webkitGetAsEntry, we need to pass fileSystemId of the file system B to render processes.
Fix was uploaded. crrev.com/2565283002.

Project Member

Comment 15 by bugdroid1@chromium.org, Dec 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da08349d4b87496c619152256ab039f6f6d2f28b

commit da08349d4b87496c619152256ab039f6f6d2f28b
Author: hirono <hirono@chromium.org>
Date: Wed Dec 14 07:36:16 2016

Fix webkitGetEntry for non-native files.

Previously webkitGetEntry was broken for non-native files. The method
creates FileEntry in isolated file system from DataTransferItem. The
problem is DataTransferItem only has file system ID of isolated file
system containing native files, though the browser process prepares
different isolated file system for non-native files.

The CL adds new field 'fileSystemId' for types representing a non-native
file and let webkitGetEntry refer the fileSystemId so that it can return
valid FileEntry for non-native files.

BUG= 671811 
TEST=Drop a file from Chrome OS Files app to Google Drive web.

Review-Url: https://codereview.chromium.org/2565283002
Cr-Commit-Position: refs/heads/master@{#438455}

[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/browser/renderer_host/render_widget_host_impl.cc
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/browser/web_contents/web_contents_view_aura.cc
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/common/drag_traits.h
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/public/common/drop_data.h
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/renderer/drop_data_builder.cc
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/content/renderer/render_widget.cc
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DataObject.cpp
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DataObject.h
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DataObjectItem.h
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DataObjectTest.cpp
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DraggedIsolatedFileSystem.cpp
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/core/clipboard/DraggedIsolatedFileSystem.h
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.cpp
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.cpp
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.h
[modify] https://crrev.com/da08349d4b87496c619152256ab039f6f6d2f28b/third_party/WebKit/public/platform/WebDragData.h

Status: Fixed (was: Assigned)
Components: -Platform>Apps>FileManager>Drive Blink>Storage>FileSystem
can we merge to m56?
Labels: Merge-Request-56
I think so. Let me send a merge request.

Comment 20 by dimu@chromium.org, Dec 15 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 21 by bugdroid1@chromium.org, Dec 15 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb

commit 0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb
Author: Daichi Hirono <hirono@chromium.org>
Date: Thu Dec 15 07:45:28 2016

Fix webkitGetEntry for non-native files.

Previously webkitGetEntry was broken for non-native files. The method
creates FileEntry in isolated file system from DataTransferItem. The
problem is DataTransferItem only has file system ID of isolated file
system containing native files, though the browser process prepares
different isolated file system for non-native files.

The CL adds new field 'fileSystemId' for types representing a non-native
file and let webkitGetEntry refer the fileSystemId so that it can return
valid FileEntry for non-native files.

BUG= 671811 
TEST=Drop a file from Chrome OS Files app to Google Drive web.

Review-Url: https://codereview.chromium.org/2565283002
Cr-Commit-Position: refs/heads/master@{#438455}
(cherry picked from commit da08349d4b87496c619152256ab039f6f6d2f28b)

Review-Url: https://codereview.chromium.org/2582463002 .
Cr-Commit-Position: refs/branch-heads/2924@{#508}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/browser/renderer_host/render_widget_host_impl.cc
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/browser/web_contents/web_contents_view_aura.cc
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/common/drag_traits.h
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/public/common/drop_data.h
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/renderer/drop_data_builder.cc
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/content/renderer/render_widget.cc
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DataObject.cpp
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DataObject.h
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DataObjectItem.h
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DataObjectTest.cpp
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DraggedIsolatedFileSystem.cpp
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/core/clipboard/DraggedIsolatedFileSystem.h
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.cpp
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.cpp
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.h
[modify] https://crrev.com/0fff0c9efd40d9bbe9bc99fa239a89a4f241fedb/third_party/WebKit/public/platform/WebDragData.h

Status: Verified (was: Fixed)

Sign in to add a comment