Index: services/file_manager/directory.mojom |
diff --git a/services/file_manager/directory.mojom b/services/file_manager/directory.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..33ef1b162c3c201f04f2df63f749ccead3f2f7b7 |
--- /dev/null |
+++ b/services/file_manager/directory.mojom |
@@ -0,0 +1,35 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+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
|
+ |
+import "services/file_manager/file.mojom"; |
+import "services/file_manager/types.mojom"; |
+ |
+// TODO(vtl): paths may be relative; should they allowed to be absolute? |
+// (currently not) |
+ |
+interface Directory { |
+ // Operations about "this" |Directory|: |
+ |
+ 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.
|
+ 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()
|
+ |
+ // Operations *in* "this" |Directory|: |
+ |
+ 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
|
+ => (Error error); |
+ 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
|
+ |
+ 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
|
+ |
+ // TODO(vtl): mkdir |
+ // TODO(vtl): rm/rmdir |
+ // TODO(vtl): directory "streaming"? |
Aaron Boodman
2015/02/06 04:41:57
Yeah, seems like for large directories, returning
|
+ // TODO(vtl): "make root" (i.e., prevent cd-ing, etc., to parent); note that |
+ // this would require a much more complicated implementation (e.g., it needs |
+ // to be "inherited" by OpenDirectory(), and the enforcement needs to be valid |
+ // even if the opened directory is subsequently moved -- e.g., closer to the |
+ // "root") |
+}; |