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

Unified Diff: content/test/fake_service_registry.h

Issue 1246283003: Split out audio debug recording from RenderProcessHostImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile. Created 4 years, 11 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
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/test/fake_service_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/fake_service_registry.h
diff --git a/content/test/fake_service_registry.h b/content/test/fake_service_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..732664c70a82d0e0fbfd8958dd0957d44741d28c
--- /dev/null
+++ b/content/test/fake_service_registry.h
@@ -0,0 +1,43 @@
+// Copyright 2015 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_TEST_FAKE_SERVICE_REGISTRY_H_
+#define CONTENT_TEST_FAKE_SERVICE_REGISTRY_H_
+
+#include <map>
+#include <string>
+
+#include "base/macros.h"
+#include "content/public/common/service_registry.h"
+
+namespace content {
+
+// An in-process ServiceRegistry. Connecting to a "remote" service connects to
+// one added locally.
+class FakeServiceRegistry : public ServiceRegistry {
+ public:
+ using ServiceRegistry::AddService;
+
+ FakeServiceRegistry();
+ ~FakeServiceRegistry() override;
+
+ // |ServiceRegistry| implementation.
+ void AddService(const std::string& service_name,
+ const base::Callback<void(mojo::ScopedMessagePipeHandle)>
+ service_factory) override;
+ void RemoveService(const std::string& service_name) override;
+ void ConnectToRemoteService(const base::StringPiece& name,
+ mojo::ScopedMessagePipeHandle handle) override;
+
+ private:
+ using ServiceMap = std::map<std::string,
+ base::Callback<void(mojo::ScopedMessagePipeHandle)>>;
+ ServiceMap service_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeServiceRegistry);
+};
+
+} // namespace content
+
+#endif // CONTENT_TEST_FAKE_SERVICE_REGISTRY_H_
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/test/fake_service_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698