Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 562273008: Add audio signal to the ResourceScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 download, // allow_download 1435 download, // allow_download
1436 false, // has_user_gesture 1436 false, // has_user_gesture
1437 false, // enable_load_timing 1437 false, // enable_load_timing
1438 blink::WebReferrerPolicyDefault, 1438 blink::WebReferrerPolicyDefault,
1439 blink::WebPageVisibilityStateVisible, 1439 blink::WebPageVisibilityStateVisible,
1440 context, 1440 context,
1441 base::WeakPtr<ResourceMessageFilter>(), // filter 1441 base::WeakPtr<ResourceMessageFilter>(), // filter
1442 true); // is_async 1442 true); // is_async
1443 } 1443 }
1444 1444
1445 void ResourceDispatcherHostImpl::OnRenderViewHostCreated( 1445 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id,
1446 int child_id, 1446 int route_id,
1447 int route_id, 1447 bool is_visible,
1448 bool is_visible) { 1448 bool is_audible) {
1449 scheduler_->OnClientCreated(child_id, route_id, is_visible); 1449 scheduler_->OnClientCreated(child_id, route_id, is_visible, is_audible);
1450 } 1450 }
1451 1451
1452 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted( 1452 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted(
1453 int child_id, 1453 int child_id,
1454 int route_id) { 1454 int route_id) {
1455 scheduler_->OnClientDeleted(child_id, route_id); 1455 scheduler_->OnClientDeleted(child_id, route_id);
1456 CancelRequestsForRoute(child_id, route_id); 1456 CancelRequestsForRoute(child_id, route_id);
1457 } 1457 }
1458 1458
1459 void ResourceDispatcherHostImpl::OnRenderViewHostSetIsLoading(int child_id, 1459 void ResourceDispatcherHostImpl::OnRenderViewHostSetIsLoading(int child_id,
1460 int route_id, 1460 int route_id,
1461 bool is_loading) { 1461 bool is_loading) {
1462 scheduler_->OnLoadingStateChanged(child_id, route_id, !is_loading); 1462 scheduler_->OnLoadingStateChanged(child_id, route_id, !is_loading);
1463 } 1463 }
1464 1464
1465 void ResourceDispatcherHostImpl::OnRenderViewHostWasHidden( 1465 void ResourceDispatcherHostImpl::OnRenderViewHostWasHidden(
1466 int child_id, 1466 int child_id,
1467 int route_id) { 1467 int route_id) {
1468 scheduler_->OnVisibilityChanged(child_id, route_id, false); 1468 scheduler_->OnVisibilityChanged(child_id, route_id, false);
1469 } 1469 }
1470 1470
1471 void ResourceDispatcherHostImpl::OnRenderViewHostWasShown( 1471 void ResourceDispatcherHostImpl::OnRenderViewHostWasShown(
1472 int child_id, 1472 int child_id,
1473 int route_id) { 1473 int route_id) {
1474 scheduler_->OnVisibilityChanged(child_id, route_id, true); 1474 scheduler_->OnVisibilityChanged(child_id, route_id, true);
1475 } 1475 }
1476 1476
1477 void ResourceDispatcherHostImpl::OnAudioRenderHostStreamStateChanged(
1478 int child_id,
1479 int route_id,
1480 bool is_playing) {
1481 scheduler_->OnAudibilityChanged(child_id, route_id, is_playing);
1482 }
1483
1477 // This function is only used for saving feature. 1484 // This function is only used for saving feature.
1478 void ResourceDispatcherHostImpl::BeginSaveFile( 1485 void ResourceDispatcherHostImpl::BeginSaveFile(
1479 const GURL& url, 1486 const GURL& url,
1480 const Referrer& referrer, 1487 const Referrer& referrer,
1481 int child_id, 1488 int child_id,
1482 int route_id, 1489 int route_id,
1483 ResourceContext* context) { 1490 ResourceContext* context) {
1484 if (is_shutdown_) 1491 if (is_shutdown_)
1485 return; 1492 return;
1486 1493
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 2149
2143 // Add a flag to selectively bypass the data reduction proxy if the resource 2150 // Add a flag to selectively bypass the data reduction proxy if the resource
2144 // type is not an image. 2151 // type is not an image.
2145 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) 2152 if (request_data.resource_type != RESOURCE_TYPE_IMAGE)
2146 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; 2153 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
2147 2154
2148 return load_flags; 2155 return load_flags;
2149 } 2156 }
2150 2157
2151 } // namespace content 2158 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/loader/resource_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698