| 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 "chrome/browser/lifetime/scoped_keep_alive.h" |
| 6 |
| 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/lifetime/keep_alive_registry.h" |
| 9 |
| 10 ScopedKeepAlive::ScopedKeepAlive(const std::string& token): token_(token) { |
| 11 DCHECK(!token_.empty()); |
| 12 |
| 13 KeepAliveRegistry::GetInstance()->RegisterToken(token_); |
| 14 } |
| 15 |
| 16 ScopedKeepAlive::~ScopedKeepAlive() { |
| 17 KeepAliveRegistry::GetInstance()->UnregisterToken(token_); |
| 18 } |
| OLD | NEW |