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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 prefs.v8_cache_options = GetV8CacheOptions(); | 533 prefs.v8_cache_options = GetV8CacheOptions(); |
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 prefs.max_keyframe_distance_to_disable_background_video_sec = |
| 544 variations::GetVariationParamByFeatureAsInt( |
| 545 media::kBackgroundVideoTrackOptimization, |
| 546 "max_keyframe_distance_sec", |
| 547 prefs.max_keyframe_distance_to_disable_background_video_sec); |
543 | 548 |
544 std::map<std::string, std::string> expensive_background_throttling_prefs; | 549 std::map<std::string, std::string> expensive_background_throttling_prefs; |
545 variations::GetVariationParamsByFeature( | 550 variations::GetVariationParamsByFeature( |
546 features::kExpensiveBackgroundTimerThrottling, | 551 features::kExpensiveBackgroundTimerThrottling, |
547 &expensive_background_throttling_prefs); | 552 &expensive_background_throttling_prefs); |
548 SetFloatParameterFromMap(expensive_background_throttling_prefs, "cpu_budget", | 553 SetFloatParameterFromMap(expensive_background_throttling_prefs, "cpu_budget", |
549 &prefs.expensive_background_throttling_cpu_budget); | 554 &prefs.expensive_background_throttling_cpu_budget); |
550 SetFloatParameterFromMap( | 555 SetFloatParameterFromMap( |
551 expensive_background_throttling_prefs, "initial_budget", | 556 expensive_background_throttling_prefs, "initial_budget", |
552 &prefs.expensive_background_throttling_initial_budget); | 557 &prefs.expensive_background_throttling_initial_budget); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 } else { | 1008 } else { |
1004 render_view_ready_on_process_launch_ = true; | 1009 render_view_ready_on_process_launch_ = true; |
1005 } | 1010 } |
1006 } | 1011 } |
1007 | 1012 |
1008 void RenderViewHostImpl::RenderViewReady() { | 1013 void RenderViewHostImpl::RenderViewReady() { |
1009 delegate_->RenderViewReady(this); | 1014 delegate_->RenderViewReady(this); |
1010 } | 1015 } |
1011 | 1016 |
1012 } // namespace content | 1017 } // namespace content |
OLD | NEW |