[M69 Dev][TV] Support URL parsing for web app 53/191053/6
authorUzair <uzair.jaleel@samsung.com>
Thu, 11 Oct 2018 05:05:15 +0000 (22:05 -0700)
committerBot Blink <blinkbot@samsung.com>
Mon, 19 Nov 2018 08:13:04 +0000 (08:13 +0000)
Below patch adds web app url parsing functionality
needed to display basic web app on TV.

Change-Id: I8375fc7768e0bb3ac8d0effe73620ad41deb2f7e
Signed-off-by: Uzair <uzair.jaleel@samsung.com>
tizen_src/ewk/efl_integration/wrt/wrt_dynamicplugin.cc
tizen_src/ewk/efl_integration/wrt/wrt_dynamicplugin.h
tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.cc

index dd800bd..312827e 100644 (file)
 #include "common/content_switches_efl.h"
 
 namespace {
-const char* const URL_PARSING_FUNCTION = "DynamicUrlParsing";
+
 const char* const SET_WIDGET_INFO_FUNCTION = "DynamicSetWidgetInfo";
 const char* const DATABASE_ATTACH_FUNCTION = "DynamicDatabaseAttach";
+#if defined(OS_TIZEN_TV_PRODUCT)
+const char* const URL_PARSING_FUNCTION = "DynamicTVUrlParsing";
+#else
+const char* const URL_PARSING_FUNCTION = "DynamicUrlParsing";
+#endif
 
 typedef void (*StartSessionFun_v0)(const char* tizen_app_id,
                                    v8::Handle<v8::Context> context,
@@ -90,11 +95,16 @@ void WrtDynamicPlugin::StopSession(const char* tizen_app_id,
 
 void WrtDynamicPlugin::ParseURL(std::string* old_url,
                                 std::string* new_url,
-                                const char* tizen_app_id) {
+                                const char* tizen_app_id,
+                                bool* is_encrypted_file) {
   if (!parseURL_ || !database_attach_)
     return;
 
+#if defined(OS_TIZEN_TV_PRODUCT)
+  parseURL_(old_url, new_url, tizen_app_id, is_encrypted_file);
+#else
   parseURL_(old_url, new_url, tizen_app_id);
+#endif
 }
 
 void WrtDynamicPlugin::SetWidgetInfo(const std::string& tizen_app_id) {
index adf55ec..b34c74f 100644 (file)
 struct Ewk_Wrt_Message_Data;
 
 typedef void (*OnIPCMessageFun)(const Ewk_Wrt_Message_Data& data);
+#if defined(OS_TIZEN_TV_PRODUCT)
+typedef void (*ParseUrlFun)(std::string* old_url,
+                            std::string* new_url,
+                            const char* tizen_app_id,
+                            bool* is_encrypted_file);
+#else
 typedef void (*ParseUrlFun)(std::string* old_url,
                             std::string* new_url,
                             const char* tizen_app_id);
+#endif
 typedef void (*SetWidgetInfoFun)(const char* tizen_app_id);
 typedef void (*DatabaseAttachFun)(int database_attach);
 
@@ -32,7 +39,8 @@ class WrtDynamicPlugin : public DynamicPlugin {
 
   void ParseURL(std::string* old_url,
                 std::string* new_url,
-                const char* tizen_app_id);
+                const char* tizen_app_id,
+                bool* is_encrypted_file = nullptr);
 
   void SetWidgetInfo(const std::string& tizen_app_id);
   void MessageReceived(const Ewk_Wrt_Message_Data& data);
index 99d51dd..d0d21f6 100644 (file)
@@ -59,8 +59,12 @@ bool WrtFileProtocolHandler::GetWrtParsedUrl(const GURL& url,
 
   std::string url_str = url.possibly_invalid_spec();
   std::string parsed_url_str;
-  WrtDynamicPlugin::instance().ParseURL(&url_str, &parsed_url_str,
-                                        tizen_app_id.c_str());
+  bool is_encrypted_file;
+  // Need to check if variable is_encrypted_file is needed or not
+  // if we do not pass is_encrypted_file to ParseURL() we observe
+  // that code flow is blocked before ParseURL().
+  WrtDynamicPlugin::instance().ParseURL(
+      &url_str, &parsed_url_str, tizen_app_id.c_str(), &is_encrypted_file);
   if (!parsed_url_str.empty()) {
     parsed_url = GURL(parsed_url_str);
     return true;