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 #include "modules/websockets/InspectorWebSocketEvents.h" | 5 #include "modules/websockets/InspectorWebSocketEvents.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
8 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
9 #include <memory> | |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 std::unique_ptr<TracedValue> InspectorWebSocketCreateEvent::data( | 13 std::unique_ptr<TracedValue> InspectorWebSocketCreateEvent::data( |
14 Document* document, | 14 Document* document, |
15 unsigned long identifier, | 15 unsigned long identifier, |
16 const KURL& url, | 16 const KURL& url, |
17 const String& protocol) { | 17 const String& protocol) { |
18 std::unique_ptr<TracedValue> value = TracedValue::create(); | 18 std::unique_ptr<TracedValue> value = TracedValue::create(); |
19 value->setInteger("identifier", identifier); | 19 value->setInteger("identifier", identifier); |
20 value->setString("url", url.getString()); | 20 value->setString("url", url.getString()); |
21 value->setString("frame", toHexString(document->frame())); | 21 value->setString("frame", toHexString(document->frame())); |
22 if (!protocol.isNull()) | 22 if (!protocol.isNull()) |
23 value->setString("webSocketProtocol", protocol); | 23 value->setString("webSocketProtocol", protocol); |
24 setCallStack(value.get()); | 24 setCallStack(value.get()); |
25 return value; | 25 return value; |
26 } | 26 } |
27 | 27 |
28 std::unique_ptr<TracedValue> InspectorWebSocketEvent::data( | 28 std::unique_ptr<TracedValue> InspectorWebSocketEvent::data( |
29 Document* document, | 29 Document* document, |
30 unsigned long identifier) { | 30 unsigned long identifier) { |
31 std::unique_ptr<TracedValue> value = TracedValue::create(); | 31 std::unique_ptr<TracedValue> value = TracedValue::create(); |
32 value->setInteger("identifier", identifier); | 32 value->setInteger("identifier", identifier); |
33 value->setString("frame", toHexString(document->frame())); | 33 value->setString("frame", toHexString(document->frame())); |
34 setCallStack(value.get()); | 34 setCallStack(value.get()); |
35 return value; | 35 return value; |
36 } | 36 } |
37 | 37 |
38 } // namespace blink | 38 } // namespace blink |
OLD | NEW |