| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 SYNC_JS_JS_CONTROLLER_H_ | 5 #ifndef SYNC_JS_JS_CONTROLLER_H_ |
| 6 #define SYNC_JS_JS_CONTROLLER_H_ | 6 #define SYNC_JS_JS_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // See README.js for design comments. | 9 // See README.js for design comments. |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 namespace csync { | 13 namespace syncer { |
| 14 | 14 |
| 15 class JsArgList; | 15 class JsArgList; |
| 16 class JsEventHandler; | 16 class JsEventHandler; |
| 17 class JsReplyHandler; | 17 class JsReplyHandler; |
| 18 template <typename T> class WeakHandle; | 18 template <typename T> class WeakHandle; |
| 19 | 19 |
| 20 // An interface for objects that JsEventHandlers directly interact | 20 // An interface for objects that JsEventHandlers directly interact |
| 21 // with. JsEventHandlers can add themselves to receive events and | 21 // with. JsEventHandlers can add themselves to receive events and |
| 22 // also send messages which will eventually reach the backend. | 22 // also send messages which will eventually reach the backend. |
| 23 class JsController { | 23 class JsController { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 // Processes a JS message. The reply (if any) will be sent to | 38 // Processes a JS message. The reply (if any) will be sent to |
| 39 // |reply_handler| if it is initialized. | 39 // |reply_handler| if it is initialized. |
| 40 virtual void ProcessJsMessage( | 40 virtual void ProcessJsMessage( |
| 41 const std::string& name, const JsArgList& args, | 41 const std::string& name, const JsArgList& args, |
| 42 const WeakHandle<JsReplyHandler>& reply_handler) = 0; | 42 const WeakHandle<JsReplyHandler>& reply_handler) = 0; |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual ~JsController() {} | 45 virtual ~JsController() {} |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace csync | 48 } // namespace syncer |
| 49 | 49 |
| 50 #endif // SYNC_JS_JS_CONTROLLER_H_ | 50 #endif // SYNC_JS_JS_CONTROLLER_H_ |
| OLD | NEW |