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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs_node.h

Issue 2156503002: [NaCl SDK] Expose Google Drive to nacl_io. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 (c) 2016 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 #ifndef LIBRARIES_NACL_IO_GOOGLEDRIVEFS_NODE_H_
6 #define LIBRARIES_NACL_IO_GOOGLEDRIVEFS_NODE_H_
7
8 #include <time.h>
9 #include <vector>
10
11 #include "nacl_io/error.h"
12
13 #include "nacl_io/filesystem.h"
14 #include "nacl_io/kernel_handle.h"
15 #include "nacl_io/path.h"
16
17 namespace nacl_io {
18
19 class GoogleDriveFsNode : public Node {
20 public:
21 GoogleDriveFsNode(Filesystem* filesystem, Path path);
22
23 Error GetDents(size_t offs, struct dirent* pdir, size_t size, int* out_bytes);
24 Error Write(const HandleAttr& attr,
25 const void* buf,
26 size_t count,
27 int* out_bytes);
28 Error FTruncate(off_t length);
29 Error Read(const HandleAttr& attr, void* buf, size_t count, int* out_bytes);
30 Error GetSize(off_t* out_size);
31 Error GetStat(struct stat* pstat);
32 Error Init(int open_flags);
33
34 private:
35 Error ReadHelper(int32_t start,
36 int32_t end,
37 void* out_buffer,
38 int32_t* out_bytes);
39 Error WriteHelper(const char* body_data, int32_t body_size);
40 Error GetModifiedTime(time_t* out_mtime);
41 Error CreateEmptyFile();
42 Error RequestDirent(const std::string& optional_page_token,
43 std::vector<std::string>* out_dirent_names);
44
45 std::string parent_dir_id_;
46 std::string item_id_;
47 Path path_;
48
49 friend class GoogleDriveFs;
50 };
51
52 } // namespace nacl_io
53
54 #endif // LIBRARIES_NACL_IO_GOOGLEDRIVEFS_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698