| 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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 false, // enable_load_timing | 1317 false, // enable_load_timing |
| 1318 blink::WebReferrerPolicyDefault, | 1318 blink::WebReferrerPolicyDefault, |
| 1319 blink::WebPageVisibilityStateVisible, | 1319 blink::WebPageVisibilityStateVisible, |
| 1320 context, | 1320 context, |
| 1321 base::WeakPtr<ResourceMessageFilter>(), // filter | 1321 base::WeakPtr<ResourceMessageFilter>(), // filter |
| 1322 true); // is_async | 1322 true); // is_async |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 void ResourceDispatcherHostImpl::OnRenderViewHostCreated( | 1325 void ResourceDispatcherHostImpl::OnRenderViewHostCreated( |
| 1326 int child_id, | 1326 int child_id, |
| 1327 int route_id) { | 1327 int route_id, |
| 1328 scheduler_->OnClientCreated(child_id, route_id); | 1328 bool is_visible) { |
| 1329 scheduler_->OnClientCreated(child_id, route_id, is_visible); |
| 1329 } | 1330 } |
| 1330 | 1331 |
| 1331 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted( | 1332 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted( |
| 1332 int child_id, | 1333 int child_id, |
| 1333 int route_id) { | 1334 int route_id) { |
| 1334 scheduler_->OnClientDeleted(child_id, route_id); | 1335 scheduler_->OnClientDeleted(child_id, route_id); |
| 1335 CancelRequestsForRoute(child_id, route_id); | 1336 CancelRequestsForRoute(child_id, route_id); |
| 1336 } | 1337 } |
| 1337 | 1338 |
| 1339 void ResourceDispatcherHostImpl::OnRenderViewHostWasHidden( |
| 1340 int child_id, |
| 1341 int route_id) { |
| 1342 scheduler_->OnVisibilityChanged(child_id, route_id, false); |
| 1343 } |
| 1344 |
| 1345 void ResourceDispatcherHostImpl::OnRenderViewHostWasShown( |
| 1346 int child_id, |
| 1347 int route_id) { |
| 1348 scheduler_->OnVisibilityChanged(child_id, route_id, true); |
| 1349 } |
| 1350 |
| 1338 // This function is only used for saving feature. | 1351 // This function is only used for saving feature. |
| 1339 void ResourceDispatcherHostImpl::BeginSaveFile( | 1352 void ResourceDispatcherHostImpl::BeginSaveFile( |
| 1340 const GURL& url, | 1353 const GURL& url, |
| 1341 const Referrer& referrer, | 1354 const Referrer& referrer, |
| 1342 int child_id, | 1355 int child_id, |
| 1343 int route_id, | 1356 int route_id, |
| 1344 ResourceContext* context) { | 1357 ResourceContext* context) { |
| 1345 if (is_shutdown_) | 1358 if (is_shutdown_) |
| 1346 return; | 1359 return; |
| 1347 | 1360 |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 | 2008 |
| 1996 // Add a flag to selectively bypass the data reduction proxy if the resource | 2009 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 1997 // type is not an image. | 2010 // type is not an image. |
| 1998 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2011 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 1999 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2012 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2000 | 2013 |
| 2001 return load_flags; | 2014 return load_flags; |
| 2002 } | 2015 } |
| 2003 | 2016 |
| 2004 } // namespace content | 2017 } // namespace content |
| OLD | NEW |