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

Unified Diff: content/public/browser/graph/browser_context_dependency_visitor_impl.h

Issue 18796007: Content API changes to integrate base/graph. (Closed) Base URL: marinoni.mon:/usr/local/google/src/chromium/src@base_graph_review
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/graph/browser_context_dependency_visitor_impl.h
diff --git a/content/public/browser/graph/browser_context_dependency_visitor_impl.h b/content/public/browser/graph/browser_context_dependency_visitor_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..8fab1cb6e4fa28ba805271136ca92fe2acce53c7
--- /dev/null
+++ b/content/public/browser/graph/browser_context_dependency_visitor_impl.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_GRAPH_BROWSER_CONTEXT_DEPENDENCY_VISITOR_IMPL_H_
+#define CONTENT_PUBLIC_BROWSER_GRAPH_BROWSER_CONTEXT_DEPENDENCY_VISITOR_IMPL_H_
+
+#include "base/callback.h"
+#include "base/compiler_specific.h"
+#include "base/graph/dependency_manager_instance.h"
+#include "content/public/browser/graph/browser_context_dependency_visitor.h"
+
+namespace content {
+
+template <typename Component>
+class BrowserContextDependencyVisitorImpl
+ : public BrowserContextDependencyVisitor {
+ public:
+ explicit BrowserContextDependencyVisitorImpl(
+ const base::Callback<void(Component*)>& completion_callback)
+ : completion_callback_(completion_callback) {}
+
+ virtual void Visit(
+ graph::DependencyManagerInstance* dependency_manager) OVERRIDE {
+ if (dependency_manager)
+ dependency_manager->Get<Component>(completion_callback_);
+ else
+ completion_callback_.Run(NULL);
+ }
+
+ private:
+ base::Callback<void(Component*)> completion_callback_;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_GRAPH_BROWSER_CONTEXT_DEPENDENCY_VISITOR_IMPL_H_
« no previous file with comments | « content/public/browser/graph/browser_context_dependency_visitor.h ('k') | content/public/test/test_browser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698