OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "bindings/v8/V8ObjectConstructor.h" | 43 #include "bindings/v8/V8ObjectConstructor.h" |
44 #include "bindings/v8/V8WindowShell.h" | 44 #include "bindings/v8/V8WindowShell.h" |
45 #include "bindings/v8/WorkerScriptController.h" | 45 #include "bindings/v8/WorkerScriptController.h" |
46 #include "bindings/v8/custom/V8CustomXPathNSResolver.h" | 46 #include "bindings/v8/custom/V8CustomXPathNSResolver.h" |
47 #include "core/dom/Element.h" | 47 #include "core/dom/Element.h" |
48 #include "core/dom/NodeFilter.h" | 48 #include "core/dom/NodeFilter.h" |
49 #include "core/dom/QualifiedName.h" | 49 #include "core/dom/QualifiedName.h" |
50 #include "core/frame/LocalFrame.h" | 50 #include "core/frame/LocalFrame.h" |
51 #include "core/frame/Settings.h" | 51 #include "core/frame/Settings.h" |
52 #include "core/inspector/BindingVisitors.h" | 52 #include "core/inspector/BindingVisitors.h" |
| 53 #include "core/inspector/InspectorTraceEvents.h" |
53 #include "core/loader/FrameLoader.h" | 54 #include "core/loader/FrameLoader.h" |
54 #include "core/loader/FrameLoaderClient.h" | 55 #include "core/loader/FrameLoaderClient.h" |
55 #include "core/workers/WorkerGlobalScope.h" | 56 #include "core/workers/WorkerGlobalScope.h" |
56 #include "core/xml/XPathNSResolver.h" | 57 #include "core/xml/XPathNSResolver.h" |
| 58 #include "platform/EventTracer.h" |
57 #include "platform/JSONValues.h" | 59 #include "platform/JSONValues.h" |
58 #include "wtf/ArrayBufferContents.h" | 60 #include "wtf/ArrayBufferContents.h" |
59 #include "wtf/MainThread.h" | 61 #include "wtf/MainThread.h" |
60 #include "wtf/MathExtras.h" | 62 #include "wtf/MathExtras.h" |
61 #include "wtf/StdLibExtras.h" | 63 #include "wtf/StdLibExtras.h" |
62 #include "wtf/Threading.h" | 64 #include "wtf/Threading.h" |
63 #include "wtf/text/AtomicString.h" | 65 #include "wtf/text/AtomicString.h" |
64 #include "wtf/text/CString.h" | 66 #include "wtf/text/CString.h" |
65 #include "wtf/text/StringBuffer.h" | 67 #include "wtf/text/StringBuffer.h" |
66 #include "wtf/text/StringHash.h" | 68 #include "wtf/text/StringHash.h" |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 , m_contextScope(v8::Context::New(isolate)) | 740 , m_contextScope(v8::Context::New(isolate)) |
739 , m_scriptState(ScriptState::create(isolate->GetCurrentContext(), DOMWrapper
World::create())) | 741 , m_scriptState(ScriptState::create(isolate->GetCurrentContext(), DOMWrapper
World::create())) |
740 { | 742 { |
741 } | 743 } |
742 | 744 |
743 V8ExecutionScope::~V8ExecutionScope() | 745 V8ExecutionScope::~V8ExecutionScope() |
744 { | 746 { |
745 m_scriptState->disposePerContextData(); | 747 m_scriptState->disposePerContextData(); |
746 } | 748 } |
747 | 749 |
| 750 void GetDevToolsFunctionInfo(v8::Handle<v8::Function> function, v8::Isolate* iso
late, int& scriptId, String& resourceName, int& lineNumber) |
| 751 { |
| 752 v8::Handle<v8::Function> originalFunction = getBoundFunction(function); |
| 753 scriptId = originalFunction->ScriptId(); |
| 754 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); |
| 755 if (!origin.ResourceName().IsEmpty()) { |
| 756 resourceName = NativeValueTraits<String>::nativeValue(origin.ResourceNam
e(), isolate); |
| 757 lineNumber = originalFunction->GetScriptLineNumber() + 1; |
| 758 } |
| 759 if (resourceName.isEmpty()) { |
| 760 resourceName = "undefined"; |
| 761 lineNumber = 1; |
| 762 } |
| 763 } |
| 764 |
| 765 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) |
| 766 { |
| 767 int scriptId = 0; |
| 768 String resourceName; |
| 769 int lineNumber = 1; |
| 770 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe
r); |
| 771 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin
eNumber); |
| 772 } |
| 773 |
748 } // namespace WebCore | 774 } // namespace WebCore |
OLD | NEW |