Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: content/public/browser/navigation_throttle.h

Issue 1617043002: Introduce AncestorThrottle, which will process 'X-Frame-Options' headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@block-response
Patch Set: DCHECK. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | net/base/net_error_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 14 matching lines...) Expand all
25 // If the NavigationHandle is destroyed while the navigation is deferred, 25 // If the NavigationHandle is destroyed while the navigation is deferred,
26 // the navigation will be canceled in the network stack. 26 // the navigation will be canceled in the network stack.
27 DEFER, 27 DEFER,
28 28
29 // Cancels the navigation. 29 // Cancels the navigation.
30 CANCEL, 30 CANCEL,
31 31
32 // Cancels the navigation and makes the requester of the navigation acts 32 // Cancels the navigation and makes the requester of the navigation acts
33 // like the request was never made. 33 // like the request was never made.
34 CANCEL_AND_IGNORE, 34 CANCEL_AND_IGNORE,
35
36 // Blocks a navigation due to rules asserted by a response (for instance,
37 // embedding restrictions like 'X-Frame-Options'). This result will only
38 // be returned from WillProcessResponse.
carlosk 2016/05/10 14:05:36 Should also mention that BLOCK_RESPONSE should onl
39 BLOCK_RESPONSE,
35 }; 40 };
36 41
37 NavigationThrottle(NavigationHandle* navigation_handle); 42 NavigationThrottle(NavigationHandle* navigation_handle);
38 virtual ~NavigationThrottle(); 43 virtual ~NavigationThrottle();
39 44
40 // Called when a network request is about to be made for this navigation. 45 // Called when a network request is about to be made for this navigation.
41 // 46 //
42 // The implementer is responsible for ensuring that the WebContents this 47 // The implementer is responsible for ensuring that the WebContents this
43 // throttle is associated with remain alive during the duration of this 48 // throttle is associated with remain alive during the duration of this
44 // method. Failing to do so will result in use-after-free bugs. Should the 49 // method. Failing to do so will result in use-after-free bugs. Should the
45 // implementer need to destroy the WebContents, it should return CANCEL, 50 // implementer need to destroy the WebContents, it should return CANCEL,
46 // CANCEL_AND_IGNORE or DEFER and perform the destruction asynchronously. 51 // CANCEL_AND_IGNORE or DEFER and perform the destruction asynchronously.
47 virtual ThrottleCheckResult WillStartRequest(); 52 virtual ThrottleCheckResult WillStartRequest();
48 53
49 // Called when a server redirect is received by the navigation. 54 // Called when a server redirect is received by the navigation.
50 // 55 //
51 // The implementer is responsible for ensuring that the WebContents this 56 // The implementer is responsible for ensuring that the WebContents this
52 // throttle is associated with remain alive during the duration of this 57 // throttle is associated with remain alive during the duration of this
53 // method. Failing to do so will result in use-after-free bugs. Should the 58 // method. Failing to do so will result in use-after-free bugs. Should the
54 // implementer need to destroy the WebContents, it should return CANCEL, 59 // implementer need to destroy the WebContents, it should return CANCEL,
55 // CANCEL_AND_IGNORE or DEFER and perform the destruction asynchronously. 60 // CANCEL_AND_IGNORE or DEFER and perform the destruction asynchronously.
56 virtual ThrottleCheckResult WillRedirectRequest(); 61 virtual ThrottleCheckResult WillRedirectRequest();
57 62
58 // Called when a response's headers and metadata are available. 63 // Called when a response's headers and metadata are available.
59 // 64 //
60 // The implementer is responsible for ensuring that the WebContents this 65 // The implementer is responsible for ensuring that the WebContents this
61 // throttle is associated with remain alive during the duration of this 66 // throttle is associated with remain alive during the duration of this
62 // method. Failing to do so will result in use-after-free bugs. Should the 67 // method. Failing to do so will result in use-after-free bugs. Should the
63 // implementer need to destroy the WebContents, it should return CANCEL, 68 // implementer need to destroy the WebContents, it should return CANCEL,
64 // CANCEL_AND_IGNORE and perform the destruction asynchronously. 69 // CANCEL_AND_IGNORE, or BLOCK_RESPONSE and perform the destruction
70 // asynchronously.
65 virtual ThrottleCheckResult WillProcessResponse(); 71 virtual ThrottleCheckResult WillProcessResponse();
66 72
67 // The NavigationHandle that is tracking the information related to this 73 // The NavigationHandle that is tracking the information related to this
68 // navigation. 74 // navigation.
69 NavigationHandle* navigation_handle() const { return navigation_handle_; } 75 NavigationHandle* navigation_handle() const { return navigation_handle_; }
70 76
71 private: 77 private:
72 NavigationHandle* navigation_handle_; 78 NavigationHandle* navigation_handle_;
73 }; 79 };
74 80
75 } // namespace content 81 } // namespace content
76 82
77 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ 83 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698