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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp

Issue 2855443002: Fix detached event listener attribute updating. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/event-listener-detached.html ('k') | no next file » | 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 v8::Local<v8::Object>::Cast(value)); 197 v8::Local<v8::Object>::Cast(value));
198 } 198 }
199 199
200 bool V8AbstractEventListener::BelongsToTheCurrentWorld( 200 bool V8AbstractEventListener::BelongsToTheCurrentWorld(
201 ExecutionContext* execution_context) const { 201 ExecutionContext* execution_context) const {
202 if (!GetIsolate()->GetCurrentContext().IsEmpty() && 202 if (!GetIsolate()->GetCurrentContext().IsEmpty() &&
203 &World() == &DOMWrapperWorld::Current(GetIsolate())) 203 &World() == &DOMWrapperWorld::Current(GetIsolate()))
204 return true; 204 return true;
205 // If currently parsing, the parser could be accessing this listener 205 // If currently parsing, the parser could be accessing this listener
206 // outside of any v8 context; check if it belongs to the main world. 206 // outside of any v8 context; check if it belongs to the main world.
207 if (!GetIsolate()->InContext() && execution_context->IsDocument()) { 207 if (!GetIsolate()->InContext() && execution_context &&
208 execution_context->IsDocument()) {
208 Document* document = ToDocument(execution_context); 209 Document* document = ToDocument(execution_context);
209 if (document->Parser() && document->Parser()->IsParsing()) 210 if (document->Parser() && document->Parser()->IsParsing())
210 return World().IsMainWorld(); 211 return World().IsMainWorld();
211 } 212 }
212 return false; 213 return false;
213 } 214 }
214 215
215 void V8AbstractEventListener::ClearListenerObject() { 216 void V8AbstractEventListener::ClearListenerObject() {
216 if (!HasExistingListenerObject()) 217 if (!HasExistingListenerObject())
217 return; 218 return;
(...skipping 13 matching lines...) Expand all
231 DEFINE_TRACE(V8AbstractEventListener) { 232 DEFINE_TRACE(V8AbstractEventListener) {
232 visitor->Trace(worker_global_scope_); 233 visitor->Trace(worker_global_scope_);
233 EventListener::Trace(visitor); 234 EventListener::Trace(visitor);
234 } 235 }
235 236
236 DEFINE_TRACE_WRAPPERS(V8AbstractEventListener) { 237 DEFINE_TRACE_WRAPPERS(V8AbstractEventListener) {
237 visitor->TraceWrappers(listener_.Cast<v8::Value>()); 238 visitor->TraceWrappers(listener_.Cast<v8::Value>());
238 } 239 }
239 240
240 } // namespace blink 241 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/event-listener-detached.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698