OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/devtools_protocol.h" | 5 #include "content/browser/devtools/devtools_protocol.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 DevToolsProtocol::Response::Response(int id, DictionaryValue* result) | 119 DevToolsProtocol::Response::Response(int id, DictionaryValue* result) |
120 : id_(id), | 120 : id_(id), |
121 result_(result), | 121 result_(result), |
122 error_code_(0) { | 122 error_code_(0) { |
123 } | 123 } |
124 | 124 |
125 DevToolsProtocol::Response::Response(int id, | 125 DevToolsProtocol::Response::Response(int id, |
126 int error_code, | 126 int error_code, |
127 const std::string& error_message) | 127 const std::string& error_message) |
128 : id_(id), | 128 : id_(id), error_code_(error_code), error_message_(error_message) {} |
129 result_(NULL), | |
130 error_code_(error_code), | |
131 error_message_(error_message) { | |
132 } | |
133 | 129 |
134 DevToolsProtocol::Response::~Response() { | 130 DevToolsProtocol::Response::~Response() { |
135 } | 131 } |
136 | 132 |
137 DevToolsProtocol::Notification::Notification(const std::string& method, | 133 DevToolsProtocol::Notification::Notification(const std::string& method, |
138 DictionaryValue* params) | 134 DictionaryValue* params) |
139 : Message(method, params) { | 135 : Message(method, params) { |
140 } | 136 } |
141 | 137 |
142 DevToolsProtocol::Notification::~Notification() { | 138 DevToolsProtocol::Notification::~Notification() { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 Response response(0, kErrorParseError, error_message); | 253 Response response(0, kErrorParseError, error_message); |
258 if (error_response) | 254 if (error_response) |
259 *error_response = response.Serialize(); | 255 *error_response = response.Serialize(); |
260 return NULL; | 256 return NULL; |
261 } | 257 } |
262 | 258 |
263 return static_cast<DictionaryValue*>(message.release()); | 259 return static_cast<DictionaryValue*>(message.release()); |
264 } | 260 } |
265 | 261 |
266 } // namespace content | 262 } // namespace content |
OLD | NEW |