OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROTOCOL_DEVTOOLS_PROTOCOL_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_CLIENT_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_CLIENT_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_CLIENT_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/values.h" | 12 #include "base/values.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 struct DevToolsCommandId { | 16 struct DevToolsCommandId { |
16 static const int kNoId; | 17 static const int kNoId; |
17 | 18 |
18 DevToolsCommandId(int call_id, int session_id) | 19 DevToolsCommandId(int call_id, int session_id) |
19 : call_id(call_id), session_id(session_id) {} | 20 : call_id(call_id), session_id(session_id) {} |
20 | 21 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // format the message. Do not use unless you must. | 59 // format the message. Do not use unless you must. |
59 void SendRawNotification(const std::string& message); | 60 void SendRawNotification(const std::string& message); |
60 | 61 |
61 void SendMessage(int session_id, const base::DictionaryValue& message); | 62 void SendMessage(int session_id, const base::DictionaryValue& message); |
62 | 63 |
63 explicit DevToolsProtocolClient(DevToolsProtocolDelegate* notifier); | 64 explicit DevToolsProtocolClient(DevToolsProtocolDelegate* notifier); |
64 virtual ~DevToolsProtocolClient(); | 65 virtual ~DevToolsProtocolClient(); |
65 | 66 |
66 protected: | 67 protected: |
67 void SendSuccess(DevToolsCommandId command_id, | 68 void SendSuccess(DevToolsCommandId command_id, |
68 scoped_ptr<base::DictionaryValue> params); | 69 std::unique_ptr<base::DictionaryValue> params); |
69 void SendNotification(const std::string& method, | 70 void SendNotification(const std::string& method, |
70 scoped_ptr<base::DictionaryValue> params); | 71 std::unique_ptr<base::DictionaryValue> params); |
71 | 72 |
72 private: | 73 private: |
73 friend class DevToolsProtocolDispatcher; | 74 friend class DevToolsProtocolDispatcher; |
74 | 75 |
75 DevToolsProtocolDelegate* notifier_; | 76 DevToolsProtocolDelegate* notifier_; |
76 DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolClient); | 77 DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolClient); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace content | 80 } // namespace content |
80 | 81 |
81 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_CLIENT_H_ | 82 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_CLIENT_H_ |
OLD | NEW |