| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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/network_service_interface.h" |
| 6 |
| 7 #include "base/lazy_instance.h" |
| 8 #include "content/browser/loader/netlog_observer.h" |
| 9 #include "content/public/browser/browser_thread.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 namespace { |
| 14 |
| 15 NetworkServiceInterface* g_instance; |
| 16 |
| 17 } // namespace |
| 18 |
| 19 NetworkServiceInterface::NetworkServiceInterface() {} |
| 20 |
| 21 // static |
| 22 NetworkServiceInterface* NetworkServiceInterface::GetInstance() { |
| 23 static base::LazyInstance<NetworkServiceInterface>::Leaky instance; |
| 24 return instance.Pointer(); |
| 25 } |
| 26 |
| 27 void NetworkServiceInterface::EnableNetLogObserver() { |
| 28 // TODO(scottmg): This should probably keep track of a count. |
| 29 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 30 base::Bind(&NetLogObserver::Attach)); |
| 31 } |
| 32 |
| 33 void NetworkServiceInterface::DisableNetLogObserver() { |
| 34 // TODO(scottmg): This should probably keep track of a count. |
| 35 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 36 base::Bind(&NetLogObserver::Detach)); |
| 37 } |
| 38 |
| 39 } // namespace content |
| OLD | NEW |