OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebDocumentSubresourceFilter_h | 5 #ifndef WebDocumentSubresourceFilter_h |
6 #define WebDocumentSubresourceFilter_h | 6 #define WebDocumentSubresourceFilter_h |
7 | 7 |
| 8 #include "public/platform/WebDocumentSubresourceFilterLoadPolicy.h" |
8 #include "public/platform/WebURLRequest.h" | 9 #include "public/platform/WebURLRequest.h" |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 class WebURL; | 13 class WebURL; |
13 | 14 |
14 class WebDocumentSubresourceFilter { | 15 class WebDocumentSubresourceFilter { |
15 public: | 16 public: |
16 enum LoadPolicy { Allow, Disallow, WouldDisallow }; | |
17 virtual ~WebDocumentSubresourceFilter() {} | 17 virtual ~WebDocumentSubresourceFilter() {} |
18 virtual LoadPolicy getLoadPolicy(const WebURL& resourceUrl, | 18 |
19 WebURLRequest::RequestContext) = 0; | 19 virtual WebDocumentSubresourceFilterLoadPolicy getLoadPolicy( |
| 20 const WebURL& resourceUrl, |
| 21 WebURLRequest::RequestContext) = 0; |
20 | 22 |
21 // Report that a resource loaded by the document (not a preload) was | 23 // Report that a resource loaded by the document (not a preload) was |
22 // disallowed. | 24 // disallowed. |
23 virtual void reportDisallowedLoad() = 0; | 25 virtual void reportDisallowedLoad() = 0; |
24 }; | 26 }; |
25 | 27 |
26 } // namespace blink | 28 } // namespace blink |
27 | 29 |
28 #endif // WebDocumentSubresourceFilter_h | 30 #endif // WebDocumentSubresourceFilter_h |
OLD | NEW |