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

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

Issue 585873002: Show a warning when using sync xhr. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Document lifecycle enums used for beforeunload event tracking. Created 6 years, 2 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
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Catch exceptions thrown in the event handler so they do not propagate to javascript code that caused the event to fire. 116 // Catch exceptions thrown in the event handler so they do not propagate to javascript code that caused the event to fire.
117 v8::TryCatch tryCatch; 117 v8::TryCatch tryCatch;
118 tryCatch.SetVerbose(true); 118 tryCatch.SetVerbose(true);
119 119
120 // Save the old 'event' property so we can restore it later. 120 // Save the old 'event' property so we can restore it later.
121 v8::Local<v8::Value> savedEvent = V8HiddenValue::getHiddenValue(isolate( ), scriptState()->context()->Global(), V8HiddenValue::event(isolate())); 121 v8::Local<v8::Value> savedEvent = V8HiddenValue::getHiddenValue(isolate( ), scriptState()->context()->Global(), V8HiddenValue::event(isolate()));
122 tryCatch.Reset(); 122 tryCatch.Reset();
123 123
124 // Make the event available in the global object, so LocalDOMWindow can expose it. 124 // Make the event available in the global object, so LocalDOMWindow can expose it.
125 V8HiddenValue::setHiddenValue(isolate(), scriptState()->context()->Globa l(), V8HiddenValue::event(isolate()), jsEvent); 125 V8HiddenValue::setHiddenValue(isolate(), scriptState()->context()->Globa l(), V8HiddenValue::event(isolate()), jsEvent);
126 tryCatch.Reset(); 126 tryCatch.Reset();
kouhei (in TOK) 2014/10/07 23:21:18 Undo this change.
Mayur Kankanwadi 2014/10/09 14:37:55 Done.
127
128 returnValue = callListenerFunction(jsEvent, event); 127 returnValue = callListenerFunction(jsEvent, event);
129 if (tryCatch.HasCaught()) 128 if (tryCatch.HasCaught())
130 event->target()->uncaughtExceptionInEventHandler(); 129 event->target()->uncaughtExceptionInEventHandler();
131 130
132 if (!tryCatch.CanContinue()) { // Result of TerminateExecution(). 131 if (!tryCatch.CanContinue()) { // Result of TerminateExecution().
133 if (scriptState()->executionContext()->isWorkerGlobalScope()) 132 if (scriptState()->executionContext()->isWorkerGlobalScope())
134 toWorkerGlobalScope(scriptState()->executionContext())->script() ->forbidExecution(); 133 toWorkerGlobalScope(scriptState()->executionContext())->script() ->forbidExecution();
135 return; 134 return;
136 } 135 }
137 tryCatch.Reset(); 136 tryCatch.Reset();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 { 179 {
181 return isolate()->InContext() && &world() == &DOMWrapperWorld::current(isola te()); 180 return isolate()->InContext() && &world() == &DOMWrapperWorld::current(isola te());
182 } 181 }
183 182
184 void V8AbstractEventListener::setWeakCallback(const v8::WeakCallbackData<v8::Obj ect, V8AbstractEventListener> &data) 183 void V8AbstractEventListener::setWeakCallback(const v8::WeakCallbackData<v8::Obj ect, V8AbstractEventListener> &data)
185 { 184 {
186 data.GetParameter()->m_listener.clear(); 185 data.GetParameter()->m_listener.clear();
187 } 186 }
188 187
189 } // namespace blink 188 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698