From: min7.choi Date: Thu, 15 Dec 2016 12:28:06 +0000 (+0900) Subject: Setting custom timeout HTTP (Long polling) X-Git-Tag: submit/tizen_3.0/20161216.083855^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9ccdf51c14fae0176016b40bbe4dcfa73b9ccc5;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Setting custom timeout HTTP (Long polling) Change-Id: I37282aa22b62a1f83cbcf19bfd1bad46255ea2ca Signed-off-by: min7.choi --- diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index eb724258d..47da126bc 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -923,6 +923,14 @@ void WebApplication::SetupWebView(WebView* view) { view->SetCSPRule(csp_report_rule_, true); } } + +// Setup longpolling value + if (app_data_->setting_info() != NULL && + app_data_->setting_info()->long_polling()) { + boost::optional polling_val(app_data_->setting_info()->long_polling()); + unsigned long *ptr = reinterpret_cast (&polling_val.get()); + view->SetLongPolling(*ptr); + } } bool WebApplication::OnDidNavigation(WebView* /*view*/, diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 8e72b25cc..75b934ea1 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -117,6 +117,7 @@ class WebApplication : public WebView::EventListener { bool launched_; bool debug_mode_; bool verbose_mode_; + bool lang_changed_mode_; Ewk_Context* ewk_context_; bool has_ownership_of_ewk_context_; NativeWindow* window_; @@ -131,7 +132,6 @@ class WebApplication : public WebView::EventListener { int security_model_version_; std::string csp_rule_; std::string csp_report_rule_; - bool lang_changed_mode_; }; } // namespace runtime diff --git a/runtime/browser/web_view.cc b/runtime/browser/web_view.cc index 1d898a14b..c96a28f75 100644 --- a/runtime/browser/web_view.cc +++ b/runtime/browser/web_view.cc @@ -89,6 +89,10 @@ void WebView::SetDefaultEncoding(const std::string& encoding) { impl_->SetDefaultEncoding(encoding); } +void WebView::SetLongPolling(unsigned long longpolling) { + impl_->SetLongPolling(longpolling); +} + #ifdef PROFILE_WEARABLE void WebView::SetBGColor(int r, int g, int b, int a) { impl_->SetBGColor(r, g, b, a); diff --git a/runtime/browser/web_view.h b/runtime/browser/web_view.h index be1bcc609..29a6fad76 100644 --- a/runtime/browser/web_view.h +++ b/runtime/browser/web_view.h @@ -129,6 +129,7 @@ class WebView { bool SetUserAgent(const std::string& user_agent); void SetCSPRule(const std::string& rule, bool report_only); void SetDefaultEncoding(const std::string& encoding); + void SetLongPolling(unsigned long longpolling); #ifdef PROFILE_WEARABLE void SetBGColor(int r, int g, int b, int a); #endif diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index 6ad4c2ae5..9a4e38f8f 100644 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -1008,6 +1008,10 @@ void WebViewImpl::SetDefaultEncoding(const std::string& encoding) { } } +void WebViewImpl::SetLongPolling(unsigned long longpolling) { + ewk_view_session_timeout_set(ewk_view_, longpolling); +} + #ifdef PROFILE_WEARABLE void WebViewImpl::SetBGColor(int r, int g, int b, int a) { ewk_view_bg_color_set(ewk_view_, r, g, b, a); diff --git a/runtime/browser/web_view_impl.h b/runtime/browser/web_view_impl.h index 73c70c197..eba77489d 100644 --- a/runtime/browser/web_view_impl.h +++ b/runtime/browser/web_view_impl.h @@ -49,6 +49,7 @@ class WebViewImpl { bool SetUserAgent(const std::string& user_agent); void SetCSPRule(const std::string& rule, bool report_only); void SetDefaultEncoding(const std::string& encoding); + void SetLongPolling(unsigned long longpolling); #ifdef PROFILE_WEARABLE void SetBGColor(int r, int g, int b, int a); #endif