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 26 matching lines...) Expand all Loading... |
37 #include "bindings/v8/V8Binding.h" | 37 #include "bindings/v8/V8Binding.h" |
38 #include "bindings/v8/V8DOMWrapper.h" | 38 #include "bindings/v8/V8DOMWrapper.h" |
39 #include "bindings/v8/V8GCController.h" | 39 #include "bindings/v8/V8GCController.h" |
40 #include "bindings/v8/V8ScriptRunner.h" | 40 #include "bindings/v8/V8ScriptRunner.h" |
41 #include "bindings/v8/WorkerScriptController.h" | 41 #include "bindings/v8/WorkerScriptController.h" |
42 #include "core/inspector/InspectorInstrumentation.h" | 42 #include "core/inspector/InspectorInstrumentation.h" |
43 #include "core/workers/WorkerGlobalScope.h" | 43 #include "core/workers/WorkerGlobalScope.h" |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 V8WorkerGlobalScopeEventListener::V8WorkerGlobalScopeEventListener(v8::Local<v8:
:Object> listener, bool isInline) | 47 V8WorkerGlobalScopeEventListener::V8WorkerGlobalScopeEventListener(v8::Local<v8:
:Object> listener, bool isInline, v8::Isolate* isolate) |
48 : V8EventListener(listener, isInline) | 48 : V8EventListener(listener, isInline, isolate) |
49 { | 49 { |
50 } | 50 } |
51 | 51 |
52 void V8WorkerGlobalScopeEventListener::handleEvent(ScriptExecutionContext* conte
xt, Event* event) | 52 void V8WorkerGlobalScopeEventListener::handleEvent(ScriptExecutionContext* conte
xt, Event* event) |
53 { | 53 { |
54 if (!context) | 54 if (!context) |
55 return; | 55 return; |
56 | 56 |
57 // The callback function on XMLHttpRequest can clear the event listener and
destroys 'this' object. Keep a local reference to it. | 57 // The callback function on XMLHttpRequest can clear the event listener and
destroys 'this' object. Keep a local reference to it. |
58 // See issue 889829. | 58 // See issue 889829. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 EventTarget* target = event->currentTarget(); | 116 EventTarget* target = event->currentTarget(); |
117 v8::Isolate* isolate = toIsolate(context); | 117 v8::Isolate* isolate = toIsolate(context); |
118 v8::Handle<v8::Value> value = toV8(target, v8::Handle<v8::Object>(), isolate
); | 118 v8::Handle<v8::Value> value = toV8(target, v8::Handle<v8::Object>(), isolate
); |
119 if (value.IsEmpty()) | 119 if (value.IsEmpty()) |
120 return v8::Local<v8::Object>(); | 120 return v8::Local<v8::Object>(); |
121 return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(valu
e)); | 121 return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(valu
e)); |
122 } | 122 } |
123 | 123 |
124 } // namespace WebCore | 124 } // namespace WebCore |
OLD | NEW |