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 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 kErrorInvalidParams = -32602, | 24 kErrorInvalidParams = -32602, |
25 kErrorInternalError = -32603 | 25 kErrorInternalError = -32603 |
26 }; | 26 }; |
27 | 27 |
28 class Response; | 28 class Response; |
29 | 29 |
30 class Command { | 30 class Command { |
31 public: | 31 public: |
32 ~Command(); | 32 ~Command(); |
33 | 33 |
34 int id() { return id_; } | 34 int id() const { return id_; } |
35 std::string domain() { return domain_; } | 35 std::string domain() const { return domain_; } |
36 std::string method() { return method_; } | 36 std::string method() const { return method_; } |
37 base::DictionaryValue* params() { return params_.get(); } | 37 base::DictionaryValue* params() const { return params_.get(); } |
38 | 38 |
39 // Creates success response. Takes ownership of |result|. | 39 // Creates success response. Takes ownership of |result|. |
40 scoped_ptr<Response> SuccessResponse(base::DictionaryValue* result); | 40 scoped_ptr<Response> SuccessResponse(base::DictionaryValue* result) const; |
41 | 41 |
42 // Creates error response. Caller takes ownership of the return value. | 42 // Creates error response. Caller takes ownership of the return value. |
43 scoped_ptr<Response> ErrorResponse(int error_code, | 43 scoped_ptr<Response> ErrorResponse(int error_code, |
44 const std::string& error_message); | 44 const std::string& error_message) const; |
45 | 45 |
46 // Creates error response. Caller takes ownership of the return value. | 46 // Creates error response. Caller takes ownership of the return value. |
47 scoped_ptr<Response> NoSuchMethodErrorResponse(); | 47 scoped_ptr<Response> NoSuchMethodErrorResponse() const; |
48 | 48 |
49 private: | 49 private: |
50 friend class DevToolsProtocol; | 50 friend class DevToolsProtocol; |
51 Command(int id, const std::string& domain, const std::string& method, | 51 Command(int id, const std::string& domain, const std::string& method, |
52 base::DictionaryValue* params); | 52 base::DictionaryValue* params); |
53 | 53 |
54 int id_; | 54 int id_; |
55 std::string domain_; | 55 std::string domain_; |
56 std::string method_; | 56 std::string method_; |
57 scoped_ptr<base::DictionaryValue> params_; | 57 scoped_ptr<base::DictionaryValue> params_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 std::string* error_response); | 99 std::string* error_response); |
100 | 100 |
101 private: | 101 private: |
102 DevToolsProtocol() {} | 102 DevToolsProtocol() {} |
103 ~DevToolsProtocol() {} | 103 ~DevToolsProtocol() {} |
104 }; | 104 }; |
105 | 105 |
106 } // namespace content | 106 } // namespace content |
107 | 107 |
108 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ | 108 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ |
OLD | NEW |