Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 93 |
| 94 std::string Serialize(); | 94 std::string Serialize(); |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 std::string method_; | 97 std::string method_; |
| 98 scoped_ptr<base::DictionaryValue> params_; | 98 scoped_ptr<base::DictionaryValue> params_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(Notification); | 100 DISALLOW_COPY_AND_ASSIGN(Notification); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 class Event { | |
| 104 public: | |
| 105 ~Event(); | |
| 106 | |
| 107 std::string Serialize(); | |
| 108 | |
| 109 private: | |
| 110 friend class DevToolsProtocol; | |
| 111 | |
| 112 std::string method_; | |
| 113 scoped_ptr<base::DictionaryValue> params_; | |
| 114 | |
| 115 Event(const std::string& method, base::DictionaryValue* params); | |
|
pfeldman
2013/03/21 06:30:08
List constructor first. DISALLOW_COPY_AND_ASSIGN m
Vladislav Kaznacheev
2013/03/21 07:24:02
Done.
| |
| 116 }; | |
| 117 | |
| 103 class Handler { | 118 class Handler { |
| 104 public: | 119 public: |
| 105 typedef base::Callback<scoped_ptr<DevToolsProtocol::Response>( | 120 typedef base::Callback<scoped_ptr<DevToolsProtocol::Response>( |
| 106 DevToolsProtocol::Command* command)> CommandHandler; | 121 DevToolsProtocol::Command* command)> CommandHandler; |
| 107 | 122 |
| 108 virtual ~Handler(); | 123 virtual ~Handler(); |
| 109 | 124 |
| 110 virtual scoped_ptr<DevToolsProtocol::Response> HandleCommand( | 125 virtual scoped_ptr<DevToolsProtocol::Response> HandleCommand( |
| 111 DevToolsProtocol::Command* command); | 126 DevToolsProtocol::Command* command); |
| 112 | 127 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 127 | 142 |
| 128 Notifier notifier_; | 143 Notifier notifier_; |
| 129 CommandHandlers command_handlers_; | 144 CommandHandlers command_handlers_; |
| 130 | 145 |
| 131 DISALLOW_COPY_AND_ASSIGN(Handler); | 146 DISALLOW_COPY_AND_ASSIGN(Handler); |
| 132 }; | 147 }; |
| 133 | 148 |
| 134 static Command* ParseCommand(const std::string& json, | 149 static Command* ParseCommand(const std::string& json, |
| 135 std::string* error_response); | 150 std::string* error_response); |
| 136 | 151 |
| 152 static Event* CreateEvent(const std::string& method, | |
| 153 base::DictionaryValue* params); | |
| 154 | |
| 137 private: | 155 private: |
| 138 DevToolsProtocol() {} | 156 DevToolsProtocol() {} |
| 139 ~DevToolsProtocol() {} | 157 ~DevToolsProtocol() {} |
| 140 }; | 158 }; |
| 141 | 159 |
| 142 } // namespace content | 160 } // namespace content |
| 143 | 161 |
| 144 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ | 162 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_H_ |
| OLD | NEW |