OLD | NEW |
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 // This is the browser side of the resource dispatcher, it receives requests | 5 // This is the browser side of the resource dispatcher, it receives requests |
6 // from the RenderProcessHosts, and dispatches them to URLRequests. It then | 6 // from the RenderProcessHosts, and dispatches them to URLRequests. It then |
7 // fowards the messages from the URLRequests back to the correct process for | 7 // fowards the messages from the URLRequests back to the correct process for |
8 // handling. | 8 // handling. |
9 // | 9 // |
10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
11 | 11 |
12 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ | 12 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ |
13 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ | 13 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
| 17 #include "chrome/browser/chrome_thread.h" |
17 #include "chrome/common/filter_policy.h" | 18 #include "chrome/common/filter_policy.h" |
18 #include "net/url_request/url_request_status.h" | 19 #include "net/url_request/url_request_status.h" |
19 #include "webkit/glue/resource_loader_bridge.h" | 20 #include "webkit/glue/resource_loader_bridge.h" |
20 | 21 |
21 namespace net { | 22 namespace net { |
22 class IOBuffer; | 23 class IOBuffer; |
23 } | 24 } |
24 | 25 |
25 // Parameters for a resource response header. | 26 // Parameters for a resource response header. |
26 struct ResourceResponseHead | 27 struct ResourceResponseHead |
(...skipping 18 matching lines...) Expand all Loading... |
45 }; | 46 }; |
46 | 47 |
47 // Simple wrapper that refcounts ResourceResponseHead. | 48 // Simple wrapper that refcounts ResourceResponseHead. |
48 struct ResourceResponse : public base::RefCounted<ResourceResponse> { | 49 struct ResourceResponse : public base::RefCounted<ResourceResponse> { |
49 ResourceResponseHead response_head; | 50 ResourceResponseHead response_head; |
50 }; | 51 }; |
51 | 52 |
52 // The resource dispatcher host uses this interface to push load events to the | 53 // The resource dispatcher host uses this interface to push load events to the |
53 // renderer, allowing for differences in the types of IPC messages generated. | 54 // renderer, allowing for differences in the types of IPC messages generated. |
54 // See the implementations of this interface defined below. | 55 // See the implementations of this interface defined below. |
55 class ResourceHandler : public base::RefCountedThreadSafe<ResourceHandler> { | 56 class ResourceHandler |
| 57 : public base::RefCountedThreadSafe< |
| 58 ResourceHandler, ChromeThread::DeleteOnIOThread> { |
56 public: | 59 public: |
57 virtual ~ResourceHandler() {} | 60 virtual ~ResourceHandler() {} |
58 | 61 |
59 // Called as upload progress is made. | 62 // Called as upload progress is made. |
60 virtual bool OnUploadProgress(int request_id, | 63 virtual bool OnUploadProgress(int request_id, |
61 uint64 position, | 64 uint64 position, |
62 uint64 size) { | 65 uint64 size) { |
63 return true; | 66 return true; |
64 } | 67 } |
65 | 68 |
(...skipping 27 matching lines...) Expand all Loading... |
93 virtual bool OnResponseCompleted(int request_id, | 96 virtual bool OnResponseCompleted(int request_id, |
94 const URLRequestStatus& status, | 97 const URLRequestStatus& status, |
95 const std::string& security_info) = 0; | 98 const std::string& security_info) = 0; |
96 | 99 |
97 // Signals that the request is closed (i.e. finished successfully, cancelled). | 100 // Signals that the request is closed (i.e. finished successfully, cancelled). |
98 // This is a signal that the associated URLRequest isn't valid anymore. | 101 // This is a signal that the associated URLRequest isn't valid anymore. |
99 virtual void OnRequestClosed() { } | 102 virtual void OnRequestClosed() { } |
100 }; | 103 }; |
101 | 104 |
102 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ | 105 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ |
OLD | NEW |