Enable encrypted app support. 30/187130/4
authork2.nagaraju <k2.nagaraju@samsung.com>
Mon, 20 Aug 2018 07:22:17 +0000 (12:52 +0530)
committerjaekuk lee <juku1999@samsung.com>
Tue, 21 Aug 2018 00:47:04 +0000 (00:47 +0000)
Use |WrtFileProtocolHandler| for handling the file schemas.

Change-Id: Ia39034af94d7ebd332e7b9e1d38924499f5cafd9
Signed-off-by: k2.nagaraju <k2.nagaraju@samsung.com>
atom/browser/atom_browser_context.cc
vendor/brightray/vendor/libchromiumcontent/src/tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.h

index a2ad39fdfeb45f8e6213684ea2dea866b0851f79..0d56c5f7bcfae940f1247d10ecf4bf505fb647f6 100644 (file)
 #include "net/url_request/url_request_intercepting_job_factory.h"
 #include "url/url_constants.h"
 
+#if defined(OS_TIZEN)
+#include "tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.h"
+#endif
+
 using content::BrowserThread;
 
 namespace atom {
@@ -126,10 +130,23 @@ AtomBrowserContext::CreateURLRequestJobFactory(
                                   base::WrapUnique(new AboutProtocolHandler));
   job_factory->SetProtocolHandler(
       url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
-  job_factory->SetProtocolHandler(
-      url::kFileScheme, base::WrapUnique(new asar::AsarProtocolHandler(
-          BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
-              base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
+#if defined(OS_TIZEN)
+  auto app_data = common::ApplicationDataManager::GetCurrentAppData();
+  if (app_data && app_data->IsElectronApp()) {
+#endif
+    job_factory->SetProtocolHandler(
+        url::kFileScheme, base::WrapUnique(new asar::AsarProtocolHandler(
+            BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
+                base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
+#if defined(OS_TIZEN)
+  } else {
+    job_factory->SetProtocolHandler(
+        url::kFileScheme, base::WrapUnique(new net::WrtFileProtocolHandler(
+            BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
+                base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
+  }
+#endif
+
   job_factory->SetProtocolHandler(
       url::kHttpScheme,
       base::WrapUnique(new HttpProtocolHandler(url::kHttpScheme)));
index 6fab49fc45ca289b1bcaa648c7c6f9618ae0e985..2fd9a90db96ea7f026024fbe1b8358edbf5fc00a 100644 (file)
@@ -19,21 +19,16 @@ namespace net {
 class NetworkDelegate;
 class URLRequestJob;
 
-class WrtFileProtocolHandler
+class __attribute__((visibility("default"))) WrtFileProtocolHandler
     : public URLRequestJobFactory::ProtocolHandler {
  public:
   explicit WrtFileProtocolHandler(
-      const scoped_refptr<base::TaskRunner>& file_task_runner)
-      : file_task_runner_(file_task_runner) {}
-  ~WrtFileProtocolHandler() override {}
+      const scoped_refptr<base::TaskRunner>& file_task_runner);
+  ~WrtFileProtocolHandler() override;
   URLRequestJob* MaybeCreateJob(
       URLRequest* request,
       NetworkDelegate* network_delegate) const override;
-  /* LCOV_EXCL_START */
-  bool IsSafeRedirectTarget(const GURL& location) const override {
-    return false;
-  }
-  /* LCOV_EXCL_STOP */
+  bool IsSafeRedirectTarget(const GURL& location) const override;
 
  private:
   bool GetWrtParsedUrl(const GURL& url, GURL& parsed_url) const;