1 // Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 5 #include "tests/cefclient/browser/main_context.h" 6 7 #include "include/base/cef_logging.h" 8 9 namespace client { 10 11 namespace { 12 13 MainContext* g_main_context = nullptr; 14 15 } // namespace 16 17 // static Get()18MainContext* MainContext::Get() { 19 DCHECK(g_main_context); 20 return g_main_context; 21 } 22 MainContext()23MainContext::MainContext() { 24 DCHECK(!g_main_context); 25 g_main_context = this; 26 } 27 ~MainContext()28MainContext::~MainContext() { 29 g_main_context = nullptr; 30 } 31 32 } // namespace client 33