Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / browser / android / content_protocol_handler_impl.h
blobf593a84bb88897f96a91c649172d64d0c6b7521c
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.
5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_PROTOCOL_HANDLER_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_PROTOCOL_HANDLER_IMPL_H_
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"
13 class GURL;
15 namespace base {
16 class TaskRunner;
19 namespace net {
20 class NetworkDelegate;
21 class URLRequestJob;
24 namespace content {
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;
38 private:
39 const scoped_refptr<base::TaskRunner> content_task_runner_;
40 DISALLOW_COPY_AND_ASSIGN(ContentProtocolHandlerImpl);
43 } // namespace content
45 #endif // CONTENT_BROWSER_ANDROID_CONTENT_PROTOCOL_HANDLER_IMPL_H_