Changeset 47492 in webkit
- Timestamp:
- Aug 18, 2009 10:50:36 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r47489 r47492 1 2009-08-18 John Gregg <johnnyg@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 V8 Bindings for Desktop Notifications feature. 6 https://bugs.webkit.org/show_bug.cgi?id=28271 7 8 * WebCore.gypi: 9 added notification files to build (all still behind a flag that's not on) 10 * bindings/scripts/CodeGeneratorV8.pm: 11 added special case in DOMWindow/AppCache style for named event handlers 12 * bindings/v8/DOMObjectsInclude.h: 13 * bindings/v8/DerivedSourcesAllInOne.cpp: 14 * bindings/v8/V8DOMWrapper.cpp: 15 (WebCore::V8DOMWrapper::getTemplate): 16 (WebCore::V8DOMWrapper::convertEventTargetToV8Object): 17 * bindings/v8/V8Index.cpp: 18 * bindings/v8/V8Index.h: 19 * bindings/v8/V8Proxy.h: 20 * bindings/v8/WorkerContextExecutionProxy.cpp: 21 (WebCore::WorkerContextExecutionProxy::convertToV8Object): 22 * bindings/v8/custom/V8CustomBinding.h: 23 * bindings/v8/custom/V8NotificationCenterCustom.cpp: Added. 24 * notifications/Notification.h: 25 made event handler routines public (as they are in DOMWindow, eg) for 26 binding access. 27 * notifications/NotificationCenter.idl: 28 needed to make methods V8Custom to support different behaviors in 29 worker/page context in chromium. 30 * workers/WorkerThread.h: 31 (WebCore::WorkerThread::getNotificationPresenter): 32 (WebCore::WorkerThread::setNotificationPresenter): 33 needed to make these methods public as well so chromium can inject 34 the notification presenter into the worker thread. 35 1 36 2009-08-13 Maciej Stachowiak <mjs@apple.com> 2 37 -
trunk/WebCore/WebCore.gypi
r47481 r47492 162 162 'inspector/JavaScriptCallFrame.idl', 163 163 'loader/appcache/DOMApplicationCache.idl', 164 'notifications/Notification.idl', 165 'notifications/NotificationCenter.idl', 164 166 'page/AbstractView.idl', 165 167 'page/BarInfo.idl', … … 660 662 'bindings/v8/custom/V8NodeIteratorCustom.cpp', 661 663 'bindings/v8/custom/V8NodeListCustom.cpp', 664 'bindings/v8/custom/V8NotificationCenterCustom.cpp', 662 665 'bindings/v8/custom/V8StorageCustom.cpp', 663 666 'bindings/v8/custom/V8SQLResultSetRowListCustom.cpp', … … 1563 1566 'loader/loader.cpp', 1564 1567 'loader/loader.h', 1568 'notifications/Notification.cpp', 1569 'notifications/Notification.h', 1570 'notifications/NotificationCenter.cpp', 1571 'notifications/NotificationCenter.h', 1572 'notifications/NotificationPresenter.h', 1573 'notifications/NotificationContents.h', 1565 1574 'page/animation/AnimationBase.cpp', 1566 1575 'page/animation/AnimationBase.h', -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r47249 r47492 967 967 $getter = "V8Custom::v8DOMApplicationCacheEventHandlerAccessorGetter"; 968 968 $setter = "V8Custom::v8DOMApplicationCacheEventHandlerAccessorSetter"; 969 } elsif ($interfaceName eq "Notification") { 970 $getter = "V8Custom::v8NotificationEventHandlerAccessorGetter"; 971 $setter = "V8Custom::v8NotificationEventHandlerAccessorSetter"; 969 972 } else { 970 973 $getter = "V8Custom::v8${customAccessor}AccessorGetter"; … … 2042 2045 } 2043 2046 2044 if ($type eq "WorkerLocation" or $type eq "WorkerNavigator" ) {2047 if ($type eq "WorkerLocation" or $type eq "WorkerNavigator" or $type eq "NotificationCenter") { 2045 2048 $implIncludes{"WorkerContextExecutionProxy.h"} = 1; 2046 2049 my $classIndex = uc($type); -
trunk/WebCore/bindings/v8/DOMObjectsInclude.h
r46917 r47492 215 215 #endif // WORKERS 216 216 217 #if ENABLE(NOTIFICATIONS) 218 #include "Notification.h" 219 #include "NotificationCenter.h" 220 #endif // NOTIFICATIONS 221 217 222 #if ENABLE(XPATH) 218 223 #include "XPathEvaluator.h" -
trunk/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
r46917 r47492 176 176 #include "bindings/V8NodeList.cpp" 177 177 #include "bindings/V8Notation.cpp" 178 #include "bindings/V8Notification.cpp" 179 #include "bindings/V8NotificationCenter.cpp" 178 180 #include "bindings/V8OverflowEvent.cpp" 179 181 #include "bindings/V8Plugin.cpp" -
trunk/WebCore/bindings/v8/V8DOMWrapper.cpp
r47001 r47492 379 379 break; 380 380 } 381 382 #if ENABLE(NOTIFICATIONS) 383 case V8ClassIndex::NOTIFICATION: { 384 // Reserve one more internal field for keeping event listeners. 385 v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate(); 386 instanceTemplate->SetInternalFieldCount(V8Custom::kNotificationInternalFieldCount); 387 break; 388 } 389 #endif // NOTIFICATIONS 381 390 382 391 #if ENABLE(WORKERS) … … 1250 1259 #endif // WORKERS 1251 1260 1261 #if ENABLE(NOTIFICATIONS) 1262 Notification* notification = target->toNotification(); 1263 if (notification) 1264 return convertToV8Object(V8ClassIndex::NOTIFICATION, notification); 1265 #endif 1266 1252 1267 Node* node = target->toNode(); 1253 1268 if (node) -
trunk/WebCore/bindings/v8/V8Index.cpp
r46917 r47492 386 386 #endif 387 387 388 #if ENABLE(NOTIFICATIONS) 389 #include "V8Notification.h" 390 #include "V8NotificationCenter.h" 391 #endif 392 388 393 #if ENABLE(SHARED_WORKERS) 389 394 #include "V8SharedWorker.h" -
trunk/WebCore/bindings/v8/V8Index.h
r46917 r47492 87 87 #else 88 88 #define APPLICATIONCACHE_NONNODE_WRAPPER_TYPES(V) 89 #endif 90 91 #if ENABLE(NOTIFICATIONS) 92 #define NOTIFICATIONS_NONNODE_WRAPPER_TYPES(V) \ 93 V(NOTIFICATION, Notification) \ 94 V(NOTIFICATIONCENTER, NotificationCenter) 95 #else 96 #define NOTIFICATIONS_NONNODE_WRAPPER_TYPES(V) 89 97 #endif 90 98 … … 398 406 DATAGRID_NONNODE_TYPES(V) \ 399 407 VIDEO_NONNODE_TYPES(V) \ 408 NOTIFICATIONS_NONNODE_WRAPPER_TYPES(V) \ 400 409 SHARED_WORKER_NONNODE_WRAPPER_TYPES(V) \ 401 410 WORKER_NONNODE_WRAPPER_TYPES(V) -
trunk/WebCore/bindings/v8/V8Proxy.h
r46849 r47492 87 87 class NodeFilter; 88 88 class NodeList; 89 #if ENABLE(NOTIFICATIONS) 90 class Notification; 91 class NotificationCenter; 92 #endif 89 93 class Plugin; 90 94 class PluginArray; -
trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
r46919 r47492 39 39 #include "DedicatedWorkerContext.h" 40 40 #include "Event.h" 41 #include "Notification.h" 42 #include "NotificationCenter.h" 41 43 #include "EventException.h" 42 44 #include "MessagePort.h" … … 220 222 static_cast<WorkerNavigator*>(impl)->ref(); 221 223 break; 224 #if ENABLE(NOTIFICATIONS) 225 case V8ClassIndex::NOTIFICATIONCENTER: 226 static_cast<NotificationCenter*>(impl)->ref(); 227 break; 228 case V8ClassIndex::NOTIFICATION: 229 static_cast<Notification*>(impl)->ref(); 230 break; 231 #endif 222 232 case V8ClassIndex::DOMCOREEXCEPTION: 223 233 static_cast<DOMCoreException*>(impl)->ref(); -
trunk/WebCore/bindings/v8/custom/V8CustomBinding.h
r47363 r47492 136 136 #endif 137 137 138 #if ENABLE(NOTIFICATIONS) 139 static const int kNotificationRequestCacheIndex = kDefaultWrapperInternalFieldCount + 0; 140 static const int kNotificationInternalFieldCount = kDefaultWrapperInternalFieldCount + 1; 141 #endif 142 138 143 static const int kDOMWindowConsoleIndex = kDefaultWrapperInternalFieldCount + 0; 139 144 static const int kDOMWindowHistoryIndex = kDefaultWrapperInternalFieldCount + 1; … … 517 522 DECLARE_CALLBACK(WorkerContextAddEventListener); 518 523 DECLARE_CALLBACK(WorkerContextRemoveEventListener); 519 #endif 524 #endif // ENABLE(WORKERS) 525 526 #if ENABLE(NOTIFICATIONS) 527 DECLARE_CALLBACK(NotificationCenterRequestPermission); 528 DECLARE_CALLBACK(NotificationCenterCreateNotification); 529 DECLARE_CALLBACK(NotificationCenterCreateHTMLNotification); 530 531 DECLARE_CALLBACK(NotificationAddEventListener); 532 DECLARE_CALLBACK(NotificationRemoveEventListener); 533 DECLARE_PROPERTY_ACCESSOR(NotificationEventHandler); 534 #endif // ENABLE(NOTIFICATIONS) 520 535 521 536 #if ENABLE(OFFLINE_WEB_APPLICATIONS) -
trunk/WebCore/notifications/Notification.h
r47056 r47492 87 87 virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); 88 88 virtual Notification* toNotification() { return this; } 89 89 90 // These methods are for onEvent style listeners. 91 EventListener* getAttributeEventListener(const AtomicString&) const; 92 void setAttributeEventListener(const AtomicString&, PassRefPtr<EventListener>); 93 void clearAttributeEventListener(const AtomicString&); 94 90 95 private: 91 96 Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider); … … 97 102 98 103 void handleEvent(PassRefPtr<Event> event, bool useCapture); 99 EventListener* getAttributeEventListener(const AtomicString&) const;100 void setAttributeEventListener(const AtomicString&, PassRefPtr<EventListener>);101 void clearAttributeEventListener(const AtomicString&);102 104 103 105 bool m_isHTML; -
trunk/WebCore/notifications/NotificationCenter.idl
r47056 r47492 34 34 Conditional=NOTIFICATIONS 35 35 ] NotificationCenter { 36 Notification createHTMLNotification(in DOMString url) raises(Exception);37 Notification createNotification(in DOMString iconUrl, in DOMString title, in DOMString body) raises(Exception);36 [V8Custom] Notification createHTMLNotification(in DOMString url) raises(Exception); 37 [V8Custom] Notification createNotification(in DOMString iconUrl, in DOMString title, in DOMString body) raises(Exception); 38 38 39 39 int checkPermission(); -
trunk/WebCore/workers/WorkerThread.h
r47429 r47492 60 60 static unsigned workerThreadCount(); 61 61 62 #if ENABLE(NOTIFICATIONS) 63 NotificationPresenter* getNotificationPresenter() { return m_notificationPresenter; } 64 void setNotificationPresenter(NotificationPresenter* presenter) { m_notificationPresenter = presenter; } 65 #endif 66 62 67 protected: 63 68 WorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&); … … 70 75 71 76 WorkerContext* workerContext() { return m_workerContext.get(); } 72 73 #if ENABLE(NOTIFICATIONS)74 NotificationPresenter* getNotificationPresenter() { return m_notificationPresenter; }75 void setNotificationPresenter(NotificationPresenter* presenter) { m_notificationPresenter = presenter; }76 #endif77 77 78 78 private:
Note: See TracChangeset
for help on using the changeset viewer.