| 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 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2165 | 2165 |
| 2166 if (existing == info_map->end() || | 2166 if (existing == info_map->end() || |
| 2167 LoadInfoIsMoreInteresting(load_info, existing->second)) { | 2167 LoadInfoIsMoreInteresting(load_info, existing->second)) { |
| 2168 (*info_map)[id] = load_info; | 2168 (*info_map)[id] = load_info; |
| 2169 } | 2169 } |
| 2170 } | 2170 } |
| 2171 return info_map.Pass(); | 2171 return info_map.Pass(); |
| 2172 } | 2172 } |
| 2173 | 2173 |
| 2174 void ResourceDispatcherHostImpl::UpdateLoadInfo() { | 2174 void ResourceDispatcherHostImpl::UpdateLoadInfo() { |
| 2175 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is | |
| 2176 // fixed. | |
| 2177 tracked_objects::ScopedTracker tracking_profile( | |
| 2178 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 2179 "455952 ResourceDispatcherHostImpl::UpdateLoadInfo")); | |
| 2180 | |
| 2181 scoped_ptr<LoadInfoMap> info_map(GetLoadInfoForAllRoutes()); | 2175 scoped_ptr<LoadInfoMap> info_map(GetLoadInfoForAllRoutes()); |
| 2182 | 2176 |
| 2183 if (info_map->empty()) | 2177 if (info_map->empty()) |
| 2184 return; | 2178 return; |
| 2185 | 2179 |
| 2186 tracked_objects::ScopedTracker tracking_profile2( | 2180 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is |
| 2187 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 2181 // fixed. |
| 2188 "455952 ResourceDispatcherHostImpl::UpdateLoadInfo2")); | 2182 tracked_objects::ScopedTracker tracking_profile( |
| 2183 FROM_HERE_WITH_EXPLICIT_FUNCTION("455952 BrowserThread::PostTask()")); |
| 2189 | 2184 |
| 2190 BrowserThread::PostTask( | 2185 BrowserThread::PostTask( |
| 2191 BrowserThread::UI, FROM_HERE, | 2186 BrowserThread::UI, FROM_HERE, |
| 2192 base::Bind(&ResourceDispatcherHostImpl::UpdateLoadInfoOnUIThread, | 2187 base::Bind(&ResourceDispatcherHostImpl::UpdateLoadInfoOnUIThread, |
| 2193 base::Passed(&info_map))); | 2188 base::Passed(&info_map))); |
| 2194 } | 2189 } |
| 2195 | 2190 |
| 2196 void ResourceDispatcherHostImpl::BlockRequestsForRoute(int child_id, | 2191 void ResourceDispatcherHostImpl::BlockRequestsForRoute(int child_id, |
| 2197 int route_id) { | 2192 int route_id) { |
| 2198 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 2193 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2349 | 2344 |
| 2350 // Add a flag to selectively bypass the data reduction proxy if the resource | 2345 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 2351 // type is not an image. | 2346 // type is not an image. |
| 2352 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2347 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 2353 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2348 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2354 | 2349 |
| 2355 return load_flags; | 2350 return load_flags; |
| 2356 } | 2351 } |
| 2357 | 2352 |
| 2358 } // namespace content | 2353 } // namespace content |
| OLD | NEW |