OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 receiver_(NULL) { | 187 receiver_(NULL) { |
188 ResourceQueue::DelegateSet resource_queue_delegates; | 188 ResourceQueue::DelegateSet resource_queue_delegates; |
189 resource_queue_delegates.insert(user_script_listener_.get()); | 189 resource_queue_delegates.insert(user_script_listener_.get()); |
190 resource_queue_.Initialize(resource_queue_delegates); | 190 resource_queue_.Initialize(resource_queue_delegates); |
191 } | 191 } |
192 | 192 |
193 ResourceDispatcherHost::~ResourceDispatcherHost() { | 193 ResourceDispatcherHost::~ResourceDispatcherHost() { |
194 AsyncResourceHandler::GlobalCleanup(); | 194 AsyncResourceHandler::GlobalCleanup(); |
195 STLDeleteValues(&pending_requests_); | 195 STLDeleteValues(&pending_requests_); |
196 | 196 |
| 197 user_script_listener_->ShutdownMainThread(); |
| 198 |
197 // Clear blocked requests if any left. | 199 // Clear blocked requests if any left. |
198 // Note that we have to do this in 2 passes as we cannot call | 200 // Note that we have to do this in 2 passes as we cannot call |
199 // CancelBlockedRequestsForRoute while iterating over | 201 // CancelBlockedRequestsForRoute while iterating over |
200 // blocked_requests_map_, as it modifies it. | 202 // blocked_requests_map_, as it modifies it. |
201 std::set<ProcessRouteIDs> ids; | 203 std::set<ProcessRouteIDs> ids; |
202 for (BlockedRequestMap::const_iterator iter = blocked_requests_map_.begin(); | 204 for (BlockedRequestMap::const_iterator iter = blocked_requests_map_.begin(); |
203 iter != blocked_requests_map_.end(); ++iter) { | 205 iter != blocked_requests_map_.end(); ++iter) { |
204 std::pair<std::set<ProcessRouteIDs>::iterator, bool> result = | 206 std::pair<std::set<ProcessRouteIDs>::iterator, bool> result = |
205 ids.insert(iter->first); | 207 ids.insert(iter->first); |
206 // We should not have duplicates. | 208 // We should not have duplicates. |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 const ResourceType::Type& resource_type, | 1759 const ResourceType::Type& resource_type, |
1758 ResourceDispatcherHostRequestInfo* request_info) { | 1760 ResourceDispatcherHostRequestInfo* request_info) { |
1759 // Apply filter only to chrome extension css files that don't have | 1761 // Apply filter only to chrome extension css files that don't have |
1760 // security filter already set. | 1762 // security filter already set. |
1761 if (url.SchemeIs(chrome::kExtensionScheme) && | 1763 if (url.SchemeIs(chrome::kExtensionScheme) && |
1762 request_info->filter_policy() == FilterPolicy::DONT_FILTER && | 1764 request_info->filter_policy() == FilterPolicy::DONT_FILTER && |
1763 resource_type == ResourceType::STYLESHEET) { | 1765 resource_type == ResourceType::STYLESHEET) { |
1764 request_info->set_filter_policy(FilterPolicy::FILTER_EXTENSION_MESSAGES); | 1766 request_info->set_filter_policy(FilterPolicy::FILTER_EXTENSION_MESSAGES); |
1765 } | 1767 } |
1766 } | 1768 } |
OLD | NEW |