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

Issue 18063005: Do PPB_FileIO Query and Read in the plugin process. (Closed)

Created:
7 years, 5 months ago by bbudge
Modified:
7 years, 4 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam
Visibility:
Public.

Description

Move PPB_FileIO Query and Read implementation from the renderer to the plugin process. This sends the file descriptor to the plugin side and moves some FileIO implementation from the renderer to the plugin, using that file descriptor. BUG=194304 R=dmichael@chromium.org, sky@chromium.org, teravest@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213933 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216569

Patch Set 1 #

Patch Set 2 : All tests pass, but no quota checking. #

Patch Set 3 : #

Patch Set 4 : Use special refs so we can delete while holding the proxy lock. #

Patch Set 5 : Add synchronous implementations. #

Patch Set 6 : Create a permissive NaClQuotaDesc wrapping the normal NaClDesc. #

Patch Set 7 : Back up and only do Query and Read on plugin side. #

Patch Set 8 : #

Total comments: 4

Patch Set 9 : Prevent writes on plugin side. #

Total comments: 1

Patch Set 10 : Add sprintf to debug fstat failure on NaCl / Windows. #

Patch Set 11 : Refine sprintf, last_modified_time is the problem. #

Patch Set 12 : Modify TouchQuery test to work around Windows _fstat64 bugs. #

Patch Set 13 : Add workaround to test_file_ref.cc too. #

Patch Set 14 : Add comments and DCHECK re file writing. #

Patch Set 15 : Remove DCHECK, which breaks trusted plugins. #

Total comments: 13

Patch Set 16 : Address comments #

Patch Set 17 : Keep callback machinery private for clarity. Comments. #

Patch Set 18 : Use David's improved RunWhileLocked to wrap callbacks. #

Patch Set 19 : Rebase to David's latest. #

Total comments: 2

Patch Set 20 : Remove old stuff that snuck back in. #

Patch Set 21 : Rebase. #

Total comments: 2

Patch Set 22 : Comment tweaks. #

Patch Set 23 : Redo patch. #

Patch Set 24 : Don't use FileUtilProxy. #

Patch Set 25 : Use FileUtilProxy for non-blocking callbacks. #

Patch Set 26 : Add some comments explaining issues. #

Total comments: 4

Patch Set 27 : Don't use FileUtilProxy at all. #

Total comments: 2

Patch Set 28 : Add a note explaining buffer transfer for DoRead. #

Total comments: 1

Patch Set 29 : Rethink - Just optimize the blocking callback case. #

Total comments: 2

Patch Set 30 : Clean up and add comments. #

Total comments: 5

