Index: chrome/browser/devtools/devtools_protocol.h |
diff --git a/chrome/browser/devtools/devtools_protocol.h b/chrome/browser/devtools/devtools_protocol.h |
index 9b15b9e3ac445939199b0a9b02483bcd7e1cde8b..2e658105c90d2874dd67a2e835ec5e07664ab8b8 100644 |
--- a/chrome/browser/devtools/devtools_protocol.h |
+++ b/chrome/browser/devtools/devtools_protocol.h |
@@ -16,6 +16,8 @@ |
// from chrome component (see content/browser/devtools/devtools_protocol.*). |
class DevToolsProtocol { |
public: |
+ class Response; |
+ |
class Message { |
public: |
virtual ~Message(); |
@@ -43,6 +45,12 @@ class DevToolsProtocol { |
int id() { return id_; } |
std::string Serialize(); |
+ // Creates success response. Takes ownership of |result|. |
+ scoped_ptr<Response> SuccessResponse(base::DictionaryValue* result); |
+ |
+ // Creates error response. |
+ scoped_ptr<Response> InvalidParamResponse(const std::string& param); |
+ |
private: |
int id_; |
@@ -56,12 +64,18 @@ class DevToolsProtocol { |
int id() { return id_; } |
int error_code() { return error_code_; } |
+ // Result ownership is passed to the caller. |
+ base::DictionaryValue* Serialize(); |
+ |
private: |
friend class DevToolsProtocol; |
- Response(int id, int error_code); |
+ Response(int id, int error_code, const std::string error_message); |
+ Response(int id, base::DictionaryValue* result); |
int id_; |
int error_code_; |
+ std::string error_message_; |
+ scoped_ptr<base::DictionaryValue> result_; |
DISALLOW_COPY_AND_ASSIGN(Response); |
}; |
@@ -81,6 +95,9 @@ class DevToolsProtocol { |
}; |
// Result ownership is passed to the caller. |
+ static Command* ParseCommand(base::DictionaryValue* command_dict); |
+ |
+ // Result ownership is passed to the caller. |
static Notification* ParseNotification(const std::string& json); |
// Result ownership is passed to the caller. |