| Index: content/browser/android/content_protocol_handler_impl.cc
|
| diff --git a/content/browser/android/content_protocol_handler_impl.cc b/content/browser/android/content_protocol_handler_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f5e5d208f8f55f0913b95aed48bb4b277675463c
|
| --- /dev/null
|
| +++ b/content/browser/android/content_protocol_handler_impl.cc
|
| @@ -0,0 +1,43 @@
|
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/android/content_protocol_handler_impl.h"
|
| +
|
| +#include "base/task_runner.h"
|
| +#include "content/browser/android/url_request_content_job.h"
|
| +#include "net/base/net_errors.h"
|
| +#include "net/url_request/url_request.h"
|
| +#include "net/url_request/url_request_error_job.h"
|
| +
|
| +namespace content {
|
| +
|
| +// static
|
| +ContentProtocolHandler* ContentProtocolHandler::Create(
|
| + const scoped_refptr<base::TaskRunner>& content_task_runner) {
|
| + return new ContentProtocolHandlerImpl(content_task_runner);
|
| +}
|
| +
|
| +ContentProtocolHandlerImpl::ContentProtocolHandlerImpl(
|
| + const scoped_refptr<base::TaskRunner>& content_task_runner)
|
| + : content_task_runner_(content_task_runner) {}
|
| +
|
| +ContentProtocolHandlerImpl::~ContentProtocolHandlerImpl() {}
|
| +
|
| +net::URLRequestJob* ContentProtocolHandlerImpl::MaybeCreateJob(
|
| + net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
|
| + if (!network_delegate) {
|
| + return new net::URLRequestErrorJob(
|
| + request, network_delegate, net::ERR_ACCESS_DENIED);
|
| + }
|
| + return new URLRequestContentJob(
|
| + request, network_delegate, base::FilePath(request->url().spec()),
|
| + content_task_runner_);
|
| +}
|
| +
|
| +bool ContentProtocolHandlerImpl::IsSafeRedirectTarget(
|
| + const GURL& location) const {
|
| + return false;
|
| +}
|
| +
|
| +} // namespace content
|
|
|