OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // DevTools RPC subsystem is a simple string serialization-based rpc | 5 // DevTools RPC subsystem is a simple string serialization-based rpc |
6 // implementation. The client is responsible for defining the Rpc-enabled | 6 // implementation. The client is responsible for defining the Rpc-enabled |
7 // interface in terms of its macros: | 7 // interface in terms of its macros: |
8 // | 8 // |
9 // #define MYAPI_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3) | 9 // #define MYAPI_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3) |
10 // METHOD0(Method1) | 10 // METHOD0(Method1) |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 // This macro defines three classes: Class with the Api, ClassStub that is | 219 // This macro defines three classes: Class with the Api, ClassStub that is |
220 // serializing method calls and ClassDispatch that is capable of dispatching | 220 // serializing method calls and ClassDispatch that is capable of dispatching |
221 // the serialized message into its delegate. | 221 // the serialized message into its delegate. |
222 #define DEFINE_RPC_CLASS(Class, STRUCT) \ | 222 #define DEFINE_RPC_CLASS(Class, STRUCT) \ |
223 class Class {\ | 223 class Class {\ |
224 public: \ | 224 public: \ |
225 Class() { \ | 225 Class() { \ |
226 class_name = #Class; \ | 226 class_name = #Class; \ |
227 } \ | 227 } \ |
228 virtual ~Class() {} \ | 228 ~Class() {} \ |
229 \ | 229 \ |
230 STRUCT( \ | 230 STRUCT( \ |
231 TOOLS_RPC_API_METHOD0, \ | 231 TOOLS_RPC_API_METHOD0, \ |
232 TOOLS_RPC_API_METHOD1, \ | 232 TOOLS_RPC_API_METHOD1, \ |
233 TOOLS_RPC_API_METHOD2, \ | 233 TOOLS_RPC_API_METHOD2, \ |
234 TOOLS_RPC_API_METHOD3) \ | 234 TOOLS_RPC_API_METHOD3) \ |
235 std::string class_name; \ | 235 std::string class_name; \ |
236 private: \ | 236 private: \ |
237 DISALLOW_COPY_AND_ASSIGN(Class); \ | 237 DISALLOW_COPY_AND_ASSIGN(Class); \ |
238 }; \ | 238 }; \ |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 : delegate_(delegate) {} | 298 : delegate_(delegate) {} |
299 virtual ~DevToolsRpc() {}; | 299 virtual ~DevToolsRpc() {}; |
300 | 300 |
301 protected: | 301 protected: |
302 Delegate* delegate_; | 302 Delegate* delegate_; |
303 private: | 303 private: |
304 DISALLOW_COPY_AND_ASSIGN(DevToolsRpc); | 304 DISALLOW_COPY_AND_ASSIGN(DevToolsRpc); |
305 }; | 305 }; |
306 | 306 |
307 #endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_H_ | 307 #endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_H_ |
OLD | NEW |