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

Side by Side Diff: content/browser/devtools/protocol/schema_handler.cc

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: addressed comments 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 protocol { 8 namespace protocol {
9 9
10 SchemaHandler::SchemaHandler() { 10 SchemaHandler::SchemaHandler()
11 : DevToolsDomainHandler(Schema::Metainfo::domainName) {
11 } 12 }
12 13
13 SchemaHandler::~SchemaHandler() { 14 SchemaHandler::~SchemaHandler() {
14 } 15 }
15 16
16 void SchemaHandler::Wire(UberDispatcher* dispatcher) { 17 void SchemaHandler::Wire(UberDispatcher* dispatcher) {
17 Schema::Dispatcher::wire(dispatcher, this); 18 Schema::Dispatcher::wire(dispatcher, this);
18 } 19 }
19 20
21 void SchemaHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
22 }
23
20 Response SchemaHandler::Disable() { 24 Response SchemaHandler::Disable() {
21 return Response::OK(); 25 return Response::OK();
22 } 26 }
23 27
24 Response SchemaHandler::GetDomains( 28 Response SchemaHandler::GetDomains(
25 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) { 29 std::unique_ptr<protocol::Array<Schema::Domain>>* domains) {
26 // TODO(kozyatisnkiy): get this from the target instead of hardcoding a list. 30 // TODO(kozyatisnkiy): get this from the target instead of hardcoding a list.
27 static const char kVersion[] = "1.2"; 31 static const char kVersion[] = "1.2";
28 static const char* kDomains[] = { 32 static const char* kDomains[] = {
29 "Inspector", "Memory", "Page", "Rendering", "Emulation", "Security", 33 "Inspector", "Memory", "Page", "Rendering", "Emulation", "Security",
30 "Network", "Database", "IndexedDB", "CacheStorage", "DOMStorage", "CSS", 34 "Network", "Database", "IndexedDB", "CacheStorage", "DOMStorage", "CSS",
31 "ApplicationCache", "DOM", "IO", "DOMDebugger", "ServiceWorker", 35 "ApplicationCache", "DOM", "IO", "DOMDebugger", "ServiceWorker",
32 "Input", "LayerTree", "DeviceOrientation", "Tracing", "Animation", 36 "Input", "LayerTree", "DeviceOrientation", "Tracing", "Animation",
33 "Accessibility", "Storage", "Log", "Runtime", "Debugger", 37 "Accessibility", "Storage", "Log", "Runtime", "Debugger",
34 "Profiler", "HeapProfiler", "Schema", "Target" 38 "Profiler", "HeapProfiler", "Schema", "Target"
35 }; 39 };
36 *domains = protocol::Array<Schema::Domain>::create(); 40 *domains = protocol::Array<Schema::Domain>::create();
37 for (size_t i = 0; i < arraysize(kDomains); ++i) { 41 for (size_t i = 0; i < arraysize(kDomains); ++i) {
38 (*domains)->addItem(Schema::Domain::Create() 42 (*domains)->addItem(Schema::Domain::Create()
39 .SetName(kDomains[i]) 43 .SetName(kDomains[i])
40 .SetVersion(kVersion) 44 .SetVersion(kVersion)
41 .Build()); 45 .Build());
42 } 46 }
43 return Response::OK(); 47 return Response::OK();
44 } 48 }
45 49
46 } // namespace protocol 50 } // namespace protocol
47 } // namespace content 51 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698