Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / id_util.h
index 589cff0..3b68ac8 100644 (file)
@@ -15,15 +15,6 @@ class FilePath;
 
 namespace xwalk {
 namespace application {
-
-// The number of bytes in a legal id.
-extern const size_t kIdSize;
-
-#if defined(OS_TIZEN)
-// The number of bytes in a legal legacy Tizen id.
-extern const size_t kLegacyTizenIdSize;
-#endif
-
 // Generates an application ID from arbitrary input. The same input string will
 // always generate the same output ID.
 std::string GenerateId(const std::string& input);
@@ -32,25 +23,18 @@ std::string GenerateId(const std::string& input);
 // Used while developing applications, before they have a key.
 std::string GenerateIdForPath(const base::FilePath& path);
 
+// Checks to see if the application has a valid ID.
+bool IsValidApplicationID(const std::string& id);
+
 #if defined(OS_TIZEN)
-// If this appid is a xpk app id(crosswalk_32bytes_app_id), return itself.
-// If this appid is a wgt app id(tizen_app_id), convert it to
-// crosswalk_32bytes_app_id and return it.
-std::string RawAppIdToCrosswalkAppId(const std::string& id);
-
-// If this appid is a xpk app id(crosswalk_32bytes_app_id), return
-// xwalk.crosswalk_32bytes_app_id.
-// If this appid is a wgt app id(tizen_app_id), return itself.
-// It is better to storage crosswalk_32bytes_app_id on tizen pkgmgr db
-// for xpk, but it must be an "." on appid or it cannot insert to tizen pkgmgr
-// db, so we have to have a "xwalk." as it's prefix.
-std::string RawAppIdToAppIdForTizenPkgmgrDB(const std::string& id);
-// Does the opposite to the above function.
-std::string TizenPkgmgrDBAppIdToRawAppId(const std::string& id);
-
-// For xpk, app_id == crosswalk_32bytes_app_id == this->ID(),
-// For wgt, app_id == tizen_wrt_10bytes_package_id.app_name,
-std::string GetTizenAppId(ApplicationData* application);
+bool IsValidWGTID(const std::string& id);
+bool IsValidXPKID(const std::string& id);
+bool IsValidPkgID(const std::string& id);
+
+std::string AppIdToPkgId(const std::string& id);
+
+// Caution! This method fetches from database
+std::string PkgIdToAppId(const std::string& id);
 #endif
 
 }  // namespace application