// 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>
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,
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_;
} // namespace application
} // namespace xwalk
-#endif // XWALK_APPLICATION_BROWSER_APPLICATION_STORAGE_IMPL_H_
+#endif // XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_H_