| 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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 download, // allow_download | 1343 download, // allow_download |
| 1344 false, // has_user_gesture | 1344 false, // has_user_gesture |
| 1345 false, // enable_load_timing | 1345 false, // enable_load_timing |
| 1346 blink::WebReferrerPolicyDefault, | 1346 blink::WebReferrerPolicyDefault, |
| 1347 blink::WebPageVisibilityStateVisible, | 1347 blink::WebPageVisibilityStateVisible, |
| 1348 context, | 1348 context, |
| 1349 base::WeakPtr<ResourceMessageFilter>(), // filter | 1349 base::WeakPtr<ResourceMessageFilter>(), // filter |
| 1350 true); // is_async | 1350 true); // is_async |
| 1351 } | 1351 } |
| 1352 | 1352 |
| 1353 void ResourceDispatcherHostImpl::OnRenderViewHostCreated( | 1353 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, |
| 1354 int child_id, | 1354 int route_id, |
| 1355 int route_id, | 1355 bool is_visible, |
| 1356 bool is_visible) { | 1356 bool is_audible) { |
| 1357 scheduler_->OnClientCreated(child_id, route_id, is_visible); | 1357 scheduler_->OnClientCreated(child_id, route_id, is_visible, is_audible); |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted( | 1360 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted( |
| 1361 int child_id, | 1361 int child_id, |
| 1362 int route_id) { | 1362 int route_id) { |
| 1363 scheduler_->OnClientDeleted(child_id, route_id); | 1363 scheduler_->OnClientDeleted(child_id, route_id); |
| 1364 CancelRequestsForRoute(child_id, route_id); | 1364 CancelRequestsForRoute(child_id, route_id); |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1367 void ResourceDispatcherHostImpl::OnRenderViewHostSetIsLoading(int child_id, | 1367 void ResourceDispatcherHostImpl::OnRenderViewHostSetIsLoading(int child_id, |
| 1368 int route_id, | 1368 int route_id, |
| 1369 bool is_loading) { | 1369 bool is_loading) { |
| 1370 scheduler_->OnLoadingStateChanged(child_id, route_id, !is_loading); | 1370 scheduler_->OnLoadingStateChanged(child_id, route_id, !is_loading); |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 void ResourceDispatcherHostImpl::OnRenderViewHostWasHidden( | 1373 void ResourceDispatcherHostImpl::OnRenderViewHostWasHidden( |
| 1374 int child_id, | 1374 int child_id, |
| 1375 int route_id) { | 1375 int route_id) { |
| 1376 scheduler_->OnVisibilityChanged(child_id, route_id, false); | 1376 scheduler_->OnVisibilityChanged(child_id, route_id, false); |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 void ResourceDispatcherHostImpl::OnRenderViewHostWasShown( | 1379 void ResourceDispatcherHostImpl::OnRenderViewHostWasShown( |
| 1380 int child_id, | 1380 int child_id, |
| 1381 int route_id) { | 1381 int route_id) { |
| 1382 scheduler_->OnVisibilityChanged(child_id, route_id, true); | 1382 scheduler_->OnVisibilityChanged(child_id, route_id, true); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 void ResourceDispatcherHostImpl::OnAudioRenderHostStreamStateChanged( |
| 1386 int child_id, |
| 1387 int route_id, |
| 1388 bool is_playing) { |
| 1389 scheduler_->OnAudibilityChanged(child_id, route_id, is_playing); |
| 1390 } |
| 1391 |
| 1385 // This function is only used for saving feature. | 1392 // This function is only used for saving feature. |
| 1386 void ResourceDispatcherHostImpl::BeginSaveFile( | 1393 void ResourceDispatcherHostImpl::BeginSaveFile( |
| 1387 const GURL& url, | 1394 const GURL& url, |
| 1388 const Referrer& referrer, | 1395 const Referrer& referrer, |
| 1389 int child_id, | 1396 int child_id, |
| 1390 int route_id, | 1397 int route_id, |
| 1391 ResourceContext* context) { | 1398 ResourceContext* context) { |
| 1392 if (is_shutdown_) | 1399 if (is_shutdown_) |
| 1393 return; | 1400 return; |
| 1394 | 1401 |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 | 2056 |
| 2050 // Add a flag to selectively bypass the data reduction proxy if the resource | 2057 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 2051 // type is not an image. | 2058 // type is not an image. |
| 2052 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2059 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 2053 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2060 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2054 | 2061 |
| 2055 return load_flags; | 2062 return load_flags; |
| 2056 } | 2063 } |
| 2057 | 2064 |
| 2058 } // namespace content | 2065 } // namespace content |
| OLD | NEW |