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

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

Issue 508973003: DevTools: Protocol handler generator for content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style fix 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 #include "content/browser/devtools/protocol/devtools_protocol_frontend.h"
6
7 namespace content {
8
9 DevToolsProtocolFrontend::DevToolsProtocolFrontend(
10 const EventCallback& event_callback,
11 const ResponseCallback& response_callback)
12 : event_callback_(event_callback),
13 response_callback_(response_callback) {
14 }
15
16 DevToolsProtocolFrontend::~DevToolsProtocolFrontend() {
17 }
18
19 void DevToolsProtocolFrontend::SendNotification(const std::string& method,
20 base::DictionaryValue* params) {
21 event_callback_.Run(method, params);
22 }
23
24 void DevToolsProtocolFrontend::SendAsyncResponse(
25 scoped_refptr<DevToolsProtocol::Response> response) {
26 response_callback_.Run(response);
27 }
28
29 typedef DevToolsProtocolFrontend::Response Response;
30
31 Response Response::FallThrough() {
32 Response response;
33 response.status_ = ResponseStatus::RESPONSE_STATUS_FALLTHROUGH;
34 return response;
35 }
36
37 Response Response::OK() {
38 Response response;
39 response.status_ = ResponseStatus::RESPONSE_STATUS_OK;
40 return response;
41 }
42
43 Response Response::InvalidParams(const std::string& message) {
44 Response response;
45 response.status_ = ResponseStatus::RESPONSE_STATUS_INVALID_PARAMS;
46 response.message_ = message;
47 return response;
48 }
49
50 Response Response::InternalError(const std::string& message) {
51 Response response;
52 response.status_ = ResponseStatus::RESPONSE_STATUS_INTERNAL_ERROR;
53 response.message_ = message;
54 return response;
55 }
56
57 Response Response::ServerError(const std::string& message) {
58 Response response;
59 response.status_ = ResponseStatus::RESPONSE_STATUS_SERVER_ERROR;
60 response.message_ = message;
61 return response;
62 }
63
64 DevToolsProtocolFrontend::ResponseStatus Response::status() const {
65 return status_;
66 }
67
68 const std::string& Response::message() const {
69 return message_;
70 }
71
72 Response::Response() {
73 }
74
75 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698