Again, passing in kUnknownSize for the file size and in this case a default-initialized base::Time as modification time to move stat-ing the file of any blocking code paths. You'd probably want to replicate some of ChromeBlobStorageContext::CreateMemoryBackedBlob (Possibly bring back the CreateFileBackedBlob method that got removed in ). I'm not sure if we currently have some convenient helper to create the SerializedBlob on the browser side. (std::numeric_limits::max()) as file size in the SerializedBlob things should work out such that the actual blocking file stat is delayed until a website actually tries to access the size or modification time of the resulting File. I think as long as you pass blink::blob_utils::kUnknownSize You would then pass that handle, the display name and a nullopt modification_time to the File(name, modification_time, blob_data_handle) constructor. That is typemapped to a scoped_refptr in blink. Ideally you'd be able to change the FilePath to a. But I think for this case it should be fine.ĭoing it in such a way to not pay the performance cost of stat-ing all files on paste might be a bit tricky, but I think is doable. Unfortunately there are some things blocking migrating existing file usage to what I think is the better pattern. Not sure if we have code samples directly for that at the moment. I have them to match drag and drop so that I can call DataObject::AddFilename() in the same way. I have them to match drag and drop so that I can call DataObject::AddFilename() in the same if there is another way that I should be constructing the File rather than DataObject::AddFilename(), please point me to a code example where we are sending mojo data and then constructing the File in the renderer. Patch Set #22, Line 35: mojo_ display_name Īs a nit, why do we have separate path and display_name members? (besides doing so since drag-drop d ![]() I don't mind too much either way, but I thought it was better to have it as a single overall description.įile third_party/blink/public/mojom/clipboard/clipboard.mojom: Nit: Should we split these comments up into where each is relevant? I guess you kept this in one blo mojom::DragData to mojom::ClipboardFiles. call PrepareDropDataForChildProcess and DropDataToDragData, then convert It turned out that this implementation is not so big or hard to understand, so I hope the implementation and the design discussions help each other.įile content/browser/renderer_host/clipboard_host_: Safari supports this already.Ģ/ I will see from security whether a flag is required for launching this.ģ/ I don't have enough understanding of the related code to know what possibilities exist, or how an implementation would work without doing it. This is using the existing APIs as they were intended - it is just that chrome has not implemented yet. Since this exposes a new feature to the web, you should send out an intent to prototype before landi ġ/ I don't believe this is a new feature to the web. I think it might be a good option to implement ReadFiles first. Sorry, I split out the WriteFiles into a separate /c/2655125. This doesn't seem to match the implementation? Patch Set #22, Line 9: Add ReadFile and WriteFile to clipboard mojo interface. To unsubscribe, or for help writing mail filters, visit settings.Īttention is currently required from: Marijn Kruisselbrink, Daniel Cheng, Darwin Huang. M third_party/blink/renderer/core/testing/mock_clipboard_host.hġ0 files changed, 124 insertions(+), 0 deletions(-) M third_party/blink/renderer/core/testing/mock_clipboard_ M third_party/blink/renderer/core/clipboard/system_clipboard.h M third_party/blink/renderer/core/clipboard/system_ M third_party/blink/renderer/core/clipboard/data_ M third_party/blink/public/mojom/clipboard/clipboard.mojom M content/browser/renderer_host/clipboard_host_impl.h M content/browser/renderer_host/clipboard_host_ Objects are set in DataTransfer as File items.Ĭhange-Id: I5f8bca7a8cad724c779299f6dc1085be325349e9 IsolatedFileSystem using the same approach as drag and drop. These files will be made available via an In a paste event, if a renderer detects that mime type text/uri-list isĪvailable, it will call mojo ReadFiles to get files fromĬlipboard::ReadFilenames. ![]() View Change Add mojo clipboard ReadFiles to support files in DataTransfer Joel Hockey uploaded patch set #23 to this change. Attention is currently required from: Daniel Cheng, Joel Hockey.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |