OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (function.IsEmpty()) | 118 if (function.IsEmpty()) |
119 return ScriptValue(); | 119 return ScriptValue(); |
120 return ScriptValue(function); | 120 return ScriptValue(function); |
121 } | 121 } |
122 | 122 |
123 ScriptState* eventListenerHandlerScriptState(Frame* frame, EventListener* listen
er) | 123 ScriptState* eventListenerHandlerScriptState(Frame* frame, EventListener* listen
er) |
124 { | 124 { |
125 if (listener->type() != EventListener::JSEventListenerType) | 125 if (listener->type() != EventListener::JSEventListenerType) |
126 return 0; | 126 return 0; |
127 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(
listener); | 127 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(
listener); |
128 v8::HandleScope scope(frame->script()->isolate()); | 128 v8::HandleScope scope(getIsolateFromFrame(frame)); |
129 v8::Handle<v8::Context> v8Context = frame->script()->windowShell(v8Listener-
>world())->context(); | 129 v8::Handle<v8::Context> v8Context = frame->script()->windowShell(v8Listener-
>world())->context(); |
130 return ScriptState::forContext(v8Context); | 130 return ScriptState::forContext(v8Context); |
131 } | 131 } |
132 | 132 |
133 bool eventListenerHandlerLocation(Document* document, EventListener* listener, S
tring& sourceName, String& scriptId, int& lineNumber) | 133 bool eventListenerHandlerLocation(Document* document, EventListener* listener, S
tring& sourceName, String& scriptId, int& lineNumber) |
134 { | 134 { |
135 if (listener->type() != EventListener::JSEventListenerType) | 135 if (listener->type() != EventListener::JSEventListenerType) |
136 return false; | 136 return false; |
137 | 137 |
138 v8::HandleScope scope(getIsolateFromScriptExecutionContext(document)); | 138 v8::HandleScope scope(getIsolateFromScriptExecutionContext(document)); |
(...skipping 10 matching lines...) Expand all Loading... |
149 v8::ScriptOrigin origin = function->GetScriptOrigin(); | 149 v8::ScriptOrigin origin = function->GetScriptOrigin(); |
150 if (origin.ResourceName()->IsString() && !origin.ResourceName().IsEmpty()) | 150 if (origin.ResourceName()->IsString() && !origin.ResourceName().IsEmpty()) |
151 sourceName = toWebCoreString(origin.ResourceName()); | 151 sourceName = toWebCoreString(origin.ResourceName()); |
152 else | 152 else |
153 sourceName = ""; | 153 sourceName = ""; |
154 lineNumber = function->GetScriptLineNumber(); | 154 lineNumber = function->GetScriptLineNumber(); |
155 return true; | 155 return true; |
156 } | 156 } |
157 | 157 |
158 } // namespace WebCore | 158 } // namespace WebCore |
OLD | NEW |