summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authordglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 20:19:05 +0000
committerdglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 20:19:05 +0000
commitef8c792e9353c839ffa0ad13330c234ff7cd0a7d (patch)
tree924aee851d98a4fac7d41e2902a4edaf656d3b92 /webkit/port
parent2c33f8c7875472f3593479505c83bb0748c5b7b2 (diff)
downloadchromium_src-ef8c792e9353c839ffa0ad13330c234ff7cd0a7d.zip
chromium_src-ef8c792e9353c839ffa0ad13330c234ff7cd0a7d.tar.gz
chromium_src-ef8c792e9353c839ffa0ad13330c234ff7cd0a7d.tar.bz2
WebKit Merge 42609:42671, Chromium Side
Gross offenders: * http://trac.webkit.org/changeset/42633, event listener creation helpers moved to JSC-specific files. * http://trac.webkit.org/changeset/42647, our refactoring of XHR code. * http://trac.webkit.org/changeset/42671, unforking of DOMWindow.event R=levin Review URL: http://codereview.chromium.org/84002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/bindings/v8/ScriptController.cpp6
-rw-r--r--webkit/port/bindings/v8/ScriptController.h2
-rw-r--r--webkit/port/bindings/v8/V8WorkerContextCustom.cpp6
-rw-r--r--webkit/port/bindings/v8/v8_custom.cpp12
-rw-r--r--webkit/port/bindings/v8/v8_custom.h2
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp8
-rw-r--r--webkit/port/bindings/v8/v8_proxy.h5
7 files changed, 12 insertions, 29 deletions
diff --git a/webkit/port/bindings/v8/ScriptController.cpp b/webkit/port/bindings/v8/ScriptController.cpp
index 4bb0b69..bde1b3d 100644
--- a/webkit/port/bindings/v8/ScriptController.cpp
+++ b/webkit/port/bindings/v8/ScriptController.cpp
@@ -237,12 +237,6 @@ void ScriptController::disposeJSResult(v8::Persistent<v8::Value> result)
result.Clear();
}
-PassRefPtr<EventListener> ScriptController::createInlineEventListener(
- const String& functionName, const String& eventParameterName, const String& code, Node* node)
-{
- return m_proxy->createInlineEventListener(functionName, code, node);
-}
-
void ScriptController::setEventHandlerLineNumber(int lineno)
{
m_proxy->setEventHandlerLineno(lineno);
diff --git a/webkit/port/bindings/v8/ScriptController.h b/webkit/port/bindings/v8/ScriptController.h
index b72b7c6..4009a71 100644
--- a/webkit/port/bindings/v8/ScriptController.h
+++ b/webkit/port/bindings/v8/ScriptController.h
@@ -173,8 +173,6 @@ public:
void disposeJSResult(JSResult result);
void collectGarbage();
- PassRefPtr<EventListener> createInlineEventListener(const String& functionName, const String& eventParameterName, const String& code, Node*);
-
// Creates a property of the global object of a frame.
void BindToWindowObject(Frame*, const String& key, NPObject*);
diff --git a/webkit/port/bindings/v8/V8WorkerContextCustom.cpp b/webkit/port/bindings/v8/V8WorkerContextCustom.cpp
index e646bb5..84aa89a 100644
--- a/webkit/port/bindings/v8/V8WorkerContextCustom.cpp
+++ b/webkit/port/bindings/v8/V8WorkerContextCustom.cpp
@@ -120,7 +120,7 @@ ACCESSOR_SETTER(WorkerContextOnmessage) {
} else {
RefPtr<V8EventListener> listener =
- imp->script()->proxy()->FindOrCreateEventListener(
+ imp->script()->proxy()->findOrCreateEventListener(
v8::Local<v8::Object>::Cast(value), false, false);
if (listener) {
if (old_listener) {
@@ -192,7 +192,7 @@ CALLBACK_FUNC_DECL(WorkerContextAddEventListener) {
V8ClassIndex::WORKERCONTEXT, args.Holder());
RefPtr<V8EventListener> listener =
- imp->script()->proxy()->FindOrCreateEventListener(
+ imp->script()->proxy()->findOrCreateEventListener(
v8::Local<v8::Object>::Cast(args[1]), false, false);
if (listener) {
@@ -211,7 +211,7 @@ CALLBACK_FUNC_DECL(WorkerContextRemoveEventListener) {
V8ClassIndex::WORKERCONTEXT, args.Holder());
WorkerContextExecutionProxy* proxy = imp->script()->proxy();
- RefPtr<V8EventListener> listener = proxy->FindOrCreateEventListener(
+ RefPtr<V8EventListener> listener = proxy->findOrCreateEventListener(
v8::Local<v8::Object>::Cast(args[1]), false, true);
if (listener) {
diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp
index 272141d..e887cb8 100644
--- a/webkit/port/bindings/v8/v8_custom.cpp
+++ b/webkit/port/bindings/v8/v8_custom.cpp
@@ -1072,7 +1072,7 @@ ACCESSOR_SETTER(DOMWindowEventHandler) {
if (value->IsNull()) {
// Clear the event listener
- imp->removeInlineEventListenerForType(event_type);
+ imp->clearInlineEventListener(event_type);
} else {
V8Proxy* proxy = V8Proxy::retrieve(imp->frame());
if (!proxy)
@@ -1081,7 +1081,7 @@ ACCESSOR_SETTER(DOMWindowEventHandler) {
RefPtr<EventListener> listener =
proxy->FindOrCreateV8EventListener(value, true);
if (listener) {
- imp->setInlineEventListenerForType(event_type, listener);
+ imp->setInlineEventListener(event_type, listener);
}
}
}
@@ -1105,7 +1105,7 @@ ACCESSOR_GETTER(DOMWindowEventHandler) {
String key = ToWebCoreString(name);
String event_type = EventNameFromAttributeName(key);
- EventListener* listener = imp->inlineEventListenerForType(event_type);
+ EventListener* listener = imp->getInlineEventListener(event_type);
return V8Proxy::EventListenerToV8Object(listener);
}
@@ -1132,10 +1132,10 @@ ACCESSOR_SETTER(ElementEventHandler) {
RefPtr<EventListener> listener =
proxy->FindOrCreateV8EventListener(value, true);
if (listener) {
- node->setInlineEventListenerForType(event_type, listener);
+ node->setInlineEventListener(event_type, listener);
}
} else {
- node->removeInlineEventListenerForType(event_type);
+ node->clearInlineEventListener(event_type);
}
}
@@ -1148,7 +1148,7 @@ ACCESSOR_GETTER(ElementEventHandler) {
ASSERT(key.startsWith("on"));
String event_type = key.substring(2);
- EventListener* listener = node->inlineEventListenerForType(event_type);
+ EventListener* listener = node->getInlineEventListener(event_type);
return V8Proxy::EventListenerToV8Object(listener);
}
diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h
index 49f7c75..d61b95d 100644
--- a/webkit/port/bindings/v8/v8_custom.h
+++ b/webkit/port/bindings/v8/v8_custom.h
@@ -233,6 +233,8 @@ static bool v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \
DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DStrokeStyle)
DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DFillStyle)
+DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowEvent)
+DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowCrypto)
// Customized getter&setter of DOMWindow.location
DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowLocation)
// Customized setter of DOMWindow.opener
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp
index 91aad7b..e2b71d6 100644
--- a/webkit/port/bindings/v8/v8_proxy.cpp
+++ b/webkit/port/bindings/v8/v8_proxy.cpp
@@ -809,14 +809,6 @@ void V8Proxy::SetJSWrapperForDOMNode(Node* node, v8::Persistent<v8::Object> wrap
getDOMNodeMap().set(node, wrapper);
}
-PassRefPtr<EventListener> V8Proxy::createInlineEventListener(
- const String& functionName,
- const String& code, Node* node)
-{
- return V8LazyEventListener::create(m_frame, code, functionName);
-}
-
-
// Event listeners
static V8EventListener* FindEventListenerInList(V8EventListenerList& list,
diff --git a/webkit/port/bindings/v8/v8_proxy.h b/webkit/port/bindings/v8/v8_proxy.h
index f34ccaa..6568820 100644
--- a/webkit/port/bindings/v8/v8_proxy.h
+++ b/webkit/port/bindings/v8/v8_proxy.h
@@ -172,7 +172,7 @@ class V8Proxy {
explicit V8Proxy(Frame* frame)
: m_frame(frame), m_event_listeners("m_event_listeners"),
- m_xhr_listeners("m_xhr_listeners"), m_inlineCode(false),
+ m_xhr_listeners("m_xhr_listeners"),
m_timerCallback(false), m_recursion(0) { }
~V8Proxy();
@@ -229,9 +229,6 @@ class V8Proxy {
static void GCProtect(void* dom_object);
static void GCUnprotect(void* dom_object);
- // Create a lazy event listener.
- PassRefPtr<EventListener> createInlineEventListener(
- const String& functionName, const String& code, Node* node);
#if ENABLE(SVG)
static void SetSVGContext(void* object, SVGElement* context);
static SVGElement* GetSVGContext(void* object);