OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/loader/loader_globals.h" |
| 6 #include "base/logging.h" |
| 7 |
| 8 namespace content { |
| 9 |
| 10 namespace { |
| 11 |
| 12 static LoaderGlobals* g_loader_globals; |
| 13 |
| 14 } // namespace |
| 15 |
| 16 // static |
| 17 LoaderGlobals* LoaderGlobals::Get() { |
| 18 return g_loader_globals; |
| 19 } |
| 20 |
| 21 LoaderGlobals::LoaderGlobals( |
| 22 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_runner, |
| 23 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_runner) |
| 24 : main_thread_task_runner_(main_thread_runner), |
| 25 io_thread_task_runner_(io_thread_runner) { |
| 26 DCHECK(!g_loader_globals); |
| 27 g_loader_globals = this; |
| 28 } |
| 29 |
| 30 LoaderGlobals::~LoaderGlobals() { |
| 31 g_loader_globals = NULL; |
| 32 } |
| 33 |
| 34 } // namespace content |
OLD | NEW |