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"
20 class NetworkDelegate
;
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
{
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
;
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_