| 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #ifndef CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 7 #ifndef CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| 8 #define CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 8 #define CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class RequestPeer; | 43 class RequestPeer; |
| 44 class ResourceDispatcherDelegate; | 44 class ResourceDispatcherDelegate; |
| 45 class ResourceSchedulingFilter; | 45 class ResourceSchedulingFilter; |
| 46 struct ResourceResponseInfo; | 46 struct ResourceResponseInfo; |
| 47 struct ResourceRequest; | 47 struct ResourceRequest; |
| 48 struct ResourceRequestCompletionStatus; | 48 struct ResourceRequestCompletionStatus; |
| 49 struct ResourceResponseHead; | 49 struct ResourceResponseHead; |
| 50 class SharedMemoryReceivedDataFactory; | 50 class SharedMemoryReceivedDataFactory; |
| 51 struct SiteIsolationResponseMetaData; | 51 struct SiteIsolationResponseMetaData; |
| 52 struct SyncLoadResponse; | 52 struct SyncLoadResponse; |
| 53 class URLLoaderClientImpl; |
| 53 | 54 |
| 54 namespace mojom { | 55 namespace mojom { |
| 55 class URLLoaderFactory; | 56 class URLLoaderFactory; |
| 56 } // namespace mojom | 57 } // namespace mojom |
| 57 | 58 |
| 58 // This class serves as a communication interface to the ResourceDispatcherHost | 59 // This class serves as a communication interface to the ResourceDispatcherHost |
| 59 // in the browser process. It can be used from any child process. | 60 // in the browser process. It can be used from any child process. |
| 60 // Virtual methods are for tests. | 61 // Virtual methods are for tests. |
| 61 class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { | 62 class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { |
| 62 public: | 63 public: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 base::TimeTicks request_start; | 186 base::TimeTicks request_start; |
| 186 base::TimeTicks response_start; | 187 base::TimeTicks response_start; |
| 187 base::TimeTicks completion_time; | 188 base::TimeTicks completion_time; |
| 188 linked_ptr<base::SharedMemory> buffer; | 189 linked_ptr<base::SharedMemory> buffer; |
| 189 scoped_refptr<SharedMemoryReceivedDataFactory> received_data_factory; | 190 scoped_refptr<SharedMemoryReceivedDataFactory> received_data_factory; |
| 190 std::unique_ptr<SiteIsolationResponseMetaData> site_isolation_metadata; | 191 std::unique_ptr<SiteIsolationResponseMetaData> site_isolation_metadata; |
| 191 int buffer_size; | 192 int buffer_size; |
| 192 | 193 |
| 193 // For mojo loading. | 194 // For mojo loading. |
| 194 mojom::URLLoaderAssociatedPtr url_loader; | 195 mojom::URLLoaderAssociatedPtr url_loader; |
| 195 std::unique_ptr<mojom::URLLoaderClient> url_loader_client; | 196 std::unique_ptr<URLLoaderClientImpl> url_loader_client; |
| 196 }; | 197 }; |
| 197 using PendingRequestMap = std::map<int, std::unique_ptr<PendingRequestInfo>>; | 198 using PendingRequestMap = std::map<int, std::unique_ptr<PendingRequestInfo>>; |
| 198 | 199 |
| 199 // Helper to lookup the info based on the request_id. | 200 // Helper to lookup the info based on the request_id. |
| 200 // May return NULL if the request as been canceled from the client side. | 201 // May return NULL if the request as been canceled from the client side. |
| 201 PendingRequestInfo* GetPendingRequestInfo(int request_id); | 202 PendingRequestInfo* GetPendingRequestInfo(int request_id); |
| 202 | 203 |
| 203 // Follows redirect, if any, for the given request. | 204 // Follows redirect, if any, for the given request. |
| 204 void FollowPendingRedirect(int request_id, PendingRequestInfo* request_info); | 205 void FollowPendingRedirect(int request_id, PendingRequestInfo* request_info); |
| 205 | 206 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; | 275 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; |
| 275 | 276 |
| 276 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 277 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
| 277 | 278 |
| 278 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 279 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 279 }; | 280 }; |
| 280 | 281 |
| 281 } // namespace content | 282 } // namespace content |
| 282 | 283 |
| 283 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 284 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |