diff options
author | Steve Block <steveblock@google.com> | 2009-10-09 13:27:03 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:59 +0100 |
commit | 3f252f84468859d129a8c6a9302412d2e6e5a3fa (patch) | |
tree | 109b326a088d13e83fd53b4bace151f800647c1a /WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp | |
parent | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (diff) | |
download | external_webkit-3f252f84468859d129a8c6a9302412d2e6e5a3fa.zip external_webkit-3f252f84468859d129a8c6a9302412d2e6e5a3fa.tar.gz external_webkit-3f252f84468859d129a8c6a9302412d2e6e5a3fa.tar.bz2 |
Merge webkit.org at R49305 : Fix merge conflicts.
Change-Id: I9e0ffbe9b9b824399653da038093874e315ccd6a
Diffstat (limited to 'WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp')
-rw-r--r-- | WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp index 1b81257..134de95 100644 --- a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp @@ -43,66 +43,6 @@ namespace WebCore { -<<<<<<< HEAD:WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp -static const bool kFindOnly = true; -static const bool kFindOrCreate = false; - -static PassRefPtr<EventListener> argumentToEventListener(DOMApplicationCache* appcache, v8::Local<v8::Value> value, bool findOnly) -{ - V8Proxy* proxy = V8Proxy::retrieve(appcache->scriptExecutionContext()); - if (proxy) - return findOnly ? proxy->objectListeners()->findWrapper(value, false) - : proxy->objectListeners()->findOrCreateWrapper<V8ObjectEventListener>(proxy->frame(), value, false); - return 0; -} - -static v8::Local<v8::Object> eventListenerToV8Object(EventListener* listener) -{ - return (static_cast<V8ObjectEventListener*>(listener))->getListenerObject(); -} - -static inline ApplicationCacheHost::EventID toEventID(v8::Local<v8::String> value) -{ - String key = toWebCoreString(value); - ASSERT(key.startsWith("on")); - return DOMApplicationCache::toEventID(key.substring(2)); -} - -// Handles appcache.onfooevent attribute getting -ACCESSOR_GETTER(DOMApplicationCacheEventHandler) -{ - INC_STATS("DOMApplicationCache.onevent_getter"); - DOMApplicationCache* appcache = V8DOMWrapper::convertToNativeObject<DOMApplicationCache>(V8ClassIndex::DOMAPPLICATIONCACHE, info.Holder()); - EventListener* listener = appcache->getAttributeEventListener(toEventID(name)); - if (!listener) - return v8::Null(); - return eventListenerToV8Object(listener); -} - -// Handles appcache.onfooevent attribute setting -ACCESSOR_SETTER(DOMApplicationCacheEventHandler) -{ - INC_STATS("DOMApplicationCache.onevent_setter"); - DOMApplicationCache* appcache = V8DOMWrapper::convertToNativeObject<DOMApplicationCache>(V8ClassIndex::DOMAPPLICATIONCACHE, info.Holder()); - ApplicationCacheHost::EventID eventType = toEventID(name); - - if (EventListener* oldListener = appcache->getAttributeEventListener(eventType)) { - v8::Local<v8::Object> object = eventListenerToV8Object(oldListener); - removeHiddenDependency(info.Holder(), object, V8Custom::kDOMApplicationCacheCacheIndex); - appcache->clearAttributeEventListener(eventType); - } - - if (value->IsFunction()) { - RefPtr<EventListener> newListener = argumentToEventListener(appcache, value, kFindOrCreate); - if (newListener) { - createHiddenDependency(info.Holder(), value, V8Custom::kDOMApplicationCacheCacheIndex); - appcache->setAttributeEventListener(eventType, newListener); - } - } -} - -======= ->>>>>>> webkit.org at 49305:WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp // Handles appcache.addEventListner(name, func, capture) method calls CALLBACK_FUNC_DECL(DOMApplicationCacheAddEventListener) { |