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

Unified Diff: content/browser/devtools/protocol/schema_handler.cc

Issue 2548263002: [DevTools] Migrate dom, emulation, inspector, network, page and schema handlers to new generator. (Closed)
Patch Set: rebased atop of roll Created 4 years 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/browser/devtools/protocol/schema_handler.h ('k') | content/browser/devtools/protocol_config.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/schema_handler.cc
diff --git a/content/browser/devtools/protocol/schema_handler.cc b/content/browser/devtools/protocol/schema_handler.cc
index a7cbe1ca168ec632fd902249fab30ec490c2452f..6583de68c6946f86fcaaf6b2cb3fe52153be46b9 100644
--- a/content/browser/devtools/protocol/schema_handler.cc
+++ b/content/browser/devtools/protocol/schema_handler.cc
@@ -5,10 +5,7 @@
#include "content/browser/devtools/protocol/schema_handler.h"
namespace content {
-namespace devtools {
-namespace schema {
-
-using Response = DevToolsProtocolClient::Response;
+namespace protocol {
SchemaHandler::SchemaHandler() {
}
@@ -16,8 +13,16 @@ SchemaHandler::SchemaHandler() {
SchemaHandler::~SchemaHandler() {
}
+void SchemaHandler::Wire(UberDispatcher* dispatcher) {
+ Schema::Dispatcher::wire(dispatcher, this);
+}
+
+Response SchemaHandler::Disable() {
+ return Response::OK();
+}
+
Response SchemaHandler::GetDomains(
- std::vector<scoped_refptr<Domain>>* domains) {
+ std::unique_ptr<protocol::Array<Schema::Domain>>* domains) {
// TODO(kozyatisnkiy): get this from the target instead of hardcoding a list.
static const char kVersion[] = "1.2";
static const char* kDomains[] = {
@@ -28,14 +33,15 @@ Response SchemaHandler::GetDomains(
"Accessibility", "Storage", "Log", "Runtime", "Debugger",
"Profiler", "HeapProfiler", "Schema", "Target"
};
+ *domains = protocol::Array<Schema::Domain>::create();
for (size_t i = 0; i < arraysize(kDomains); ++i) {
- domains->push_back(Domain::Create()
- ->set_name(kDomains[i])
- ->set_version(kVersion));
+ (*domains)->addItem(Schema::Domain::Create()
+ .SetName(kDomains[i])
+ .SetVersion(kVersion)
+ .Build());
}
return Response::OK();
}
-} // namespace schema
-} // namespace devtools
+} // namespace protocol
} // namespace content
« no previous file with comments | « content/browser/devtools/protocol/schema_handler.h ('k') | content/browser/devtools/protocol_config.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698