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

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

Issue 2784473002: [Bindings] Move some private symbols from V8HiddenValue to V8PrivateProperty (Closed)
Patch Set: rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
index c61b2d15c52dd685c792361e7019c267ca084446..ab24724dac65947b1785c75a6226f43fbf072bc8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
@@ -34,7 +34,7 @@
#include "bindings/core/v8/V8Event.h"
#include "bindings/core/v8/V8EventListenerHelper.h"
#include "bindings/core/v8/V8EventTarget.h"
-#include "bindings/core/v8/V8HiddenValue.h"
+#include "bindings/core/v8/V8PrivateProperty.h"
#include "core/dom/Document.h"
#include "core/dom/DocumentParser.h"
#include "core/events/BeforeUnloadEvent.h"
@@ -127,16 +127,16 @@ void V8AbstractEventListener::invokeEventHandler(ScriptState* scriptState,
v8::TryCatch tryCatch(isolate());
tryCatch.SetVerbose(true);
+ v8::Local<v8::Object> global = scriptState->context()->Global();
+ V8PrivateProperty::Symbol eventSymbol =
+ V8PrivateProperty::getGlobalEvent(isolate());
// Save the old 'event' property so we can restore it later.
- v8::Local<v8::Value> savedEvent = V8HiddenValue::getHiddenValue(
- scriptState, scriptState->context()->Global(),
- V8HiddenValue::event(isolate()));
+ v8::Local<v8::Value> savedEvent = eventSymbol.getOrUndefined(global);
tryCatch.Reset();
// Make the event available in the global object, so LocalDOMWindow can
// expose it.
- V8HiddenValue::setHiddenValue(scriptState, scriptState->context()->Global(),
- V8HiddenValue::event(isolate()), jsEvent);
+ eventSymbol.set(global, jsEvent);
tryCatch.Reset();
returnValue = callListenerFunction(scriptState, jsEvent, event);
@@ -154,14 +154,7 @@ void V8AbstractEventListener::invokeEventHandler(ScriptState* scriptState,
// Restore the old event. This must be done for all exit paths through this
// method.
- if (savedEvent.IsEmpty())
- V8HiddenValue::setHiddenValue(
- scriptState, scriptState->context()->Global(),
- V8HiddenValue::event(isolate()), v8::Undefined(isolate()));
- else
- V8HiddenValue::setHiddenValue(
- scriptState, scriptState->context()->Global(),
- V8HiddenValue::event(isolate()), savedEvent);
+ eventSymbol.set(global, savedEvent);
tryCatch.Reset();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698