LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 2006-2016 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006-2016 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer.· | 10 * notice, this list of conditions and the following disclaimer.· |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "FrameLoaderTypes.h" | 32 #include "FrameLoaderTypes.h" |
33 #include "ResourceRequest.h" | 33 #include "ResourceRequest.h" |
34 #include <wtf/text/WTFString.h> | 34 #include <wtf/text/WTFString.h> |
35 | 35 |
36 #if ENABLE(CONTENT_FILTERING) | 36 #if ENABLE(CONTENT_FILTERING) |
37 #include "ContentFilterUnblockHandler.h" | 37 #include "ContentFilterUnblockHandler.h" |
38 #endif | 38 #endif |
39 | 39 |
40 namespace WTF { | 40 namespace WTF { |
41 template<typename> class CompletionHandler; | 41 template<typename> class CompletionHandler; |
| 42 class CompletionHandlerCallingScope; |
42 } | 43 } |
43 | 44 |
44 namespace WebCore { | 45 namespace WebCore { |
45 | 46 |
46 class DocumentLoader; | 47 class DocumentLoader; |
47 class FormState; | 48 class FormState; |
48 class Frame; | 49 class Frame; |
49 class NavigationAction; | 50 class NavigationAction; |
50 class ResourceError; | 51 class ResourceError; |
51 class ResourceResponse; | 52 class ResourceResponse; |
(...skipping 11 matching lines...) Expand all Loading... |
63 using NavigationPolicyDecisionFunction = CompletionHandler<void(ResourceRequest&
&, FormState*, ShouldContinue)>; | 64 using NavigationPolicyDecisionFunction = CompletionHandler<void(ResourceRequest&
&, FormState*, ShouldContinue)>; |
64 | 65 |
65 class PolicyChecker { | 66 class PolicyChecker { |
66 WTF_MAKE_NONCOPYABLE(PolicyChecker); | 67 WTF_MAKE_NONCOPYABLE(PolicyChecker); |
67 WTF_MAKE_FAST_ALLOCATED; | 68 WTF_MAKE_FAST_ALLOCATED; |
68 public: | 69 public: |
69 explicit PolicyChecker(Frame&); | 70 explicit PolicyChecker(Frame&); |
70 | 71 |
71 void checkNavigationPolicy(ResourceRequest&&, bool didReceiveRedirectRespons
e, DocumentLoader*, FormState*, NavigationPolicyDecisionFunction&&, PolicyDecisi
onMode = PolicyDecisionMode::Asynchronous); | 72 void checkNavigationPolicy(ResourceRequest&&, bool didReceiveRedirectRespons
e, DocumentLoader*, FormState*, NavigationPolicyDecisionFunction&&, PolicyDecisi
onMode = PolicyDecisionMode::Asynchronous); |
72 void checkNavigationPolicy(ResourceRequest&&, bool didReceiveRedirectRespons
e, NavigationPolicyDecisionFunction&&); | 73 void checkNavigationPolicy(ResourceRequest&&, bool didReceiveRedirectRespons
e, NavigationPolicyDecisionFunction&&); |
73 void checkNewWindowPolicy(NavigationAction&&, const ResourceRequest&, FormSt
ate*, const String& frameName, NewWindowPolicyDecisionFunction&&); | 74 void checkNewWindowPolicy(NavigationAction&&, ResourceRequest&&, FormState*,
const String& frameName, NewWindowPolicyDecisionFunction&&); |
74 | 75 |
75 void stopCheck(); | 76 void stopCheck(); |
76 | 77 |
77 void cannotShowMIMEType(const ResourceResponse&); | 78 void cannotShowMIMEType(const ResourceResponse&); |
78 | 79 |
79 FrameLoadType loadType() const { return m_loadType; } | 80 FrameLoadType loadType() const { return m_loadType; } |
80 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } | 81 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } |
81 | 82 |
82 bool delegateIsDecidingNavigationPolicy() const { return m_delegateIsDecidin
gNavigationPolicy; } | 83 bool delegateIsDecidingNavigationPolicy() const { return m_delegateIsDecidin
gNavigationPolicy; } |
83 bool delegateIsHandlingUnimplementablePolicy() const { return m_delegateIsHa
ndlingUnimplementablePolicy; } | 84 bool delegateIsHandlingUnimplementablePolicy() const { return m_delegateIsHa
ndlingUnimplementablePolicy; } |
84 | 85 |
85 #if ENABLE(CONTENT_FILTERING) | 86 #if ENABLE(CONTENT_FILTERING) |
86 void setContentFilterUnblockHandler(ContentFilterUnblockHandler unblockHandl
er) { m_contentFilterUnblockHandler = WTFMove(unblockHandler); } | 87 void setContentFilterUnblockHandler(ContentFilterUnblockHandler unblockHandl
er) { m_contentFilterUnblockHandler = WTFMove(unblockHandler); } |
87 #endif | 88 #endif |
88 | 89 |
89 private: | 90 private: |
90 void handleUnimplementablePolicy(const ResourceError&); | 91 void handleUnimplementablePolicy(const ResourceError&); |
| 92 WTF::CompletionHandlerCallingScope extendBlobURLLifetimeIfNecessary(Resource
Request&) const; |
91 | 93 |
92 Frame& m_frame; | 94 Frame& m_frame; |
93 | 95 |
94 bool m_delegateIsDecidingNavigationPolicy; | 96 bool m_delegateIsDecidingNavigationPolicy; |
95 bool m_delegateIsHandlingUnimplementablePolicy; | 97 bool m_delegateIsHandlingUnimplementablePolicy; |
96 | 98 |
97 // This identifies the type of navigation action which prompted this load. N
ote· | 99 // This identifies the type of navigation action which prompted this load. N
ote· |
98 // that WebKit conveys this value as the WebActionNavigationTypeKey value | 100 // that WebKit conveys this value as the WebActionNavigationTypeKey value |
99 // on navigation action delegate callbacks. | 101 // on navigation action delegate callbacks. |
100 FrameLoadType m_loadType; | 102 FrameLoadType m_loadType; |
101 | 103 |
102 #if ENABLE(CONTENT_FILTERING) | 104 #if ENABLE(CONTENT_FILTERING) |
103 ContentFilterUnblockHandler m_contentFilterUnblockHandler; | 105 ContentFilterUnblockHandler m_contentFilterUnblockHandler; |
104 #endif | 106 #endif |
105 }; | 107 }; |
106 | 108 |
107 } // namespace WebCore | 109 } // namespace WebCore |
LEFT | RIGHT |