| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return v8::Local<v8::Function>::Cast(property); | 82 return v8::Local<v8::Function>::Cast(property); |
| 83 } | 83 } |
| 84 | 84 |
| 85 return v8::Local<v8::Function>(); | 85 return v8::Local<v8::Function>(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 v8::Local<v8::Value> V8EventListener::CallListenerFunction( | 88 v8::Local<v8::Value> V8EventListener::CallListenerFunction( |
| 89 ScriptState* script_state, | 89 ScriptState* script_state, |
| 90 v8::Local<v8::Value> js_event, | 90 v8::Local<v8::Value> js_event, |
| 91 Event* event) { | 91 Event* event) { |
| 92 ASSERT(!js_event.IsEmpty()); | 92 DCHECK(!js_event.IsEmpty()); |
| 93 v8::Local<v8::Function> handler_function = GetListenerFunction(script_state); | 93 v8::Local<v8::Function> handler_function = GetListenerFunction(script_state); |
| 94 v8::Local<v8::Object> receiver = GetReceiverObject(script_state, event); | 94 v8::Local<v8::Object> receiver = GetReceiverObject(script_state, event); |
| 95 if (handler_function.IsEmpty() || receiver.IsEmpty()) | 95 if (handler_function.IsEmpty() || receiver.IsEmpty()) |
| 96 return v8::Local<v8::Value>(); | 96 return v8::Local<v8::Value>(); |
| 97 | 97 |
| 98 if (!ExecutionContext::From(script_state)->IsDocument()) | 98 if (!ExecutionContext::From(script_state)->IsDocument()) |
| 99 return v8::Local<v8::Value>(); | 99 return v8::Local<v8::Value>(); |
| 100 | 100 |
| 101 LocalFrame* frame = | 101 LocalFrame* frame = |
| 102 ToDocument(ExecutionContext::From(script_state))->GetFrame(); | 102 ToDocument(ExecutionContext::From(script_state))->GetFrame(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 114 v8::Local<v8::Value> result; | 114 v8::Local<v8::Value> result; |
| 115 if (!V8ScriptRunner::CallFunction(handler_function, frame->GetDocument(), | 115 if (!V8ScriptRunner::CallFunction(handler_function, frame->GetDocument(), |
| 116 receiver, WTF_ARRAY_LENGTH(parameters), | 116 receiver, WTF_ARRAY_LENGTH(parameters), |
| 117 parameters, script_state->GetIsolate()) | 117 parameters, script_state->GetIsolate()) |
| 118 .ToLocal(&result)) | 118 .ToLocal(&result)) |
| 119 return v8::Local<v8::Value>(); | 119 return v8::Local<v8::Value>(); |
| 120 return result; | 120 return result; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |