OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/android/content_protocol_handler_impl.h" |
| 6 |
| 7 #include "base/task_runner.h" |
| 8 #include "content/browser/android/url_request_content_job.h" |
| 9 #include "net/base/net_errors.h" |
| 10 #include "net/url_request/url_request.h" |
| 11 #include "net/url_request/url_request_error_job.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // static |
| 16 ContentProtocolHandler* ContentProtocolHandler::Create( |
| 17 const scoped_refptr<base::TaskRunner>& content_task_runner) { |
| 18 return new ContentProtocolHandlerImpl(content_task_runner); |
| 19 } |
| 20 |
| 21 ContentProtocolHandlerImpl::ContentProtocolHandlerImpl( |
| 22 const scoped_refptr<base::TaskRunner>& content_task_runner) |
| 23 : content_task_runner_(content_task_runner) {} |
| 24 |
| 25 ContentProtocolHandlerImpl::~ContentProtocolHandlerImpl() {} |
| 26 |
| 27 net::URLRequestJob* ContentProtocolHandlerImpl::MaybeCreateJob( |
| 28 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { |
| 29 if (!network_delegate) { |
| 30 return new net::URLRequestErrorJob( |
| 31 request, network_delegate, net::ERR_ACCESS_DENIED); |
| 32 } |
| 33 return new URLRequestContentJob( |
| 34 request, network_delegate, base::FilePath(request->url().spec()), |
| 35 content_task_runner_); |
| 36 } |
| 37 |
| 38 bool ContentProtocolHandlerImpl::IsSafeRedirectTarget( |
| 39 const GURL& location) const { |
| 40 return false; |
| 41 } |
| 42 |
| 43 } // namespace content |
OLD | NEW |