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

Side by Side Diff: content/browser/loader/cross_site_resource_handler.h

Issue 1144463003: Remove Navigation Transitions from Chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed TransitionPageHelper. Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "content/browser/loader/layered_resource_handler.h" 10 #include "content/browser/loader/layered_resource_handler.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // We can now send the response to the new renderer, which will cause 43 // We can now send the response to the new renderer, which will cause
44 // WebContentsImpl to swap in the new renderer and destroy the old one. 44 // WebContentsImpl to swap in the new renderer and destroy the old one.
45 void ResumeResponse(); 45 void ResumeResponse();
46 46
47 // When set to true, requests are leaked when they can't be passed to a 47 // When set to true, requests are leaked when they can't be passed to a
48 // RenderViewHost, for unit tests. 48 // RenderViewHost, for unit tests.
49 CONTENT_EXPORT static void SetLeakRequestsForTesting( 49 CONTENT_EXPORT static void SetLeakRequestsForTesting(
50 bool leak_requests_for_testing); 50 bool leak_requests_for_testing);
51 51
52 // Navigations are deferred at OnResponseStarted to parse out any navigation
53 // transition link headers, and give the navigation transition (if it exists)
54 // a chance to run.
55 void ResumeResponseDeferredAtStart(int request_id);
56
57 // Returns whether the handler is deferred. 52 // Returns whether the handler is deferred.
58 bool did_defer_for_testing() const { return did_defer_; } 53 bool did_defer_for_testing() const { return did_defer_; }
59 54
60 private: 55 private:
61 // Prepare to transfer the cross-site response to a new RenderFrameHost, by 56 // Prepare to transfer the cross-site response to a new RenderFrameHost, by
62 // asking it to issue an identical request (on the UI thread). 57 // asking it to issue an identical request (on the UI thread).
63 void StartCrossSiteTransition(ResourceResponse* response); 58 void StartCrossSiteTransition(ResourceResponse* response);
64 59
65 // Defer the navigation to the UI thread to check whether transfer is required 60 // Defer the navigation to the UI thread to check whether transfer is required
66 // or not. Currently only used in --site-per-process. 61 // or not. Currently only used in --site-per-process.
67 bool DeferForNavigationPolicyCheck(ResourceRequestInfoImpl* info, 62 bool DeferForNavigationPolicyCheck(ResourceRequestInfoImpl* info,
68 ResourceResponse* response, 63 ResourceResponse* response,
69 bool* defer); 64 bool* defer);
70 65
71 bool OnNavigationTransitionResponseStarted(
72 ResourceResponse* response,
73 bool* defer,
74 const TransitionLayerData& transition_data);
75
76 bool OnNormalResponseStarted(ResourceResponse* response, 66 bool OnNormalResponseStarted(ResourceResponse* response,
77 bool* defer); 67 bool* defer);
78 68
79 void ResumeOrTransfer(bool is_transfer); 69 void ResumeOrTransfer(bool is_transfer);
80 void ResumeIfDeferred(); 70 void ResumeIfDeferred();
81 71
82 // Called when about to defer a request. Sets |did_defer_| and logs the 72 // Called when about to defer a request. Sets |did_defer_| and logs the
83 // defferral 73 // defferral
84 void OnDidDefer(); 74 void OnDidDefer();
85 75
(...skipping 10 matching lines...) Expand all
96 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI 86 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI
97 // thread. This can be removed once the code is changed to only do one hop. 87 // thread. This can be removed once the code is changed to only do one hop.
98 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; 88 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_;
99 89
100 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); 90 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler);
101 }; 91 };
102 92
103 } // namespace content 93 } // namespace content
104 94
105 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ 95 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/browser/loader/cross_site_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698