Upstream version 8.36.161.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / application_storage_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef XWALK_APPLICATION_BROWSER_APPLICATION_STORAGE_IMPL_H_
-#define XWALK_APPLICATION_BROWSER_APPLICATION_STORAGE_IMPL_H_
+#ifndef XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_H_
+#define XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_H_
 
 #include <set>
 #include <string>
@@ -28,14 +28,21 @@ class ApplicationStorageImpl {
   bool AddApplication(const ApplicationData* application,
                       const base::Time& install_time);
   bool RemoveApplication(const std::string& key);
+  bool ContainsApplication(const std::string& key);
   bool UpdateApplication(ApplicationData* application,
                          const base::Time& install_time);
-  bool Init(
-      ApplicationData::ApplicationDataMap& applications);
+  bool Init();
+
+  scoped_refptr<ApplicationData> GetApplicationData(const std::string& id);
   bool GetInstalledApplications(
-      ApplicationData::ApplicationDataMap& applications);
+      ApplicationData::ApplicationDataMap& applications);  // NOLINT
+
+  bool GetInstalledApplicationIDs(
+      std::vector<std::string>& app_ids);  // NOLINT
 
  private:
+  scoped_refptr<ApplicationData> ExtractApplicationData(
+      const sql::Statement& smt);
   bool UpgradeToVersion1(const base::FilePath& v0_file);
   bool SetApplicationValue(const ApplicationData* application,
                            const base::Time& install_time,
@@ -50,8 +57,6 @@ class ApplicationStorageImpl {
                          const StoredPermissionMap& permissions);
   bool RevokePermissions(const std::string& id);
 
-  bool CollectGarbageApplications();
-
   scoped_ptr<sql::Connection> sqlite_db_;
   sql::MetaTable meta_table_;
   base::FilePath data_path_;
@@ -61,4 +66,4 @@ class ApplicationStorageImpl {
 }  // namespace application
 }  // namespace xwalk
 
-#endif  // XWALK_APPLICATION_BROWSER_APPLICATION_STORAGE_IMPL_H_
+#endif  // XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_H_