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

Side by Side Diff: mojo/file_utils/file_util.h

Issue 1923573002: Convert //mojo/file_utils to use SynchronousInterfacePtr. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « mojo/file_utils/BUILD.gn ('k') | mojo/file_utils/file_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains utility functions around the mojo files service. 5 // This file contains utility functions around the mojo files service.
6 6
7 #ifndef MOJO_FILE_UTILS_FILE_UTIL_H_ 7 #ifndef MOJO_FILE_UTILS_FILE_UTIL_H_
8 #define MOJO_FILE_UTILS_FILE_UTIL_H_ 8 #define MOJO_FILE_UTILS_FILE_UTIL_H_
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "mojo/services/files/interfaces/directory.mojom.h" 12 #include "mojo/public/cpp/bindings/interface_handle.h"
13 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h"
14 #include "mojo/services/files/interfaces/directory.mojom-sync.h"
13 #include "mojo/services/files/interfaces/file.mojom.h" 15 #include "mojo/services/files/interfaces/file.mojom.h"
14 16
15 namespace file_utils { 17 namespace file_utils {
16 18
17 // Creates a new temp file, placed in the (input) directory |directory| along 19 // Creates a new temp file, placed in the (input) directory |directory| along
18 // with the (output) file location in |path_name|. This function blocks the 20 // with the (output) file location in |path_name|. This function blocks the
19 // calling thread, and there must not be any calls pending on the |directory| 21 // calling thread, and there must not be any calls pending on the |directory|
20 // when this function is called. 22 // when this function is called.
21 // Returns a FilePtr on success, and null on failure. 23 // Returns a FilePtr on success, and null on failure.
22 // On failure, |path_name| is unchanged. 24 // On failure, |path_name| is unchanged.
23 mojo::files::FilePtr CreateTemporaryFileInDir( 25 mojo::InterfaceHandle<mojo::files::File> CreateTemporaryFileInDir(
24 mojo::files::DirectoryPtr* directory, 26 mojo::SynchronousInterfacePtr<mojo::files::Directory>* directory,
25 std::string* path_name); 27 std::string* path_name);
26 28
27 } // namespace file_utils 29 } // namespace file_utils
28 30
29 #endif // MOJO_FILE_UTILS_FILE_UTIL_H_ 31 #endif // MOJO_FILE_UTILS_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/file_utils/BUILD.gn ('k') | mojo/file_utils/file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698