| 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 "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "platform/TracedValue.h" | 8 #include "platform/TracedValue.h" |
| 9 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorWebSocketCreateEvent::
data(Document* document, unsigned long identifier, const KURL& url, const String
& protocol) | 13 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorWebSocketCreateEvent::
data(Document* document, unsigned long identifier, const KURL& url, const String
& protocol) |
| 14 { | 14 { |
| 15 RefPtr<TracedValue> value = TracedValue::create(); | 15 RefPtr<TracedValue> value = TracedValue::create(); |
| 16 value->setInteger("identifier", identifier); | 16 value->setInteger("identifier", identifier); |
| 17 value->setString("url", url.string()); | 17 value->setString("url", url.string()); |
| 18 value->setString("frame", toHexString(document->frame())); | 18 value->setString("frame", toHexString(document->frame())); |
| 19 if (!protocol.isNull()) | 19 if (!protocol.isNull()) |
| 20 value->setString("webSocketProtocol", protocol); | 20 value->setString("webSocketProtocol", protocol); |
| 21 setCallStack(value.get()); | 21 requestCallStackSample(); |
| 22 return value.release(); | 22 return value.release(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorWebSocketEvent::data(D
ocument* document, unsigned long identifier) | 25 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorWebSocketEvent::data(D
ocument* document, unsigned long identifier) |
| 26 { | 26 { |
| 27 RefPtr<TracedValue> value = TracedValue::create(); | 27 RefPtr<TracedValue> value = TracedValue::create(); |
| 28 value->setInteger("identifier", identifier); | 28 value->setInteger("identifier", identifier); |
| 29 value->setString("frame", toHexString(document->frame())); | 29 value->setString("frame", toHexString(document->frame())); |
| 30 setCallStack(value.get()); | 30 requestCallStackSample(); |
| 31 return value.release(); | 31 return value.release(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace blink | 34 } // namespace blink |
| OLD | NEW |