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

Side by Side Diff: services/file_manager/directory.mojom

Issue 875643004: Prototype of Files service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: wipwipwip Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 module mojo.files;
sky 2015/02/06 15:54:46 nit: I would have expected files to match your dir
viettrungluu 2015/02/06 16:57:36 It's extremely natural for there to be other imple
6
7 import "services/file_manager/file.mojom";
8 import "services/file_manager/types.mojom";
9
10 // TODO(vtl): paths may be relative; should they allowed to be absolute?
11 // (currently not)
12
13 interface Directory {
14 // Operations about "this" |Directory|:
15
16 Read() => (Error error, array<FileInformation>? directory_contents);
jamesr 2015/02/06 05:15:43 in types.mojom FileInformation appears to only hav
viettrungluu 2015/02/06 06:20:41 Oops, yes.
17 Change(string path) => (Error error);
jamesr 2015/02/06 05:15:43 what does 'Change' do? does it modify what this |D
viettrungluu 2015/02/06 06:20:41 Yes (i.e., it's chdir). I thought it was confusing
sky 2015/02/06 15:54:46 Seems less confusing to me if a directory only eve
viettrungluu 2015/02/06 17:01:23 The idea was to make it easy to implement chdir()
18
19 // Operations *in* "this" |Directory|:
20
21 OpenFile(string path, File& file, uint32 access_flags, uint32 open_flags)
jamesr 2015/02/06 05:15:43 if you want to model accessing existing filesystem
viettrungluu 2015/02/06 06:20:41 For the purposes of Mojo apps, the latter seems be
22 => (Error error);
23 OpenDirectory(string path, Directory& directory) => (Error error);
jamesr 2015/02/06 05:15:43 is |path| only relative to this? can it contain mu
viettrungluu 2015/02/06 06:20:41 I imagine that it should be allowed to contain mul
24
25 Rename(string path, string new_path) => (Error error);
sky 2015/02/06 15:54:45 Raw strings for paths is always error prone. Maybe
viettrungluu 2015/02/06 16:57:36 I could go either way on this, though the reality
26
27 // TODO(vtl): mkdir
28 // TODO(vtl): rm/rmdir
29 // TODO(vtl): directory "streaming"?
Aaron Boodman 2015/02/06 04:41:57 Yeah, seems like for large directories, returning
30 // TODO(vtl): "make root" (i.e., prevent cd-ing, etc., to parent); note that
31 // this would require a much more complicated implementation (e.g., it needs
32 // to be "inherited" by OpenDirectory(), and the enforcement needs to be valid
33 // even if the opened directory is subsequently moved -- e.g., closer to the
34 // "root")
35 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698