#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 {
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)));
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;