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

Unified Diff: chrome/browser/devtools/devtools_protocol.h

Issue 290873002: DevTools: allow embedder handling remote debugger commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary include Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
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.
« no previous file with comments | « chrome/browser/devtools/chrome_devtools_manager_delegate.cc ('k') | chrome/browser/devtools/devtools_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698