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

Unified Diff: native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs.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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs.h
diff --git a/native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs.h b/native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs.h
new file mode 100644
index 0000000000000000000000000000000000000000..d9bef4f0007222e7aa7dcd28b65889c267bbda49
--- /dev/null
+++ b/native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs.h
@@ -0,0 +1,37 @@
+// Copyright 2016 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.
+
+#include "nacl_io/filesystem.h"
+#include "nacl_io/typed_fs_factory.h"
+
+namespace nacl_io {
+
+class GoogleDriveFs : public Filesystem {
+ protected:
+ GoogleDriveFs();
+
+ Error Init(const FsInitArgs& args);
+
+ public:
+ Error OpenWithMode(const Path& path,
+ int open_flags,
+ mode_t mode,
+ ScopedNode* out_node);
+ Error Unlink(const Path& path);
+ Error Mkdir(const Path& path, int permissions);
+ Error Rmdir(const Path& path);
+ Error Remove(const Path& path);
+ Error Rename(const Path& path, const Path& newPath);
+
+ std::string token();
+
+ private:
+ Error IsEmptyDir(const std::string& dir_id, bool* out_is_empty_dir);
+
+ std::string token_;
+
+ friend class TypedFsFactory<GoogleDriveFs>;
+};
+
+} // namespace nacl_io

Powered by Google App Engine
This is Rietveld 408576698