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

Unified Diff: chrome/browser/ui/ash/chrome_shell_content_state.cc

Issue 2615663002: Fix MediaClient::RequestCaptureState(). (Closed)
Patch Set: rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/chrome_shell_content_state.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_content_state.cc b/chrome/browser/ui/ash/chrome_shell_content_state.cc
index 4de2fe820ffdc90203871ca1d4423510ff36cd99..6d8ecb1c3172f11359d3668cfffacb6b0e247999 100644
--- a/chrome/browser/ui/ash/chrome_shell_content_state.cc
+++ b/chrome/browser/ui/ash/chrome_shell_content_state.cc
@@ -9,8 +9,27 @@
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_context.h"
-ChromeShellContentState::ChromeShellContentState() {}
-ChromeShellContentState::~ChromeShellContentState() {}
+namespace {
+
+ChromeShellContentState* g_instance = nullptr;
+
+} // namespace
+
+// static
+ChromeShellContentState* ChromeShellContentState::GetInstance() {
+ DCHECK(g_instance);
+ return g_instance;
+}
+
+ChromeShellContentState::ChromeShellContentState() {
+ DCHECK(!g_instance);
+ g_instance = this;
+}
+
+ChromeShellContentState::~ChromeShellContentState() {
+ DCHECK_EQ(this, g_instance);
+ g_instance = nullptr;
+}
content::BrowserContext* ChromeShellContentState::GetActiveBrowserContext() {
DCHECK(user_manager::UserManager::Get()->GetLoggedInUsers().size());
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_content_state.h ('k') | chrome/browser/ui/ash/chrome_shell_content_state_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698