fix bug for geolocation and contents download
authorSeongjun Yim <se201.yim@samsung.com>
Sun, 7 Apr 2013 10:22:56 +0000 (19:22 +0900)
committerSeongjun Yim <se201.yim@samsung.com>
Sun, 7 Apr 2013 10:24:40 +0000 (19:24 +0900)
Change-Id: I71e0658e0cf75f83e68bbf902225e8b759c5d47d
Signed-off-by: Seongjun Yim <se201.yim@samsung.com>
src/controls/FWebCtrl_UserConfirmPopup.cpp
src/controls/FWebCtrl_WebDataHandler.cpp

index 8309036..9704492 100755 (executable)
@@ -280,12 +280,13 @@ _UserConfirmPopup::HandleUserAction(Eina_Bool allow)
        case USER_CONFIRM_GEOLOCATION:
        {
                Ewk_Geolocation_Permission_Request* pPolicy =  reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
-               ewk_geolocation_permission_request_set(pPolicy, allow);
                if (__pCheckButton->IsSelected())
                {
                        result r = AddGeolocationDb(pPolicy, static_cast < bool >(allow));
-                       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+                       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
                }
+CATCH:
+               ewk_geolocation_permission_request_set(pPolicy, allow);
                break;
        }
        default:
index 94d6300..6c8b720 100755 (executable)
@@ -60,18 +60,26 @@ _WebDataHandler::~_WebDataHandler(void)
 result
 _WebDataHandler::StartDownload(const String& url)
 {
-       SysLog(NID_WEB_CTRL, "Start Download %S", url.GetPointer());
+       SysLog(NID_WEB_CTRL, "The current value of url is %ls", url.GetPointer());
 
        SysTryReturnResult(NID_WEB_CTRL, __pHttpSession.get() == null, E_INVALID_OPERATION, "[%s] Already Downloading is in progress.", GetErrorMessage(E_INVALID_OPERATION));
 
        Uri baseUri;
        baseUri.SetUri(url);
-       ClearLastResult();
+
+       String domain(baseUri.GetScheme());
+       domain.Append(L"://");
+       domain.Append(baseUri.GetHost());
+       if (baseUri.GetPort() != -1)
+       {
+               domain.Append(L":");
+               domain.Append(Integer(baseUri.GetPort()).ToString());
+       }
 
        std::unique_ptr<HttpSession> pHttpSession(new (std::nothrow) HttpSession());
        SysTryReturnResult(NID_WEB_CTRL, pHttpSession.get() , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       result r = pHttpSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, baseUri.GetHost(), null);
+       result r = pHttpSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, domain, null);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] propogating.", GetErrorMessage(r));
 
        r = pHttpSession->SetAutoRedirectionEnabled(true);
@@ -248,7 +256,7 @@ _WebDataHandler::OnTransactionCompleted(HttpSession& httpSession, HttpTransactio
 void
 _WebDataHandler::OnTransactionCertVerificationRequiredN(HttpSession& httpSession, HttpTransaction& httpTransaction, String* pCert)
 {
-httpTransaction.Resume();
+       httpTransaction.Resume();
 
        delete pCert;
 }