Setting custom timeout HTTP (Long polling) 25/105125/1 accepted/tizen/3.0/common/20161219.113538 accepted/tizen/3.0/ivi/20161219.012629 accepted/tizen/3.0/mobile/20161219.012535 accepted/tizen/3.0/tv/20161219.012557 accepted/tizen/3.0/wearable/20161219.012613 submit/tizen_3.0/20161216.083855
authormin7.choi <min7.choi@samsung.com>
Thu, 15 Dec 2016 12:28:06 +0000 (21:28 +0900)
committermin7.choi <min7.choi@samsung.com>
Thu, 15 Dec 2016 12:28:06 +0000 (21:28 +0900)
Change-Id: I37282aa22b62a1f83cbcf19bfd1bad46255ea2ca
Signed-off-by: min7.choi <min7.choi@samsung.com>
runtime/browser/web_application.cc
runtime/browser/web_application.h
runtime/browser/web_view.cc
runtime/browser/web_view.h
runtime/browser/web_view_impl.cc
runtime/browser/web_view_impl.h

index eb724258db2638129145b8e33dc4c4277bf4cdf2..47da126bcd3d97b2926630d43170b1fe4cdcc48c 100755 (executable)
@@ -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 <unsigned int> polling_val(app_data_->setting_info()->long_polling());
+    unsigned long *ptr =  reinterpret_cast <unsigned long *> (&polling_val.get());
+    view->SetLongPolling(*ptr);
+  }
 }
 
 bool WebApplication::OnDidNavigation(WebView* /*view*/,
index 8e72b25cc0b99a30ff4bffdb25fb145e5d8715ba..75b934ea14ec4844cc19336ef2a921a7b0610470 100755 (executable)
@@ -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
index 1d898a14b9d55a92b9d47c46fd90d309e5e4add1..c96a28f75042ed19e9586c15b05cd741689ee681 100644 (file)
@@ -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);
index be1bcc6093a8a32371c707f592d842d25662ec13..29a6fad764c402b6aa82aabf4f420ddd86baa606 100644 (file)
@@ -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
index 6ad4c2ae5fa85b008e65fc3d50ccb5f747cb03f4..9a4e38f8f969d12337b92c6d2f06b60859efe1a8 100644 (file)
@@ -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);
index 73c70c197e61a9c752f9d3856275de6bc1f4d642..eba77489d2c06ca8ddbde0da1da7898972687863 100644 (file)
@@ -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