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 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 prefs.user_gesture_required_for_presentation = !command_line.HasSwitch( | 535 prefs.user_gesture_required_for_presentation = !command_line.HasSwitch( |
536 switches::kDisableGestureRequirementForPresentation); | 536 switches::kDisableGestureRequirementForPresentation); |
537 | 537 |
538 if (delegate_ && delegate_->HideDownloadUI()) | 538 if (delegate_ && delegate_->HideDownloadUI()) |
539 prefs.hide_download_ui = true; | 539 prefs.hide_download_ui = true; |
540 | 540 |
541 prefs.background_video_track_optimization_enabled = | 541 prefs.background_video_track_optimization_enabled = |
542 base::FeatureList::IsEnabled(media::kBackgroundVideoTrackOptimization); | 542 base::FeatureList::IsEnabled(media::kBackgroundVideoTrackOptimization); |
543 | 543 |
| 544 // TODO(avayvod, asvitkine): Query the value directly when it is available in |
| 545 // the renderer process. See https://crbug.com/681160. |
| 546 prefs.max_keyframe_distance_to_disable_background_video = |
| 547 base::TimeDelta::FromMilliseconds( |
| 548 variations::GetVariationParamByFeatureAsInt( |
| 549 media::kBackgroundVideoTrackOptimization, |
| 550 "max_keyframe_distance_ms", |
| 551 base::TimeDelta::FromSeconds(10).InMilliseconds())); |
| 552 |
544 std::map<std::string, std::string> expensive_background_throttling_prefs; | 553 std::map<std::string, std::string> expensive_background_throttling_prefs; |
545 variations::GetVariationParamsByFeature( | 554 variations::GetVariationParamsByFeature( |
546 features::kExpensiveBackgroundTimerThrottling, | 555 features::kExpensiveBackgroundTimerThrottling, |
547 &expensive_background_throttling_prefs); | 556 &expensive_background_throttling_prefs); |
548 SetFloatParameterFromMap(expensive_background_throttling_prefs, "cpu_budget", | 557 SetFloatParameterFromMap(expensive_background_throttling_prefs, "cpu_budget", |
549 &prefs.expensive_background_throttling_cpu_budget); | 558 &prefs.expensive_background_throttling_cpu_budget); |
550 SetFloatParameterFromMap( | 559 SetFloatParameterFromMap( |
551 expensive_background_throttling_prefs, "initial_budget", | 560 expensive_background_throttling_prefs, "initial_budget", |
552 &prefs.expensive_background_throttling_initial_budget); | 561 &prefs.expensive_background_throttling_initial_budget); |
553 SetFloatParameterFromMap(expensive_background_throttling_prefs, "max_budget", | 562 SetFloatParameterFromMap(expensive_background_throttling_prefs, "max_budget", |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 } else { | 1012 } else { |
1004 render_view_ready_on_process_launch_ = true; | 1013 render_view_ready_on_process_launch_ = true; |
1005 } | 1014 } |
1006 } | 1015 } |
1007 | 1016 |
1008 void RenderViewHostImpl::RenderViewReady() { | 1017 void RenderViewHostImpl::RenderViewReady() { |
1009 delegate_->RenderViewReady(this); | 1018 delegate_->RenderViewReady(this); |
1010 } | 1019 } |
1011 | 1020 |
1012 } // namespace content | 1021 } // namespace content |
OLD | NEW |