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

Issue 875643004: Prototype of Files service. (Closed)

Created:
5 years, 11 months ago by viettrungluu
Modified:
5 years, 9 months ago
Reviewers:
jamesr, qsr
CC:
abarth-chromium, Aaron Boodman, ben+mojo_chromium.org, darin (slow to review), mojo-reviews_chromium.org, qsr, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, sky
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Prototype of Files service. Defines two important interfaces, Directory and File. Provides a basic, single-threaded implementation of the latter (with a few omissions), an extremely incomplete implementation of the former (more complete implementation to follow soon, with tests), and a root Files interface/application. Limitations: * Directory isn't really implemented. * Makes no security guarantees -- i.e., definitely insecure (doesn't prevent path traversal "out of" a "file system"). * Not implemented: file streaming (read/write), file mapping, file re-opening. * Various other flags not implemented (e.g., recursive delete). * Theoretical implementation: many things as yet totally untested. * Single-threaded. Should be easy enough to move to a thread pool (but note that operations still need to be sequenced within each "object"/message pipe). * Still not specified (but definitely desired): directory streaming. * Still need more error codes. * Still needs more comments and documentation. Changes over previous iterations: * Temporarily removed most of (totally untested) Directory implementation. * "file manager" -> "files". * Introduced a Timespec struct (and nanosecond resolution). * Turned persistent, shared "user" directory into a "debug" directory. * Various other requested features added/changes made. Open questions: * There's some duplication between Directory and File (e.g., they both have Stat()). Perhaps it'd be more POSIX-y to combine them? * Semantics for "chroot"-type operations and "re-open" operations. * (Lots of thinking with respect to security in general.) R=qsr@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/2a394496d9f098564e3a52cc62c937801dd1b1f0

Patch Set 1 #

Patch Set 2 : oops #

Patch Set 3 : wipwipwip #

Total comments: 19

Patch Set 4 : Directory: remove Change(); add Stat() and Touch(); fix Read() #

Patch Set 5 : Directory: make OpenFile()'s |file| arg optional; add flags to OpenDirectory(); add Delete() #

Total comments: 15

Patch Set 6 : ReadStream -> ReadToStream, WriteStream -> WriteFromStream #

Patch Set 7 : Implement File::Stat() #

Patch Set 8 : Timespec #

Patch Set 9 : num_bytes_to_read for ReadToStream #

Patch Set 10 : Implement File::Touch() #

Patch Set 11 : stat and touch for dirs #

Patch Set 12 : asdf #

Patch Set 13 : jkl #

Patch Set 14 : OpenDirectory, theoretically #

Patch Set 15 : DirectoryImpl::Read, theoretically #

Patch Set 16 : DirectoryImpl::Delete, theoretically #

Patch Set 17 : format #

Patch Set 18 : include sys.stat.h for UTIME_OMIT, etc. #

Patch Set 19 : Home -> Debug #

Patch Set 20 : FileManager -> Files, etc. #

Patch Set 21 : android fix #1 #

Patch Set 22 : android fix #2 #

Patch Set 23 : oops #

Patch Set 24 : doh #

Patch Set 25 : I am an idiot #

Patch Set 26 : a3 #

Patch Set 27 : moar tests #

Patch Set 28 : Remove much of DirectoryImpl implementation until I write tests. #

Total comments: 28

Patch Set 29 : asdf #

Patch Set 30 : moar comments #

Total comments: 24

Patch Set 31 : review comments #

