Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / browser / devtools / devtools_protocol.h
index cbc075b..71c24ab 100644 (file)
@@ -127,12 +127,18 @@ class DevToolsProtocol {
    public:
     typedef base::Callback<scoped_refptr<DevToolsProtocol::Response>(
         scoped_refptr<DevToolsProtocol::Command> command)> CommandHandler;
+    typedef base::Callback<void(
+        scoped_refptr<DevToolsProtocol::Notification> notification)>
+            NotificationHandler;
 
     virtual ~Handler();
 
     virtual scoped_refptr<DevToolsProtocol::Response> HandleCommand(
         scoped_refptr<DevToolsProtocol::Command> command);
 
+    virtual void HandleNotification(
+        scoped_refptr<DevToolsProtocol::Notification> notification);
+
     void SetNotifier(const Notifier& notifier);
 
    protected:
@@ -141,6 +147,9 @@ class DevToolsProtocol {
     void RegisterCommandHandler(const std::string& command,
                                 const CommandHandler& handler);
 
+    void RegisterNotificationHandler(const std::string& notification,
+                                     const NotificationHandler& handler);
+
     // Sends notification to the client. Takes ownership of |params|.
     void SendNotification(const std::string& method,
                           base::DictionaryValue* params);
@@ -153,9 +162,11 @@ class DevToolsProtocol {
 
    private:
     typedef std::map<std::string, CommandHandler> CommandHandlers;
+    typedef std::map<std::string, NotificationHandler> NotificationHandlers;
 
     Notifier notifier_;
     CommandHandlers command_handlers_;
+    NotificationHandlers notification_handlers_;
 
     DISALLOW_COPY_AND_ASSIGN(Handler);
   };