Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(974)

Side by Side Diff: Source/bindings/v8/V8AbstractEventListener.cpp

Issue 17648006: Rename WorkerContext to WorkerGlobalScope (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/ScriptState.cpp ('k') | Source/bindings/v8/V8Binding.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 24 matching lines...) Expand all
35 #include "V8EventTarget.h" 35 #include "V8EventTarget.h"
36 #include "bindings/v8/DateExtension.h" 36 #include "bindings/v8/DateExtension.h"
37 #include "bindings/v8/V8Binding.h" 37 #include "bindings/v8/V8Binding.h"
38 #include "bindings/v8/V8EventListenerList.h" 38 #include "bindings/v8/V8EventListenerList.h"
39 #include "bindings/v8/V8HiddenPropertyName.h" 39 #include "bindings/v8/V8HiddenPropertyName.h"
40 #include "core/dom/Document.h" 40 #include "core/dom/Document.h"
41 #include "core/dom/Event.h" 41 #include "core/dom/Event.h"
42 #include "core/dom/EventNames.h" 42 #include "core/dom/EventNames.h"
43 #include "core/inspector/InspectorCounters.h" 43 #include "core/inspector/InspectorCounters.h"
44 #include "core/page/Frame.h" 44 #include "core/page/Frame.h"
45 #include "core/workers/WorkerContext.h" 45 #include "core/workers/WorkerGlobalScope.h"
46 46
47 namespace WebCore { 47 namespace WebCore {
48 48
49 V8AbstractEventListener::V8AbstractEventListener(bool isAttribute, PassRefPtr<DO MWrapperWorld> world, v8::Isolate* isolate) 49 V8AbstractEventListener::V8AbstractEventListener(bool isAttribute, PassRefPtr<DO MWrapperWorld> world, v8::Isolate* isolate)
50 : EventListener(JSEventListenerType) 50 : EventListener(JSEventListenerType)
51 , m_isAttribute(isAttribute) 51 , m_isAttribute(isAttribute)
52 , m_world(world) 52 , m_world(world)
53 , m_isolate(isolate) 53 , m_isolate(isolate)
54 { 54 {
55 ThreadLocalInspectorCounters::current().incrementCounter(ThreadLocalInspecto rCounters::JSEventListenerCounter); 55 ThreadLocalInspectorCounters::current().incrementCounter(ThreadLocalInspecto rCounters::JSEventListenerCounter);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Make the event available in the global object, so DOMWindow can expos e it. 129 // Make the event available in the global object, so DOMWindow can expos e it.
130 v8Context->Global()->SetHiddenValue(eventSymbol, jsEvent); 130 v8Context->Global()->SetHiddenValue(eventSymbol, jsEvent);
131 tryCatch.Reset(); 131 tryCatch.Reset();
132 132
133 returnValue = callListenerFunction(context, jsEvent, event); 133 returnValue = callListenerFunction(context, jsEvent, event);
134 if (tryCatch.HasCaught()) 134 if (tryCatch.HasCaught())
135 event->target()->uncaughtExceptionInEventHandler(); 135 event->target()->uncaughtExceptionInEventHandler();
136 136
137 if (!tryCatch.CanContinue()) { // Result of TerminateExecution(). 137 if (!tryCatch.CanContinue()) { // Result of TerminateExecution().
138 if (context->isWorkerContext()) 138 if (context->isWorkerGlobalScope())
139 static_cast<WorkerContext*>(context)->script()->forbidExecution( ); 139 static_cast<WorkerGlobalScope*>(context)->script()->forbidExecut ion();
140 return; 140 return;
141 } 141 }
142 tryCatch.Reset(); 142 tryCatch.Reset();
143 143
144 // Restore the old event. This must be done for all exit paths through t his method. 144 // Restore the old event. This must be done for all exit paths through t his method.
145 if (savedEvent.IsEmpty()) 145 if (savedEvent.IsEmpty())
146 v8Context->Global()->SetHiddenValue(eventSymbol, v8::Undefined()); 146 v8Context->Global()->SetHiddenValue(eventSymbol, v8::Undefined());
147 else 147 else
148 v8Context->Global()->SetHiddenValue(eventSymbol, savedEvent); 148 v8Context->Global()->SetHiddenValue(eventSymbol, savedEvent);
149 tryCatch.Reset(); 149 tryCatch.Reset();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return v8::Local<v8::Object>(); 184 return v8::Local<v8::Object>();
185 return v8::Local<v8::Object>::New(v8::Handle<v8::Object>::Cast(value)); 185 return v8::Local<v8::Object>::New(v8::Handle<v8::Object>::Cast(value));
186 } 186 }
187 187
188 void V8AbstractEventListener::makeWeakCallback(v8::Isolate*, v8::Persistent<v8:: Object>*, V8AbstractEventListener* listener) 188 void V8AbstractEventListener::makeWeakCallback(v8::Isolate*, v8::Persistent<v8:: Object>*, V8AbstractEventListener* listener)
189 { 189 {
190 listener->m_listener.clear(); 190 listener->m_listener.clear();
191 } 191 }
192 192
193 } // namespace WebCore 193 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptState.cpp ('k') | Source/bindings/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698