Patch Set 32 : already ignored EINTR #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1816 lines, -27 lines) Patch
M mojo/BUILD.gn 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 1 chunk +1 line, -0 lines 0 comments Download
M mojo/tools/data/apptests 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 1 chunk +3 lines, -0 lines 0 comments Download
M services/BUILD.gn 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 31 1 chunk +1 line, -0 lines 0 comments Download
A + services/files/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +20 lines, -21 lines 0 comments Download
A services/files/directory.mojom 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 1 chunk +63 lines, -0 lines 0 comments Download
A services/files/directory_impl.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 29 30 1 chunk +64 lines, -0 lines 0 comments Download
A services/files/directory_impl.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 1 chunk +194 lines, -0 lines 0 comments Download
A services/files/file.mojom 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 1 chunk +85 lines, -0 lines 0 comments Download
A services/files/file_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +69 lines, -0 lines 0 comments Download
A services/files/file_impl.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 31 1 chunk +364 lines, -0 lines 0 comments Download
A services/files/files.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +22 lines, -0 lines 0 comments Download
A services/files/files_apptest.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 1 chunk +461 lines, -0 lines 0 comments Download
A services/files/files_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +38 lines, -0 lines 0 comments Download
A services/files/files_impl.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 1 chunk +99 lines, -0 lines 0 comments Download
A services/files/futimens.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 1 chunk +26 lines, -0 lines 0 comments Download
A + services/files/futimens_android.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 1 chunk +5 lines, -6 lines 0 comments Download
A services/files/main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +44 lines, -0 lines 0 comments Download
A services/files/types.mojom 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 1 chunk +99 lines, -0 lines 0 comments Download
A services/files/util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +55 lines, -0 lines 0 comments Download
A services/files/util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +103 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (8 generated)
abarth-chromium
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/file.mojom File services/file_manager/file.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/file.mojom#newcode43 services/file_manager/file.mojom:43: => (Error error); I imagine we'll want to be ...
5 years, 10 months ago (2015-02-06 04:38:35 UTC) #2
Aaron Boodman
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom#newcode29 services/file_manager/directory.mojom:29: // TODO(vtl): directory "streaming"? Yeah, seems like for large ...
5 years, 10 months ago (2015-02-06 04:41:58 UTC) #4
jamesr
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom#newcode16 services/file_manager/directory.mojom:16: Read() => (Error error, array<FileInformation>? directory_contents); in types.mojom FileInformation ...
5 years, 10 months ago (2015-02-06 05:15:43 UTC) #5
viettrungluu
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom#newcode16 services/file_manager/directory.mojom:16: Read() => (Error error, array<FileInformation>? directory_contents); On 2015/02/06 05:15:43, ...
5 years, 10 months ago (2015-02-06 06:20:41 UTC) #6
qsr
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/file.mojom File services/file_manager/file.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/file.mojom#newcode23 services/file_manager/file.mojom:23: ReadStream(handle<data_pipe_producer> source, int64 offset, Whence whence) When does those ...
5 years, 10 months ago (2015-02-06 10:54:55 UTC) #8
sky
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom#newcode5 services/file_manager/directory.mojom:5: module mojo.files; nit: I would have expected files to ...
5 years, 10 months ago (2015-02-06 15:54:46 UTC) #10
viettrungluu
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom#newcode5 services/file_manager/directory.mojom:5: module mojo.files; On 2015/02/06 15:54:46, sky wrote: > nit: ...
5 years, 10 months ago (2015-02-06 16:57:36 UTC) #11
viettrungluu
https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/40001/services/file_manager/directory.mojom#newcode17 services/file_manager/directory.mojom:17: Change(string path) => (Error error); On 2015/02/06 15:54:46, sky ...
5 years, 10 months ago (2015-02-06 17:01:23 UTC) #12
darin (slow to review)
https://codereview.chromium.org/875643004/diff/80001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/80001/services/file_manager/directory.mojom#newcode17 services/file_manager/directory.mojom:17: Read() => (Error error, array<DirectoryEntry>? directory_contents); note, this kind ...
5 years, 10 months ago (2015-02-06 23:36:11 UTC) #14
vtl
https://codereview.chromium.org/875643004/diff/80001/services/file_manager/directory.mojom File services/file_manager/directory.mojom (right): https://codereview.chromium.org/875643004/diff/80001/services/file_manager/directory.mojom#newcode17 services/file_manager/directory.mojom:17: Read() => (Error error, array<DirectoryEntry>? directory_contents); On 2015/02/06 23:36:11, ...
5 years, 10 months ago (2015-02-06 23:51:50 UTC) #16
darin (slow to review)
https://codereview.chromium.org/875643004/diff/80001/services/file_manager/file.mojom File services/file_manager/file.mojom (right): https://codereview.chromium.org/875643004/diff/80001/services/file_manager/file.mojom#newcode23 services/file_manager/file.mojom:23: ReadStream(handle<data_pipe_producer> source, int64 offset, Whence whence) On 2015/02/06 23:51:50, ...
5 years, 10 months ago (2015-02-07 00:05:54 UTC) #17
viettrungluu
OK, ready for initial review. -> jamesr, who (I) "volunteered"; everyone else to CC
5 years, 9 months ago (2015-02-27 18:38:23 UTC) #19
qsr
https://codereview.chromium.org/875643004/diff/530001/services/files/directory.mojom File services/files/directory.mojom (right): https://codereview.chromium.org/875643004/diff/530001/services/files/directory.mojom#newcode17 services/files/directory.mojom:17: // TODO(vtl): Should we have a "close" method? Isn't ...
5 years, 9 months ago (2015-03-02 12:46:40 UTC) #21
viettrungluu
https://codereview.chromium.org/875643004/diff/530001/services/files/directory.mojom File services/files/directory.mojom (right): https://codereview.chromium.org/875643004/diff/530001/services/files/directory.mojom#newcode17 services/files/directory.mojom:17: // TODO(vtl): Should we have a "close" method? On ...
5 years, 9 months ago (2015-03-02 18:11:00 UTC) #22
viettrungluu
qsr -- do you want to review this (instead of jamesr)? (Keep in mind that ...
5 years, 9 months ago (2015-03-03 05:30:26 UTC) #23
qsr
https://codereview.chromium.org/875643004/diff/530001/services/files/file.mojom File services/files/file.mojom (right): https://codereview.chromium.org/875643004/diff/530001/services/files/file.mojom#newcode16 services/files/file.mojom:16: Close() => (Error err); On 2015/03/02 18:10:59, viettrungluu wrote: ...
5 years, 9 months ago (2015-03-03 11:56:45 UTC) #24
viettrungluu
Thanks, PTAL. https://codereview.chromium.org/875643004/diff/530001/services/files/file.mojom File services/files/file.mojom (right): https://codereview.chromium.org/875643004/diff/530001/services/files/file.mojom#newcode16 services/files/file.mojom:16: Close() => (Error err); On 2015/03/03 11:56:44, ...
5 years, 9 months ago (2015-03-03 18:50:36 UTC) #25
qsr
lgtm https://codereview.chromium.org/875643004/diff/570001/services/files/directory.mojom File services/files/directory.mojom (right): https://codereview.chromium.org/875643004/diff/570001/services/files/directory.mojom#newcode58 services/files/directory.mojom:58: // "root") On 2015/03/03 18:50:35, viettrungluu wrote: > ...
5 years, 9 months ago (2015-03-04 15:10:19 UTC) #26
viettrungluu
5 years, 9 months ago (2015-03-04 16:03:26 UTC) #27
Message was sent while issue was closed.
Committed patchset #32 (id:610001) manually as
2a394496d9f098564e3a52cc62c937801dd1b1f0 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698