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

Side by Side Diff: chrome/browser/renderer_host/cross_site_resource_handler.h

Issue 460108: Implement ResourceQueue, an object that makes it easy to delay starting (Closed)
Patch Set: nitfixing Created 11 years 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_
7 7
8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
9 #include "chrome/browser/renderer_host/resource_handler.h" 8 #include "chrome/browser/renderer_host/resource_handler.h"
10 9
10 class ResourceDispatcherHost;
11 struct GlobalRequestID;
12
11 // Ensures that cross-site responses are delayed until the onunload handler of 13 // Ensures that cross-site responses are delayed until the onunload handler of
12 // the previous page is allowed to run. This handler wraps an 14 // the previous page is allowed to run. This handler wraps an
13 // AsyncEventHandler, and it sits inside SafeBrowsing and Buffered event 15 // AsyncEventHandler, and it sits inside SafeBrowsing and Buffered event
14 // handlers. This is important, so that it can intercept OnResponseStarted 16 // handlers. This is important, so that it can intercept OnResponseStarted
15 // after we determine that a response is safe and not a download. 17 // after we determine that a response is safe and not a download.
16 class CrossSiteResourceHandler : public ResourceHandler { 18 class CrossSiteResourceHandler : public ResourceHandler {
17 public: 19 public:
18 CrossSiteResourceHandler(ResourceHandler* handler, 20 CrossSiteResourceHandler(ResourceHandler* handler,
19 int render_process_host_id, 21 int render_process_host_id,
20 int render_view_id, 22 int render_view_id,
(...skipping 16 matching lines...) Expand all
37 void ResumeResponse(); 39 void ResumeResponse();
38 40
39 private: 41 private:
40 ~CrossSiteResourceHandler() {} 42 ~CrossSiteResourceHandler() {}
41 43
42 // Prepare to render the cross-site response in a new RenderViewHost, by 44 // Prepare to render the cross-site response in a new RenderViewHost, by
43 // telling the old RenderViewHost to run its onunload handler. 45 // telling the old RenderViewHost to run its onunload handler.
44 void StartCrossSiteTransition( 46 void StartCrossSiteTransition(
45 int request_id, 47 int request_id,
46 ResourceResponse* response, 48 ResourceResponse* response,
47 ResourceDispatcherHost::GlobalRequestID global_id); 49 const GlobalRequestID& global_id);
48 50
49 scoped_refptr<ResourceHandler> next_handler_; 51 scoped_refptr<ResourceHandler> next_handler_;
50 int render_process_host_id_; 52 int render_process_host_id_;
51 int render_view_id_; 53 int render_view_id_;
52 bool has_started_response_; 54 bool has_started_response_;
53 bool in_cross_site_transition_; 55 bool in_cross_site_transition_;
54 int request_id_; 56 int request_id_;
55 bool completed_during_transition_; 57 bool completed_during_transition_;
56 URLRequestStatus completed_status_; 58 URLRequestStatus completed_status_;
57 std::string completed_security_info_; 59 std::string completed_security_info_;
58 ResourceResponse* response_; 60 ResourceResponse* response_;
59 ResourceDispatcherHost* rdh_; 61 ResourceDispatcherHost* rdh_;
60 62
61 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); 63 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler);
62 }; 64 };
63 65
64 #endif // CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_ 66 #endif // CHROME_BROWSER_RENDERER_HOST_CROSS_SITE_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/async_resource_handler.cc ('k') | chrome/browser/renderer_host/cross_site_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698