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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2479673002: Expose MemoryCoordinator's global budget information. (Closed)
Patch Set: Small cleanup. Created 4 years, 1 month 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 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 // base::Unretained is safe because the lifetime of MemoryCoordinator is 1397 // base::Unretained is safe because the lifetime of MemoryCoordinator is
1398 // tied to the lifetime of the browser process. 1398 // tied to the lifetime of the browser process.
1399 base::MemoryCoordinatorProxy::GetInstance()-> 1399 base::MemoryCoordinatorProxy::GetInstance()->
1400 SetGetCurrentMemoryStateCallback(base::Bind( 1400 SetGetCurrentMemoryStateCallback(base::Bind(
1401 &MemoryCoordinator::GetCurrentMemoryState, 1401 &MemoryCoordinator::GetCurrentMemoryState,
1402 base::Unretained(MemoryCoordinator::GetInstance()))); 1402 base::Unretained(MemoryCoordinator::GetInstance())));
1403 base::MemoryCoordinatorProxy::GetInstance()-> 1403 base::MemoryCoordinatorProxy::GetInstance()->
1404 SetSetCurrentMemoryStateForTestingCallback(base::Bind( 1404 SetSetCurrentMemoryStateForTestingCallback(base::Bind(
1405 &MemoryCoordinator::SetCurrentMemoryStateForTesting, 1405 &MemoryCoordinator::SetCurrentMemoryStateForTesting,
1406 base::Unretained(MemoryCoordinator::GetInstance()))); 1406 base::Unretained(MemoryCoordinator::GetInstance())));
1407 base::MemoryCoordinatorProxy::GetInstance()->
1408 SetGetRemainingGlobalBudgetCallback(base::Bind(
1409 &MemoryCoordinator::GetRemainingGlobalBudget,
1410 base::Unretained(MemoryCoordinator::GetInstance())));
1407 return; 1411 return;
1408 } 1412 }
1409 1413
1410 // TODO(chrisha): Abstract away this construction mess to a helper function, 1414 // TODO(chrisha): Abstract away this construction mess to a helper function,
1411 // once MemoryPressureMonitor is made a concrete class. 1415 // once MemoryPressureMonitor is made a concrete class.
1412 #if defined(OS_CHROMEOS) 1416 #if defined(OS_CHROMEOS)
1413 if (chromeos::switches::MemoryPressureHandlingEnabled()) { 1417 if (chromeos::switches::MemoryPressureHandlingEnabled()) {
1414 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( 1418 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor(
1415 chromeos::switches::GetMemoryPressureThresholds())); 1419 chromeos::switches::GetMemoryPressureThresholds()));
1416 } 1420 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = 1596 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner =
1593 audio_thread_->task_runner(); 1597 audio_thread_->task_runner();
1594 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), 1598 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner),
1595 std::move(worker_task_runner), 1599 std::move(worker_task_runner),
1596 MediaInternals::GetInstance()); 1600 MediaInternals::GetInstance());
1597 } 1601 }
1598 CHECK(audio_manager_); 1602 CHECK(audio_manager_);
1599 } 1603 }
1600 1604
1601 } // namespace content 1605 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698