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

Unified Diff: components/devtools_service/devtools_registry_impl.h

Issue 1164383002: Mandoline DevTools service: remote debugging protocol over HTTP/WebSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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: components/devtools_service/devtools_registry_impl.h
diff --git a/components/devtools_service/devtools_registry_impl.h b/components/devtools_service/devtools_registry_impl.h
index c12c0de2f10feae5df4c97a87bcbe215e0a6e044..431f39a601c9a938b0cd091909edb1dc5f5477d6 100644
--- a/components/devtools_service/devtools_registry_impl.h
+++ b/components/devtools_service/devtools_registry_impl.h
@@ -5,30 +5,57 @@
#ifndef COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_REGISTRY_IMPL_H_
#define COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_REGISTRY_IMPL_H_
+#include <map>
+#include <string>
+
#include "base/macros.h"
+#include "base/memory/linked_ptr.h"
#include "components/devtools_service/public/interfaces/devtools_service.mojom.h"
#include "mojo/common/weak_binding_set.h"
namespace devtools_service {
+class DevToolsAgentHost;
class DevToolsService;
class DevToolsRegistryImpl : public DevToolsRegistry {
public:
+ class Iterator {
+ public:
+ // |registry| must outlive this object.
+ explicit Iterator(DevToolsRegistryImpl* registry);
+ ~Iterator();
+
+ bool IsAtEnd() const { return iter_ == registry_->agents_.end(); }
+ void Advance() { ++iter_; }
+
+ DevToolsAgentHost* value() { return iter_->second.get(); }
+
+ private:
+ DevToolsRegistryImpl* const registry_;
+ std::map<std::string, linked_ptr<DevToolsAgentHost>>::const_iterator iter_;
+ };
+
// |service| must outlive this object.
explicit DevToolsRegistryImpl(DevToolsService* service);
~DevToolsRegistryImpl() override;
void BindToRegistryRequest(mojo::InterfaceRequest<DevToolsRegistry> request);
+ DevToolsAgentHost* GetAgentById(const std::string& id);
+
private:
// DevToolsRegistry implementation.
void RegisterAgent(DevToolsAgentPtr agent) override;
+ void OnAgentConnectionError(const std::string& id);
+
DevToolsService* const service_;
mojo::WeakBindingSet<DevToolsRegistry> bindings_;
+ std::map<std::string, linked_ptr<DevToolsAgentHost>> agents_;
+
DISALLOW_COPY_AND_ASSIGN(DevToolsRegistryImpl);
};

Powered by Google App Engine
This is Rietveld 408576698