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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/devtools/protocol/schema_handler.h" 5 #include "content/browser/devtools/protocol/schema_handler.h"
6 6
7 namespace content { 7 namespace content {
8 namespace devtools { 8 namespace protocol {
9 namespace schema {
10
11 using Response = DevToolsProtocolClient::Response;
12 9
13 SchemaHandler::SchemaHandler() { 10 SchemaHandler::SchemaHandler() {
14 } 11 }
15 12
16 SchemaHandler::~SchemaHandler() { 13 SchemaHandler::~SchemaHandler() {
17 } 14 }
18 15
16 void SchemaHandler::Wire(UberDispatcher* dispatcher) {
17 Schema::Dispatcher::wire(dispatcher, this);
18 }
19
20 Response SchemaHandler::Disable() {
21 return Response::OK();
22 }
23
19 Response SchemaHandler::GetDomains( 24 Response SchemaHandler::GetDomains(
20 std::vector<scoped_refptr<Domain>>* domains) { 25 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) {
21 // TODO(kozyatisnkiy): get this from the target instead of hardcoding a list. 26 // TODO(kozyatisnkiy): get this from the target instead of hardcoding a list.
22 static const char kVersion[] = "1.2"; 27 static const char kVersion[] = "1.2";
23 static const char* kDomains[] = { 28 static const char* kDomains[] = {
24 "Inspector", "Memory", "Page", "Rendering", "Emulation", "Security", 29 "Inspector", "Memory", "Page", "Rendering", "Emulation", "Security",
25 "Network", "Database", "IndexedDB", "CacheStorage", "DOMStorage", "CSS", 30 "Network", "Database", "IndexedDB", "CacheStorage", "DOMStorage", "CSS",
26 "ApplicationCache", "DOM", "IO", "DOMDebugger", "ServiceWorker", 31 "ApplicationCache", "DOM", "IO", "DOMDebugger", "ServiceWorker",
27 "Input", "LayerTree", "DeviceOrientation", "Tracing", "Animation", 32 "Input", "LayerTree", "DeviceOrientation", "Tracing", "Animation",
28 "Accessibility", "Storage", "Log", "Runtime", "Debugger", 33 "Accessibility", "Storage", "Log", "Runtime", "Debugger",
29 "Profiler", "HeapProfiler", "Schema", "Target" 34 "Profiler", "HeapProfiler", "Schema", "Target"
30 }; 35 };
36 *domains = protocol::Array<Schema::Domain>::create();
31 for (size_t i = 0; i < arraysize(kDomains); ++i) { 37 for (size_t i = 0; i < arraysize(kDomains); ++i) {
32 domains->push_back(Domain::Create() 38 (*domains)->addItem(Schema::Domain::Create()
33 ->set_name(kDomains[i]) 39 .SetName(kDomains[i])
34 ->set_version(kVersion)); 40 .SetVersion(kVersion)
41 .Build());
35 } 42 }
36 return Response::OK(); 43 return Response::OK();
37 } 44 }
38 45
39 } // namespace schema 46 } // namespace protocol
40 } // namespace devtools
41 } // namespace content 47 } // namespace content
OLDNEW
« 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