Index: chrome/browser/chromeos/gdata/gdata_leveldb.h |
=================================================================== |
--- chrome/browser/chromeos/gdata/gdata_leveldb.h (revision 0) |
+++ chrome/browser/chromeos/gdata/gdata_leveldb.h (revision 0) |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2012 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. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_LEVELDB_H_ |
+#define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_LEVELDB_H_ |
+#pragma once |
+ |
+#include <leveldb/db.h> |
+#include <string> |
+ |
+#include "chrome/browser/chromeos/gdata/gdata_db.h" |
+ |
+namespace gdata { |
+ |
+class GDataLevelDB : public GDataDB { |
+ public: |
+ GDataLevelDB(); |
+ virtual ~GDataLevelDB(); |
+ |
+ void Init(const FilePath& db_path); |
+ |
+ // GDataDB implementation. |
+ virtual Status Put(const GDataEntry& file) OVERRIDE; |
+ virtual Status DeleteByResourceId(const std::string& resource_id) OVERRIDE; |
+ virtual Status DeleteByPath(const std::string& path) OVERRIDE; |
+ virtual Status GetByResourceId(const std::string& resource_id, |
+ scoped_ptr<GDataEntry>* file) OVERRIDE; |
+ virtual Status GetByPath(const std::string& path, |
+ scoped_ptr<GDataEntry>* file) OVERRIDE; |
+ virtual scoped_ptr<GDataDBIter> NewIterator(const std::string& path) OVERRIDE; |
+ |
+ private: |
+ // Returns |resource_id| for |path| by looking up path_db_. |
+ Status ResourceIdForPath(const std::string& path, std::string* resource_id); |
+ |
+ scoped_ptr<leveldb::DB> main_db_; |
+ scoped_ptr<leveldb::DB> path_db_; |
+}; |
+ |
+} // namespace gdata |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_LEVELDB_H_ |
Property changes on: chrome/browser/chromeos/gdata/gdata_leveldb.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |