Chromium Code Reviews| 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 child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and | 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and |
| 7 // dispatches them to URLRequests. It then fowards the messages from the | 7 // dispatches them to URLRequests. It then fowards the messages from the |
| 8 // URLRequests back to the correct process for handling. | 8 // URLRequests back to the correct process for 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 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 class ExtraRequestInfo : public URLRequest::UserData { | 72 class ExtraRequestInfo : public URLRequest::UserData { |
| 73 friend class ResourceDispatcherHost; | 73 friend class ResourceDispatcherHost; |
| 74 public: | 74 public: |
| 75 ExtraRequestInfo(ResourceHandler* handler, | 75 ExtraRequestInfo(ResourceHandler* handler, |
| 76 ChildProcessInfo::ProcessType process_type, | 76 ChildProcessInfo::ProcessType process_type, |
| 77 int process_id, | 77 int process_id, |
| 78 int route_id, | 78 int route_id, |
| 79 int request_id, | 79 int request_id, |
| 80 std::string frame_origin, | 80 std::string frame_origin, |
| 81 std::string main_frame_origin, | 81 std::string main_frame_origin, |
| 82 std::string default_mime_type, | |
| 82 ResourceType::Type resource_type, | 83 ResourceType::Type resource_type, |
| 83 uint64 upload_size) | 84 uint64 upload_size) |
| 84 : resource_handler(handler), | 85 : resource_handler(handler), |
| 85 cross_site_handler(NULL), | 86 cross_site_handler(NULL), |
| 86 login_handler(NULL), | 87 login_handler(NULL), |
| 87 process_type(process_type), | 88 process_type(process_type), |
| 88 process_id(process_id), | 89 process_id(process_id), |
| 89 route_id(route_id), | 90 route_id(route_id), |
| 90 request_id(request_id), | 91 request_id(request_id), |
| 91 pending_data_count(0), | 92 pending_data_count(0), |
| 92 is_download(false), | 93 is_download(false), |
| 93 pause_count(0), | 94 pause_count(0), |
| 94 frame_origin(frame_origin), | 95 frame_origin(frame_origin), |
| 95 main_frame_origin(main_frame_origin), | 96 main_frame_origin(main_frame_origin), |
| 97 default_mime_type(default_mime_type), | |
| 96 resource_type(resource_type), | 98 resource_type(resource_type), |
| 97 filter_policy(FilterPolicy::DONT_FILTER), | 99 filter_policy(FilterPolicy::DONT_FILTER), |
| 98 last_load_state(net::LOAD_STATE_IDLE), | 100 last_load_state(net::LOAD_STATE_IDLE), |
| 99 upload_size(upload_size), | 101 upload_size(upload_size), |
| 100 last_upload_position(0), | 102 last_upload_position(0), |
| 101 waiting_for_upload_progress_ack(false), | 103 waiting_for_upload_progress_ack(false), |
| 102 memory_cost(0), | 104 memory_cost(0), |
| 103 is_paused(false), | 105 is_paused(false), |
| 104 has_started_reading(false), | 106 has_started_reading(false), |
| 105 paused_read_bytes(0) { | 107 paused_read_bytes(0) { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 134 // The number of clients that have called pause on this request. | 136 // The number of clients that have called pause on this request. |
| 135 int pause_count; | 137 int pause_count; |
| 136 | 138 |
| 137 // The security origin of the frame making this request. | 139 // The security origin of the frame making this request. |
| 138 std::string frame_origin; | 140 std::string frame_origin; |
| 139 | 141 |
| 140 // The security origin of the main frame that contains the frame making | 142 // The security origin of the main frame that contains the frame making |
| 141 // this request. | 143 // this request. |
| 142 std::string main_frame_origin; | 144 std::string main_frame_origin; |
| 143 | 145 |
| 146 // The MIME type to use if this request lacks a Content-Type header. If | |
|
wtc
2009/03/28 00:45:35
Nit: "response header", to avoid confusion with a
| |
| 147 // |default_mime_type| is "", then use the default sniffing algorith. | |
|
wtc
2009/03/28 00:45:35
Typo: algorith
| |
| 148 std::string default_mime_type; | |
| 149 | |
| 144 ResourceType::Type resource_type; | 150 ResourceType::Type resource_type; |
| 145 | 151 |
| 146 // Whether the content for this request should be filtered (on the renderer | 152 // Whether the content for this request should be filtered (on the renderer |
| 147 // side) to make it more secure: images are stamped, frame content is | 153 // side) to make it more secure: images are stamped, frame content is |
| 148 // replaced with an error message and all other resources are entirely | 154 // replaced with an error message and all other resources are entirely |
| 149 // filtered out. | 155 // filtered out. |
| 150 FilterPolicy::Type filter_policy; | 156 FilterPolicy::Type filter_policy; |
| 151 | 157 |
| 152 net::LoadState last_load_state; | 158 net::LoadState last_load_state; |
| 153 | 159 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 int max_outstanding_requests_cost_per_process_; | 554 int max_outstanding_requests_cost_per_process_; |
| 549 | 555 |
| 550 // Used during IPC message dispatching so that the handlers can get a pointer | 556 // Used during IPC message dispatching so that the handlers can get a pointer |
| 551 // to the source of the message. | 557 // to the source of the message. |
| 552 Receiver* receiver_; | 558 Receiver* receiver_; |
| 553 | 559 |
| 554 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); | 560 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); |
| 555 }; | 561 }; |
| 556 | 562 |
| 557 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ | 563 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ |
| OLD | NEW |