Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 v8::Local<v8::Object> receiver = getReceiverObject(context, event); | 84 v8::Local<v8::Object> receiver = getReceiverObject(context, event); |
| 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::ScriptOrigin origin = handlerFunction->GetScriptOrigin(); | 92 v8::ScriptOrigin origin = handlerFunction->GetScriptOrigin(); |
| 93 if (!origin.ResourceName().IsEmpty()) { | 93 if (!origin.ResourceName().IsEmpty()) { |
| 94 resourceName = toWebCoreString(origin.ResourceName()); | 94 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringRes ourceName, origin.ResourceName(), v8::Local<v8::Value>()); |
|
haraken
2013/11/15 16:30:00
ah, I see. In this case we want to return v8::Loca
yurys
2014/04/30 08:46:51
This change looks wrong to me: if we fail to cover
| |
| 95 resourceName = stringResourceName; | |
| 95 lineNumber = handlerFunction->GetScriptLineNumber() + 1; | 96 lineNumber = handlerFunction->GetScriptLineNumber() + 1; |
| 96 } | 97 } |
| 97 cookie = InspectorInstrumentation::willCallFunction(context, resourceNam e, lineNumber); | 98 cookie = InspectorInstrumentation::willCallFunction(context, resourceNam e, lineNumber); |
| 98 } | 99 } |
| 99 | 100 |
| 100 v8::Isolate* isolate = toIsolate(context); | 101 v8::Isolate* isolate = toIsolate(context); |
| 101 v8::Handle<v8::Value> parameters[1] = { jsEvent }; | 102 v8::Handle<v8::Value> parameters[1] = { jsEvent }; |
| 102 v8::Local<v8::Value> result = V8ScriptRunner::callFunction(handlerFunction, context, receiver, WTF_ARRAY_LENGTH(parameters), parameters, isolate); | 103 v8::Local<v8::Value> result = V8ScriptRunner::callFunction(handlerFunction, context, receiver, WTF_ARRAY_LENGTH(parameters), parameters, isolate); |
| 103 | 104 |
| 104 InspectorInstrumentation::didCallFunction(cookie); | 105 InspectorInstrumentation::didCallFunction(cookie); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 115 | 116 |
| 116 EventTarget* target = event->currentTarget(); | 117 EventTarget* target = event->currentTarget(); |
| 117 v8::Isolate* isolate = toIsolate(context); | 118 v8::Isolate* isolate = toIsolate(context); |
| 118 v8::Handle<v8::Value> value = toV8(target, v8::Handle<v8::Object>(), isolate ); | 119 v8::Handle<v8::Value> value = toV8(target, v8::Handle<v8::Object>(), isolate ); |
| 119 if (value.IsEmpty()) | 120 if (value.IsEmpty()) |
| 120 return v8::Local<v8::Object>(); | 121 return v8::Local<v8::Object>(); |
| 121 return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(valu e)); | 122 return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(valu e)); |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // namespace WebCore | 125 } // namespace WebCore |
| OLD | NEW |