OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 // and not a download. | 26 // and not a download. |
27 class CrossSiteResourceHandler : public LayeredResourceHandler { | 27 class CrossSiteResourceHandler : public LayeredResourceHandler { |
28 public: | 28 public: |
29 CrossSiteResourceHandler(scoped_ptr<ResourceHandler> next_handler, | 29 CrossSiteResourceHandler(scoped_ptr<ResourceHandler> next_handler, |
30 net::URLRequest* request); | 30 net::URLRequest* request); |
31 virtual ~CrossSiteResourceHandler(); | 31 virtual ~CrossSiteResourceHandler(); |
32 | 32 |
33 // ResourceHandler implementation: | 33 // ResourceHandler implementation: |
34 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 34 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
35 ResourceResponse* response, | 35 ResourceResponse* response, |
36 bool* defer) OVERRIDE; | 36 bool* defer) override; |
37 virtual bool OnResponseStarted(ResourceResponse* response, | 37 virtual bool OnResponseStarted(ResourceResponse* response, |
38 bool* defer) OVERRIDE; | 38 bool* defer) override; |
39 virtual bool OnReadCompleted(int bytes_read, | 39 virtual bool OnReadCompleted(int bytes_read, |
40 bool* defer) OVERRIDE; | 40 bool* defer) override; |
41 virtual void OnResponseCompleted(const net::URLRequestStatus& status, | 41 virtual void OnResponseCompleted(const net::URLRequestStatus& status, |
42 const std::string& security_info, | 42 const std::string& security_info, |
43 bool* defer) OVERRIDE; | 43 bool* defer) override; |
44 | 44 |
45 // We can now send the response to the new renderer, which will cause | 45 // We can now send the response to the new renderer, which will cause |
46 // WebContentsImpl to swap in the new renderer and destroy the old one. | 46 // WebContentsImpl to swap in the new renderer and destroy the old one. |
47 void ResumeResponse(); | 47 void ResumeResponse(); |
48 | 48 |
49 // When set to true, requests are leaked when they can't be passed to a | 49 // When set to true, requests are leaked when they can't be passed to a |
50 // RenderViewHost, for unit tests. | 50 // RenderViewHost, for unit tests. |
51 CONTENT_EXPORT static void SetLeakRequestsForTesting( | 51 CONTENT_EXPORT static void SetLeakRequestsForTesting( |
52 bool leak_requests_for_testing); | 52 bool leak_requests_for_testing); |
53 | 53 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI | 98 // PostTaskAndReplyWithResult. If a transfer is needed, it goes back to the UI |
99 // thread. This can be removed once the code is changed to only do one hop. | 99 // thread. This can be removed once the code is changed to only do one hop. |
100 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; | 100 base::WeakPtrFactory<CrossSiteResourceHandler> weak_ptr_factory_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); | 102 DISALLOW_COPY_AND_ASSIGN(CrossSiteResourceHandler); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace content | 105 } // namespace content |
106 | 106 |
107 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ | 107 #endif // CONTENT_BROWSER_LOADER_CROSS_SITE_RESOURCE_HANDLER_H_ |
OLD | NEW |