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