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 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_PROTOCOL_HANDLER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_CONTENT_PROTOCOL_HANDLER_IMPL_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/public/browser/android/content_protocol_handler.h" |
| 12 |
| 13 class GURL; |
| 14 |
| 15 namespace base { |
| 16 class TaskRunner; |
| 17 } |
| 18 |
| 19 namespace net { |
| 20 class NetworkDelegate; |
| 21 class URLRequestJob; |
| 22 } |
| 23 |
| 24 namespace content { |
| 25 |
| 26 // Implements a ProtocolHandler for content scheme jobs. If |network_delegate_| |
| 27 // is NULL, then all file requests will fail with ERR_ACCESS_DENIED. |
| 28 class ContentProtocolHandlerImpl : public ContentProtocolHandler { |
| 29 public: |
| 30 explicit ContentProtocolHandlerImpl( |
| 31 const scoped_refptr<base::TaskRunner>& content_task_runner); |
| 32 ~ContentProtocolHandlerImpl() override; |
| 33 net::URLRequestJob* MaybeCreateJob( |
| 34 net::URLRequest* request, |
| 35 net::NetworkDelegate* network_delegate) const override; |
| 36 bool IsSafeRedirectTarget(const GURL& location) const override; |
| 37 |
| 38 private: |
| 39 const scoped_refptr<base::TaskRunner> content_task_runner_; |
| 40 DISALLOW_COPY_AND_ASSIGN(ContentProtocolHandlerImpl); |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_BROWSER_ANDROID_CONTENT_PROTOCOL_HANDLER_IMPL_H_ |
OLD | NEW |