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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (handlerFunction.IsEmpty() || receiver.IsEmpty()) | 85 if (handlerFunction.IsEmpty() || receiver.IsEmpty()) |
86 return v8::Local<v8::Value>(); | 86 return v8::Local<v8::Value>(); |
87 | 87 |
88 InspectorInstrumentationCookie cookie; | 88 InspectorInstrumentationCookie cookie; |
89 if (InspectorInstrumentation::timelineAgentEnabled(context)) { | 89 if (InspectorInstrumentation::timelineAgentEnabled(context)) { |
90 String resourceName("undefined"); | 90 String resourceName("undefined"); |
91 int lineNumber = 1; | 91 int lineNumber = 1; |
92 v8::Handle<v8::Function> originalFunction = getBoundFunction(handlerFunc
tion); | 92 v8::Handle<v8::Function> originalFunction = getBoundFunction(handlerFunc
tion); |
93 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); | 93 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); |
94 if (!origin.ResourceName().IsEmpty()) { | 94 if (!origin.ResourceName().IsEmpty()) { |
95 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringRes
ourceName, origin.ResourceName(), v8::Local<v8::Value>()); | 95 V8STRINGRESOURCE_PREPARE_RETURN(V8StringResource<>, stringResourceNa
me, origin.ResourceName(), v8::Local<v8::Value>()); |
96 resourceName = stringResourceName; | 96 resourceName = stringResourceName; |
97 lineNumber = originalFunction->GetScriptLineNumber() + 1; | 97 lineNumber = originalFunction->GetScriptLineNumber() + 1; |
98 } | 98 } |
99 cookie = InspectorInstrumentation::willCallFunction(context, originalFun
ction->ScriptId(), resourceName, lineNumber); | 99 cookie = InspectorInstrumentation::willCallFunction(context, originalFun
ction->ScriptId(), resourceName, lineNumber); |
100 } | 100 } |
101 | 101 |
102 v8::Isolate* isolate = toIsolate(context); | 102 v8::Isolate* isolate = toIsolate(context); |
103 v8::Handle<v8::Value> parameters[1] = { jsEvent }; | 103 v8::Handle<v8::Value> parameters[1] = { jsEvent }; |
104 v8::Local<v8::Value> result = V8ScriptRunner::callFunction(handlerFunction,
context, receiver, WTF_ARRAY_LENGTH(parameters), parameters, isolate); | 104 v8::Local<v8::Value> result = V8ScriptRunner::callFunction(handlerFunction,
context, receiver, WTF_ARRAY_LENGTH(parameters), parameters, isolate); |
105 | 105 |
(...skipping 11 matching lines...) Expand all Loading... |
117 | 117 |
118 EventTarget* target = event->currentTarget(); | 118 EventTarget* target = event->currentTarget(); |
119 v8::Isolate* isolate = toIsolate(context); | 119 v8::Isolate* isolate = toIsolate(context); |
120 v8::Handle<v8::Value> value = toV8(target, v8::Handle<v8::Object>(), isolate
); | 120 v8::Handle<v8::Value> value = toV8(target, v8::Handle<v8::Object>(), isolate
); |
121 if (value.IsEmpty()) | 121 if (value.IsEmpty()) |
122 return v8::Local<v8::Object>(); | 122 return v8::Local<v8::Object>(); |
123 return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(valu
e)); | 123 return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(valu
e)); |
124 } | 124 } |
125 | 125 |
126 } // namespace WebCore | 126 } // namespace WebCore |
OLD | NEW |