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

Side by Side Diff: components/keyed_service/content/browser_context_dependency_manager.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/keyed_service/content/browser_context_dependency_manager.h" 5 #include "components/keyed_service/content/browser_context_dependency_manager.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 void BrowserContextDependencyManager::MarkBrowserContextLiveForTesting( 68 void BrowserContextDependencyManager::MarkBrowserContextLiveForTesting(
69 content::BrowserContext* context) { 69 content::BrowserContext* context) {
70 DependencyManager::MarkContextLiveForTesting(context); 70 DependencyManager::MarkContextLiveForTesting(context);
71 } 71 }
72 #endif // NDEBUG 72 #endif // NDEBUG
73 73
74 // static 74 // static
75 BrowserContextDependencyManager* 75 BrowserContextDependencyManager*
76 BrowserContextDependencyManager::GetInstance() { 76 BrowserContextDependencyManager::GetInstance() {
77 return Singleton<BrowserContextDependencyManager>::get(); 77 return base::Singleton<BrowserContextDependencyManager>::get();
78 } 78 }
79 79
80 BrowserContextDependencyManager::BrowserContextDependencyManager() { 80 BrowserContextDependencyManager::BrowserContextDependencyManager() {
81 } 81 }
82 82
83 BrowserContextDependencyManager::~BrowserContextDependencyManager() { 83 BrowserContextDependencyManager::~BrowserContextDependencyManager() {
84 } 84 }
85 85
86 #ifndef NDEBUG 86 #ifndef NDEBUG
87 void BrowserContextDependencyManager::DumpContextDependencies( 87 void BrowserContextDependencyManager::DumpContextDependencies(
88 base::SupportsUserData* context) const { 88 base::SupportsUserData* context) const {
89 // Whenever we try to build a destruction ordering, we should also dump a 89 // Whenever we try to build a destruction ordering, we should also dump a
90 // dependency graph to "/path/to/context/context-dependencies.dot". 90 // dependency graph to "/path/to/context/context-dependencies.dot".
91 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 91 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
92 kDumpBrowserContextDependencyGraphFlag)) { 92 kDumpBrowserContextDependencyGraphFlag)) {
93 base::FilePath dot_file = 93 base::FilePath dot_file =
94 static_cast<const content::BrowserContext*>(context) 94 static_cast<const content::BrowserContext*>(context)
95 ->GetPath() 95 ->GetPath()
96 .AppendASCII("browser-context-dependencies.dot"); 96 .AppendASCII("browser-context-dependencies.dot");
97 DumpDependenciesAsGraphviz("BrowserContext", dot_file); 97 DumpDependenciesAsGraphviz("BrowserContext", dot_file);
98 } 98 }
99 } 99 }
100 #endif // NDEBUG 100 #endif // NDEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698