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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_frontend.h

Issue 508973003: DevTools: Protocol handler generator for content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_FRONTEND_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_FRONTEND_H_
7
8 #include "content/browser/devtools/devtools_protocol.h"
9
10 namespace content {
11
12 class DevToolsProtocolFrontend {
13 public:
14 typedef base::Callback<void(const std::string& event,
15 base::DictionaryValue* params)> EventCallback;
16 enum ResponseStatus {
17 RESPONSE_STATUS_FALLTHROUGH,
18 RESPONSE_STATUS_OK,
19 RESPONSE_STATUS_INVALID_PARAMS,
20 RESPONSE_STATUS_INTERNAL_ERROR,
21 RESPONSE_STATUS_SERVER_ERROR,
22 };
23
24 struct Response {
25 public:
26 static Response FallThrough();
27 static Response OK();
28 static Response InvalidParams(const std::string& message);
29 static Response InternalError(const std::string& message);
30 static Response ServerError(const std::string& message);
31
32 ResponseStatus status();
33 const std::string& message();
34 private:
35 ResponseStatus status_;
dgozman 2014/09/12 11:48:45 Let's add private constructor, so all clients are
vkuzkokov 2014/09/12 14:22:52 Done.
36 std::string message_;
37 };
38
39 protected:
40 explicit DevToolsProtocolFrontend(const EventCallback& event_callback);
41 virtual ~DevToolsProtocolFrontend();
42
43 void SendNotification(const std::string& method,
44 base::DictionaryValue* params);
45
46 private:
47 EventCallback event_callback_;
48
49 DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolFrontend);
50 };
51
52 } // namespace content
53
54 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_FRONTEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698