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 CHROME_BROWSER_RENDERER_HOST_TRANSFER_NAVIGATION_RESOURCE_THROTTLE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TRANSFER_NAVIGATION_RESOURCE_THROTTLE_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_TRANSFER_NAVIGATION_RESOURCE_THROTTLE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_TRANSFER_NAVIGATION_RESOURCE_THROTTLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "content/public/browser/resource_throttle.h" | 11 #include "content/public/browser/resource_throttle.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 class URLRequest; | 14 class URLRequest; |
15 } | 15 } |
16 | 16 |
17 // This ResourceThrottle checks whether a navigation redirect will cause a | 17 // This ResourceThrottle checks whether a navigation redirect will cause a |
18 // renderer process swap. When that happens, we remember the request so | 18 // renderer process swap. When that happens, we remember the request so |
19 // that we can transfer it to be handled by the new renderer. This fixes | 19 // that we can transfer it to be handled by the new renderer. This fixes |
20 // http://crbug.com/79520 | 20 // http://crbug.com/79520 |
21 class TransferNavigationResourceThrottle : public content::ResourceThrottle { | 21 class TransferNavigationResourceThrottle : public content::ResourceThrottle { |
22 public: | 22 public: |
23 explicit TransferNavigationResourceThrottle(net::URLRequest* request); | 23 explicit TransferNavigationResourceThrottle(net::URLRequest* request); |
24 | 24 |
25 // content::ResourceThrottle implementation: | 25 // content::ResourceThrottle implementation: |
26 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; | 26 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; |
27 | 27 |
28 private: | 28 private: |
29 virtual ~TransferNavigationResourceThrottle(); | 29 virtual ~TransferNavigationResourceThrottle(); |
30 | 30 |
31 net::URLRequest* request_; | 31 net::URLRequest* request_; |
32 | 32 |
33 DISALLOW_COPY_AND_ASSIGN(TransferNavigationResourceThrottle); | 33 DISALLOW_COPY_AND_ASSIGN(TransferNavigationResourceThrottle); |
34 }; | 34 }; |
35 | 35 |
36 | 36 #endif // CONTENT_BROWSER_RENDERER_HOST_TRANSFER_NAVIGATION_RESOURCE_THROTTLE_H
_ |
37 #endif // CHROME_BROWSER_RENDERER_HOST_TRANSFER_NAVIGATION_RESOURCE_THROTTLE_H_ | |
OLD | NEW |