Patch Set 31 : Tighten up ReadValidated. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -45 lines) Patch
M content/renderer/pepper/pepper_file_io_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/pepper/pepper_file_io_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 4 chunks +24 lines, -10 lines 0 comments Download
M ppapi/proxy/file_io_resource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2 chunks +5 lines, -2 lines 0 comments Download
M ppapi/proxy/file_io_resource.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 16 chunks +120 lines, -27 lines 0 comments Download
M ppapi/tests/test_file_io.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +7 lines, -3 lines 0 comments Download
M ppapi/tests/test_file_ref.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 53 (0 generated)
bbudge
Ignore everything in base/. It's in a separate CL but is required to build this.
7 years, 5 months ago (2013-07-11 20:59:48 UTC) #1
dmichael (off chromium)
Sorry for being slow, there was an office picnic yesterday. +teravest@, I think he'll be ...
7 years, 5 months ago (2013-07-12 15:46:24 UTC) #2
teravest
https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc File content/renderer/pepper/pepper_file_io_host.cc (right): https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc#newcode423 content/renderer/pepper/pepper_file_io_host.cc:423: renderer_ppapi_host_->ShareHandleWithRemote(file_, false); What's your plan for preventing writes to ...
7 years, 5 months ago (2013-07-12 16:07:50 UTC) #3
bbudge
https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc File content/renderer/pepper/pepper_file_io_host.cc (right): https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc#newcode423 content/renderer/pepper/pepper_file_io_host.cc:423: renderer_ppapi_host_->ShareHandleWithRemote(file_, false); Good question! I hadn't dealt with this ...
7 years, 5 months ago (2013-07-12 17:19:14 UTC) #4
bbudge
+Justin for IPC and overall security review. https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc File content/renderer/pepper/pepper_file_io_host.cc (right): https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc#newcode423 content/renderer/pepper/pepper_file_io_host.cc:423: renderer_ppapi_host_->ShareHandleWithRemote(file_, false); ...
7 years, 5 months ago (2013-07-12 18:15:18 UTC) #5
teravest
https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc File content/renderer/pepper/pepper_file_io_host.cc (right): https://codereview.chromium.org/18063005/diff/5655612935372800/content/renderer/pepper/pepper_file_io_host.cc#newcode423 content/renderer/pepper/pepper_file_io_host.cc:423: renderer_ppapi_host_->ShareHandleWithRemote(file_, false); On 2013/07/12 18:15:18, bbudge1 wrote: > I ...
7 years, 5 months ago (2013-07-15 16:25:12 UTC) #6
bbudge
I added a comment where the write flags are cleared. For some reason Query fails ...
7 years, 5 months ago (2013-07-15 17:06:51 UTC) #7
dmichael (off chromium)
On Mon, Jul 15, 2013 at 11:06 AM, <bbudge@chromium.org> wrote: > I added a comment ...
7 years, 5 months ago (2013-07-15 17:19:41 UTC) #8
jschuh
IPC security lgtm. It looks okay, but Pepper code is always really ahrd for me ...
7 years, 5 months ago (2013-07-16 00:05:47 UTC) #9
bbudge
I tracked down the cause of the failures. It looks like the NaClDesc is using ...
7 years, 5 months ago (2013-07-17 21:46:33 UTC) #10
teravest
lgtm https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc#newcode44 ppapi/proxy/file_io_resource.cc:44: typedef scoped_ptr<scoped_refptr<FileIOResource> > PassedRef; This is funky, but ...
7 years, 5 months ago (2013-07-18 19:00:35 UTC) #11
dmichael (off chromium)
https://codereview.chromium.org/18063005/diff/110003/chrome/nacl/nacl_ipc_adapter.cc File chrome/nacl/nacl_ipc_adapter.cc (right): https://codereview.chromium.org/18063005/diff/110003/chrome/nacl/nacl_ipc_adapter.cc#newcode441 chrome/nacl/nacl_ipc_adapter.cc:441: // have write capabilities, and we don't want the ...
7 years, 5 months ago (2013-07-18 20:28:09 UTC) #12
bbudge
https://codereview.chromium.org/18063005/diff/110003/chrome/nacl/nacl_ipc_adapter.cc File chrome/nacl/nacl_ipc_adapter.cc (right): https://codereview.chromium.org/18063005/diff/110003/chrome/nacl/nacl_ipc_adapter.cc#newcode441 chrome/nacl/nacl_ipc_adapter.cc:441: // have write capabilities, and we don't want the ...
7 years, 5 months ago (2013-07-18 21:28:16 UTC) #13
dmichael (off chromium)
https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc#newcode131 ppapi/proxy/file_io_resource.cc:131: base::Bind(&QueryCallback, base::Passed(&passed_ref), On 2013/07/18 21:28:16, bbudge1 wrote: > I ...
7 years, 5 months ago (2013-07-18 23:21:47 UTC) #14
bbudge
https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc#newcode131 ppapi/proxy/file_io_resource.cc:131: base::Bind(&QueryCallback, base::Passed(&passed_ref), This does compile, but unfortunately the outermost ...
7 years, 5 months ago (2013-07-19 01:16:56 UTC) #15
dmichael (off chromium)
On 2013/07/19 01:16:56, bbudge1 wrote: > https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc > File ppapi/proxy/file_io_resource.cc (right): > > https://codereview.chromium.org/18063005/diff/110003/ppapi/proxy/file_io_resource.cc#newcode131 > ...
7 years, 5 months ago (2013-07-19 02:28:31 UTC) #16
bbudge
I'm going to wait until you land your RunWhileLocked change.
7 years, 5 months ago (2013-07-20 12:52:52 UTC) #17
dmichael (off chromium)
https://codereview.chromium.org/18063005/diff/167001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/167001/ppapi/proxy/file_io_resource.cc#newcode313 ppapi/proxy/file_io_resource.cc:313: file_io->OnReadComplete(callback, array_output, error_code, data, bytes_read); It looks like this ...
7 years, 5 months ago (2013-07-25 17:42:46 UTC) #18
bbudge
https://codereview.chromium.org/18063005/diff/167001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/167001/ppapi/proxy/file_io_resource.cc#newcode313 ppapi/proxy/file_io_resource.cc:313: file_io->OnReadComplete(callback, array_output, error_code, data, bytes_read); No. I'm not sure ...
7 years, 5 months ago (2013-07-25 17:56:24 UTC) #19
dmichael (off chromium)
lgtm without the test_globals.* change https://codereview.chromium.org/18063005/diff/189001/ppapi/shared_impl/test_globals.h File ppapi/shared_impl/test_globals.h (right): https://codereview.chromium.org/18063005/diff/189001/ppapi/shared_impl/test_globals.h#newcode52 ppapi/shared_impl/test_globals.h:52: void set_proxy_lock(base::Lock* lock) { ...
7 years, 5 months ago (2013-07-25 21:39:54 UTC) #20
bbudge
https://codereview.chromium.org/18063005/diff/189001/ppapi/shared_impl/test_globals.h File ppapi/shared_impl/test_globals.h (right): https://codereview.chromium.org/18063005/diff/189001/ppapi/shared_impl/test_globals.h#newcode52 ppapi/shared_impl/test_globals.h:52: void set_proxy_lock(base::Lock* lock) { lock_ = lock; } On ...
7 years, 5 months ago (2013-07-25 22:12:07 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/193001
7 years, 5 months ago (2013-07-25 22:25:57 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/193001
7 years, 5 months ago (2013-07-25 22:35:28 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/193001
7 years, 5 months ago (2013-07-25 23:06:38 UTC) #24
commit-bot: I haz the power
Failed to trigger a try job on chromium_presubmit HTTP Error 400: Bad Request
7 years, 5 months ago (2013-07-26 03:37:57 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/219001
7 years, 5 months ago (2013-07-26 03:44:53 UTC) #26
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=17270
7 years, 5 months ago (2013-07-26 06:37:52 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/219001
7 years, 5 months ago (2013-07-26 13:17:37 UTC) #28
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=17311
7 years, 5 months ago (2013-07-26 13:40:21 UTC) #29
bbudge
+sky, +jhawkins for OWNERS review for chrome/nacl/nacl_ipc_adapter.cc. Just a comment change.
7 years, 5 months ago (2013-07-26 15:01:03 UTC) #30
sky
Rubber stamp LGTM feel free to TBR comment only changes.
7 years, 5 months ago (2013-07-26 15:40:55 UTC) #31
bbudge
Committed patchset #23 manually as r213933 (presubmit successful).
7 years, 5 months ago (2013-07-26 16:49:50 UTC) #32
bbudge
7 years, 4 months ago (2013-08-01 19:54:31 UTC) #33
bbudge
This is a rough version of what it will take to make this work for ...
7 years, 4 months ago (2013-08-01 21:09:16 UTC) #34
bbudge
Added some comments to explain why we can't use FileUtilProxy in the blocking callback case. ...
7 years, 4 months ago (2013-08-02 13:53:56 UTC) #35
dmichael (off chromium)
https://codereview.chromium.org/18063005/diff/251001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/251001/ppapi/proxy/file_io_resource.cc#newcode35 ppapi/proxy/file_io_resource.cc:35: // block the calling thread, which will cause FileUtilProxy ...
7 years, 4 months ago (2013-08-02 15:44:28 UTC) #36
bbudge
https://codereview.chromium.org/18063005/diff/251001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/251001/ppapi/proxy/file_io_resource.cc#newcode35 ppapi/proxy/file_io_resource.cc:35: // block the calling thread, which will cause FileUtilProxy ...
7 years, 4 months ago (2013-08-02 20:56:44 UTC) #37
dmichael (off chromium)
lgtm, thanks for persevering https://codereview.chromium.org/18063005/diff/260001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/260001/ppapi/proxy/file_io_resource.cc#newcode76 ppapi/proxy/file_io_resource.cc:76: Bind(callback, error, base::Owned(buffer.release()), bytes_read)); nit: ...
7 years, 4 months ago (2013-08-02 22:28:16 UTC) #38
bbudge
https://codereview.chromium.org/18063005/diff/260001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/260001/ppapi/proxy/file_io_resource.cc#newcode76 ppapi/proxy/file_io_resource.cc:76: Bind(callback, error, base::Owned(buffer.release()), bytes_read)); Can't do it with RunWhileLocked ...
7 years, 4 months ago (2013-08-03 02:20:27 UTC) #39
bbudge
https://codereview.chromium.org/18063005/diff/270001/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://codereview.chromium.org/18063005/diff/270001/ppapi/proxy/file_io_resource.cc#newcode72 ppapi/proxy/file_io_resource.cc:72: callback.Run(error, buffer.get(), bytes_read); David: is it safe to pass ...
7 years, 4 months ago (2013-08-06 20:58:05 UTC) #40
bbudge
I decided to explore optimizing only the blocking callback case. It looks much simpler and ...
7 years, 4 months ago (2013-08-07 19:05:38 UTC) #41
bbudge
OK I think this is ready. Thanks again for all your reviewing.
7 years, 4 months ago (2013-08-07 20:33:56 UTC) #42
bbudge
On 2013/08/07 20:33:56, bbudge1 wrote: > OK I think this is ready. Thanks again for ...
7 years, 4 months ago (2013-08-07 20:38:21 UTC) #43
dmichael (off chromium)
It kind of looks like you haven't added the heuristic of only getting the FD ...
7 years, 4 months ago (2013-08-08 17:44:43 UTC) #44
bbudge
I decided to skip the 'minimize fd's' optimization for all the reasons you state. I ...
7 years, 4 months ago (2013-08-08 18:44:31 UTC) #45
teravest
lgtm
7 years, 4 months ago (2013-08-08 19:31:35 UTC) #46
dmichael (off chromium)
Thanks, lgtm again https://chromiumcodereview.appspot.com/18063005/diff/284002/ppapi/proxy/file_io_resource.cc File ppapi/proxy/file_io_resource.cc (right): https://chromiumcodereview.appspot.com/18063005/diff/284002/ppapi/proxy/file_io_resource.cc#newcode291 ppapi/proxy/file_io_resource.cc:291: result = (bytes_read >= 0) ? ...
7 years, 4 months ago (2013-08-08 19:51:38 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/311001
7 years, 4 months ago (2013-08-08 20:05:19 UTC) #48
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=143782
7 years, 4 months ago (2013-08-08 22:12:57 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/311001
7 years, 4 months ago (2013-08-08 23:02:47 UTC) #50
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=143898
7 years, 4 months ago (2013-08-09 00:35:05 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/18063005/311001
7 years, 4 months ago (2013-08-09 01:18:02 UTC) #52
commit-bot: I haz the power
7 years, 4 months ago (2013-08-09 04:18:10 UTC) #53
Message was sent while issue was closed.
Change committed as 216569

Powered by Google App Engine
This is Rietveld 408576698