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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return; | 66 return; |
67 | 67 |
68 InvokeEventHandler(script_state, event, | 68 InvokeEventHandler(script_state, event, |
69 v8::Local<v8::Value>::New(GetIsolate(), js_event)); | 69 v8::Local<v8::Value>::New(GetIsolate(), js_event)); |
70 } | 70 } |
71 | 71 |
72 v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::CallListenerFunction( | 72 v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::CallListenerFunction( |
73 ScriptState* script_state, | 73 ScriptState* script_state, |
74 v8::Local<v8::Value> js_event, | 74 v8::Local<v8::Value> js_event, |
75 Event* event) { | 75 Event* event) { |
76 ASSERT(!js_event.IsEmpty()); | 76 DCHECK(!js_event.IsEmpty()); |
77 v8::Local<v8::Function> handler_function = GetListenerFunction(script_state); | 77 v8::Local<v8::Function> handler_function = GetListenerFunction(script_state); |
78 v8::Local<v8::Object> receiver = GetReceiverObject(script_state, event); | 78 v8::Local<v8::Object> receiver = GetReceiverObject(script_state, event); |
79 if (handler_function.IsEmpty() || receiver.IsEmpty()) | 79 if (handler_function.IsEmpty() || receiver.IsEmpty()) |
80 return v8::Local<v8::Value>(); | 80 return v8::Local<v8::Value>(); |
81 | 81 |
82 v8::Local<v8::Value> parameters[1] = {js_event}; | 82 v8::Local<v8::Value> parameters[1] = {js_event}; |
83 v8::MaybeLocal<v8::Value> maybe_result = V8ScriptRunner::CallFunction( | 83 v8::MaybeLocal<v8::Value> maybe_result = V8ScriptRunner::CallFunction( |
84 handler_function, ExecutionContext::From(script_state), receiver, | 84 handler_function, ExecutionContext::From(script_state), receiver, |
85 WTF_ARRAY_LENGTH(parameters), parameters, GetIsolate()); | 85 WTF_ARRAY_LENGTH(parameters), parameters, GetIsolate()); |
86 | 86 |
(...skipping 17 matching lines...) Expand all Loading... |
104 EventTarget* target = event->currentTarget(); | 104 EventTarget* target = event->currentTarget(); |
105 v8::Local<v8::Value> value = | 105 v8::Local<v8::Value> value = |
106 ToV8(target, script_state->GetContext()->Global(), GetIsolate()); | 106 ToV8(target, script_state->GetContext()->Global(), GetIsolate()); |
107 if (value.IsEmpty()) | 107 if (value.IsEmpty()) |
108 return v8::Local<v8::Object>(); | 108 return v8::Local<v8::Object>(); |
109 return v8::Local<v8::Object>::New(GetIsolate(), | 109 return v8::Local<v8::Object>::New(GetIsolate(), |
110 v8::Local<v8::Object>::Cast(value)); | 110 v8::Local<v8::Object>::Cast(value)); |
111 } | 111 } |
112 | 112 |
113 } // namespace blink | 113 } // namespace blink |
OLD | NEW |