From: Jihoon Chung Date: Thu, 17 Oct 2013 04:54:21 +0000 (+0900) Subject: Clean-up GlobalDAO (WhiteURIList) X-Git-Tag: accepted/tizen/20131024.223332~1^2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71684d0f45a9472eedb3ca3fbab4227377f18e7a;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Clean-up GlobalDAO (WhiteURIList) [Issue#] LINUXWRT-1029 [Problem] GlobalDAO has unnecessary API. [Cause] N/A [Solution] Remove "WhiteURIList" API - Tizen WRT doesn't support external uri(http, https) to use tizen web api. - Specially, uri which is declared in "WhiteURIList" allows to use tizen web api. - "WhiteURIList" supports long time ago, current tizen web api policy doesn't have external uri case. - Moreover, "WhiteURIList" needs new policy of ACE work-flow that change pkgID base to domain(external uri) base. As these reasons, remove "WhiteURIList" [Verification] Checking API usage - API is used in the WRT repo to check "WhiteURIList" to allow tizen web api in external uri. https://review.tizendev.org/gerrit/#/c/93252/ [SCMRequest] Must be imported with https://review.tizendev.org/gerrit/#/c/93252/ Change-Id: Iadd72d2ae35cb60b2f44abbf8f472c8bc2ed2b82 --- diff --git a/modules/widget_dao/dao/global_dao.cpp b/modules/widget_dao/dao/global_dao.cpp index dc543c4..7ba2c66 100644 --- a/modules/widget_dao/dao/global_dao.cpp +++ b/modules/widget_dao/dao/global_dao.cpp @@ -85,46 +85,6 @@ void GlobalDAO::SetRoamingDataUsage(GlobalDAO::NetworkAccessMode newMode) } } -void GlobalDAO::AddWhiteURI(const std::string &uri, bool subDomain) -{ - LogDebug("Add White URI : " << uri); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WidgetWhiteURIList::Row row; - row.Set_uri(DPL::FromASCIIString(uri)); - row.Set_subdomain_access(static_cast(subDomain)); - wrt::ScopedTransaction transaction(&WrtDatabase::interface()); - - WRT_DB_INSERT(insert, WidgetWhiteURIList, &WrtDatabase::interface()) - - insert->Values(row); - insert->Execute(); - transaction.Commit(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAO::Exception::DatabaseError, - "Failed to add white URI"); - } -} - -void GlobalDAO::RemoveWhiteURI(const std::string &uri) -{ - LogDebug("Remove White URI : " << uri); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - - WRT_DB_DELETE(deleteFrom, WidgetWhiteURIList, &WrtDatabase::interface()) - deleteFrom->Where(Equals(DPL::FromASCIIString( - uri))); - deleteFrom->Execute(); - } Catch(DPL::DB::SqlConnection::Exception::Base) { - ReThrowMsg(GlobalDAO::Exception::DatabaseError, - "Failed to removed white URI from AdultBlackList"); - } -} - void GlobalDAO::SetCookieSharingMode(bool mode) { LogDebug("updating Cookie Sharing mode to:" << mode); diff --git a/modules/widget_dao/dao/global_dao_read_only.cpp b/modules/widget_dao/dao/global_dao_read_only.cpp index 071ca43..bc26a49 100644 --- a/modules/widget_dao/dao/global_dao_read_only.cpp +++ b/modules/widget_dao/dao/global_dao_read_only.cpp @@ -142,33 +142,6 @@ DeviceCapabilitySet GlobalDAOReadOnly::GetDeviceCapability( } } -WidgetAccessInfoList GlobalDAOReadOnly::GetWhiteURIList() -{ - LogDebug("Getting WhiteURIList."); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, WidgetWhiteURIList, &WrtDatabase::interface()) - - WidgetAccessInfoList resultList; - typedef std::list RowList; - RowList list = select->GetRowList(); - - for (RowList::iterator i = list.begin(); i != list.end(); ++i) { - WidgetAccessInfo whiteURI; - whiteURI.strIRI = i->Get_uri(); - whiteURI.bSubDomains = i->Get_subdomain_access(); - resultList.push_back(whiteURI); - LogDebug("[uri] : " << whiteURI.strIRI << - ", [subdomain] : " << whiteURI.bSubDomains); - } - return resultList; - } Catch(DPL::DB::SqlConnection::Exception::Base) { - ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError, - "Failed to get whiteURI list"); - } -} - bool GlobalDAOReadOnly::GetCookieSharingMode() { LogDebug("Getting Cookie Sharing mode"); diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h index 986d7e8..7133cb7 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h @@ -58,8 +58,6 @@ class GlobalDAOReadOnly static bool GetSecureByDefault() DPL_DEPRECATED; - static WidgetAccessInfoList GetWhiteURIList() DPL_DEPRECATED; - static bool GetCookieSharingMode() DPL_DEPRECATED; enum NetworkAccessMode diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h index f4d8c9b..b71db8f 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h @@ -32,10 +32,6 @@ class GlobalDAO : public GlobalDAOReadOnly public: static void SetSecureByDefault(bool secureByDefault) DPL_DEPRECATED; - static void AddWhiteURI(const std::string &value, bool subDomain) DPL_DEPRECATED; - - static void RemoveWhiteURI(const std::string &uri) DPL_DEPRECATED; - /** * This method changes network access mode while roaming is enabled. * diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index b7bcf76..679eb52 100644 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -335,11 +335,6 @@ CREATE_TABLE(AppControlInfo) ) CREATE_TABLE_END() -CREATE_TABLE(WidgetWhiteURIList) - COLUMN_NOT_NULL(uri, VARCHAR(65536), primary key) - COLUMN_NOT_NULL(subdomain_access, INT, CHECK(subdomain_access between 0 and 1)) -CREATE_TABLE_END() - CREATE_TABLE(EncryptedResourceList) COLUMN_NOT_NULL(app_id, INT,) COLUMN_NOT_NULL(resource, TEXT,) @@ -350,12 +345,6 @@ CREATE_TABLE(EncryptedResourceList) ) CREATE_TABLE_END() -SQL( - INSERT INTO WidgetWhiteURIList VALUES("http://samsung.com", 1); - INSERT INTO WidgetWhiteURIList VALUES("http://orange.fr", 1); - INSERT INTO WidgetWhiteURIList VALUES("http://orange.co.uk", 1); -) - /*TODO: It will be removed when user agent is fixed. User agent MUST be configurable in development...*/ CREATE_TABLE(UserAgents) COLUMN_NOT_NULL(key_name, TEXT,)