From 9e3af881c5133a126c01c95d95f97421ee63f84e Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Mon, 20 Aug 2018 12:52:17 +0530 Subject: [PATCH] Enable encrypted app support. Use |WrtFileProtocolHandler| for handling the file schemas. Change-Id: Ia39034af94d7ebd332e7b9e1d38924499f5cafd9 Signed-off-by: k2.nagaraju --- atom/browser/atom_browser_context.cc | 25 ++++++++++++++++++---- .../wrt/wrt_file_protocol_handler.h | 13 ++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index a2ad39f..0d56c5f 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -44,6 +44,10 @@ #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))); diff --git a/vendor/brightray/vendor/libchromiumcontent/src/tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.h b/vendor/brightray/vendor/libchromiumcontent/src/tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.h index 6fab49f..2fd9a90 100644 --- a/vendor/brightray/vendor/libchromiumcontent/src/tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.h +++ b/vendor/brightray/vendor/libchromiumcontent/src/tizen_src/ewk/efl_integration/wrt/wrt_file_protocol_handler.h @@ -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& file_task_runner) - : file_task_runner_(file_task_runner) {} - ~WrtFileProtocolHandler() override {} + const scoped_refptr& 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; -- 2.7.4