| 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->GetFrame())); | 21 value->SetString("frame", ToHexString(document->GetFrame())); |
| 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->GetFrame())); | 33 value->SetString("frame", ToHexString(document->GetFrame())); |
| 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 |