OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 5 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 content::BrowserContext* context) { | 167 content::BrowserContext* context) { |
168 // Whenever we try to build a destruction ordering, we should also dump a | 168 // Whenever we try to build a destruction ordering, we should also dump a |
169 // dependency graph to "/path/to/context/context-dependencies.dot". | 169 // dependency graph to "/path/to/context/context-dependencies.dot". |
170 if (CommandLine::ForCurrentProcess()->HasSwitch( | 170 if (CommandLine::ForCurrentProcess()->HasSwitch( |
171 kDumpBrowserContextDependencyGraphFlag)) { | 171 kDumpBrowserContextDependencyGraphFlag)) { |
172 base::FilePath dot_file = | 172 base::FilePath dot_file = |
173 context->GetPath().AppendASCII("browser-context-dependencies.dot"); | 173 context->GetPath().AppendASCII("browser-context-dependencies.dot"); |
174 std::string contents = dependency_graph_.DumpAsGraphviz( | 174 std::string contents = dependency_graph_.DumpAsGraphviz( |
175 "BrowserContext", | 175 "BrowserContext", |
176 base::Bind(&BrowserContextKeyedBaseFactoryGetNodeName)); | 176 base::Bind(&BrowserContextKeyedBaseFactoryGetNodeName)); |
177 file_util::WriteFile(dot_file, contents.c_str(), contents.size()); | 177 base::WriteFile(dot_file, contents.c_str(), contents.size()); |
178 } | 178 } |
179 } | 179 } |
180 #endif // NDEBUG | 180 #endif // NDEBUG |
OLD | NEW |