Changeset 110994 in webkit
- Timestamp:
- Mar 16, 2012 5:50:01 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r110991 r110994 1623 1623 IF (ENABLE_NOTIFICATIONS) 1624 1624 LIST(APPEND WebCore_SOURCES 1625 notifications/DOMWindowNotifications.cpp 1625 1626 notifications/NotificationCenter.cpp 1626 1627 notifications/NotificationController.cpp … … 1629 1630 1630 1631 LIST(APPEND WebCore_IDL_FILES 1632 notifications/DOMWindowNotifications.idl 1631 1633 notifications/Notification.idl 1632 1634 notifications/NotificationCenter.idl -
trunk/Source/WebCore/ChangeLog
r110992 r110994 1 2012-03-16 Kentaro Hara <haraken@chromium.org> 2 3 Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl 4 https://bugs.webkit.org/show_bug.cgi?id=79636 5 6 Reviewed by Adam Barth. 7 8 For WebKit modularization, this patch moves Notifications-related APIs 9 from DOMWindow.idl to DOMWindowNotifications.idl. 10 11 Tests: fast/notifications/* (No change in test results) 12 13 * CMakeLists.txt: Added DOMWindowNotifications.{h,cpp,idl}. 14 * DerivedSources.make: Ditto. 15 * DerivedSources.pri: Ditto. 16 * GNUmakefile.list.am: Ditto. 17 * Target.pri: Ditto. 18 * WebCore.gypi: Ditto. 19 * WebCore.vcproj/WebCore.vcproj: Ditto. 20 21 * WebCore.exp.in: Added mangled signatures of webkitNotifications(). 22 23 * notifications/DOMWindowNotifications.cpp: Added. 24 (WebCore): 25 (WebCore::DOMWindowNotifications::DOMWindowNotifications): 26 (WebCore::DOMWindowNotifications::~DOMWindowNotifications): 27 (WebCore::DOMWindowNotifications::from): 28 (WebCore::DOMWindowNotifications::webkitNotifications): 29 (WebCore::DOMWindowNotifications::ensureWebkitNotifications): 30 (WebCore::DOMWindowNotifications::disconnectFrame): 31 * notifications/DOMWindowNotifications.h: Added. 32 (WebCore): 33 (DOMWindowNotifications): 34 * notifications/DOMWindowNotifications.idl: Added. 35 36 * page/DOMWindow.cpp: Removed ENABLE(NOTIFICATIONS). 37 (WebCore::DOMWindow::~DOMWindow): 38 (WebCore::DOMWindow::willDetachPage): 39 (WebCore::DOMWindow::clear): 40 * page/DOMWindow.h: Ditto. 41 (WebCore): 42 (DOMWindow): 43 * page/DOMWindow.idl: Ditto. 44 * page/Frame.cpp: Ditto. 45 (WebCore::Frame::willDetachPage): 46 (WebCore::Frame::transferChildFrameToNewDocument): 47 1 48 2012-03-16 Kentaro Hara <haraken@chromium.org> 2 49 -
trunk/Source/WebCore/DerivedSources.make
r110957 r110994 357 357 $(WebCore)/inspector/ScriptProfileNode.idl \ 358 358 $(WebCore)/loader/appcache/DOMApplicationCache.idl \ 359 $(WebCore)/notifications/DOMWindowNotifications.idl \ 359 360 $(WebCore)/notifications/Notification.idl \ 360 361 $(WebCore)/notifications/NotificationCenter.idl \ -
trunk/Source/WebCore/DerivedSources.pri
r110957 r110994 376 376 $$PWD/inspector/ScriptProfileNode.idl \ 377 377 $$PWD/loader/appcache/DOMApplicationCache.idl \ 378 $$PWD/notifications/DOMWindowNotifications.idl \ 378 379 $$PWD/notifications/Notification.idl \ 379 380 $$PWD/notifications/NotificationCenter.idl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r110957 r110994 2829 2829 Source/WebCore/mathml/MathMLTextElement.cpp \ 2830 2830 Source/WebCore/mathml/MathMLTextElement.h \ 2831 Source/WebCore/notifications/DOMWindowNotifications.cpp \ 2832 Source/WebCore/notifications/DOMWindowNotifications.h \ 2831 2833 Source/WebCore/notifications/NotificationCenter.cpp \ 2832 2834 Source/WebCore/notifications/NotificationCenter.h \ -
trunk/Source/WebCore/Target.pri
r110957 r110994 980 980 loader/TextResourceDecoder.cpp \ 981 981 loader/ThreadableLoader.cpp \ 982 notifications/DOMWindowNotifications.cpp \ 982 983 notifications/Notification.cpp \ 983 984 notifications/NotificationCenter.cpp \ … … 2074 2075 mathml/MathMLMathElement.h \ 2075 2076 mathml/MathMLTextElement.h \ 2077 notifications/DOMWindowNotifications.h \ 2076 2078 notifications/Notification.h \ 2077 2079 notifications/NotificationCenter.h \ -
trunk/Source/WebCore/WebCore.gypi
r110957 r110994 1067 1067 'inspector/ScriptProfileNode.idl', 1068 1068 'loader/appcache/DOMApplicationCache.idl', 1069 'notifications/DOMWindowNotifications.idl', 1069 1070 'notifications/Notification.idl', 1070 1071 'notifications/NotificationCenter.idl', … … 2813 2814 'mathml/MathMLTextElement.cpp', 2814 2815 'mathml/MathMLTextElement.h', 2816 'notifications/DOMWindowNotifications.cpp', 2817 'notifications/DOMWindowNotifications.h', 2815 2818 'notifications/Notification.cpp', 2816 2819 'notifications/Notification.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r110957 r110994 53607 53607 > 53608 53608 <File 53609 RelativePath="..\notifications\DOMWindowNotifications.cpp" 53610 > 53611 </File> 53612 <File 53613 RelativePath="..\notifications\DOMWindowNotifications.h" 53614 > 53615 </File> 53616 <File 53609 53617 RelativePath="..\notifications\Notification.cpp" 53610 53618 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r110903 r110994 4114 4114 A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; }; 4115 4115 A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4116 A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */; }; 4117 A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = A886CF741512301700D279F4 /* DOMWindowNotifications.h */; }; 4116 4118 A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; }; 4117 4119 A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */ = {isa = PBXBuildFile; fileRef = A88DD4860B4629A300C02990 /* PathTraversalState.h */; }; … … 10909 10911 A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSKeyboardEvent.h; sourceTree = "<group>"; }; 10910 10912 A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyboardEvent.cpp; sourceTree = "<group>"; }; 10913 A86E87711512DCEA00AD14C1 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DOMWindowNotifications.idl; path = notifications/DOMWindowNotifications.idl; sourceTree = "<group>"; }; 10911 10914 A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInElement.h; sourceTree = "<group>"; }; 10912 10915 A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInElement.cpp; sourceTree = "<group>"; }; … … 10970 10973 A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; }; 10971 10974 A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; }; 10975 A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMWindowNotifications.cpp; path = notifications/DOMWindowNotifications.cpp; sourceTree = "<group>"; }; 10976 A886CF741512301700D279F4 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMWindowNotifications.h; path = notifications/DOMWindowNotifications.h; sourceTree = "<group>"; }; 10972 10977 A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; }; 10973 10978 A88DD4880B4629B000C02990 /* PathTraversalState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathTraversalState.cpp; sourceTree = "<group>"; }; … … 14392 14397 isa = PBXGroup; 14393 14398 children = ( 14399 A86E87711512DCEA00AD14C1 /* DOMWindowNotifications.idl */, 14400 A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */, 14401 A886CF741512301700D279F4 /* DOMWindowNotifications.h */, 14394 14402 33503CC61017A1B1003B47E1 /* Notification.cpp */, 14395 14403 333F704F0FB49CA2008E12A6 /* Notification.h */, … … 24576 24584 450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */, 24577 24585 C5B4C24D1509236C00A6EF37 /* WebCoreNSURLExtras.h in Headers */, 24586 A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */, 24578 24587 ); 24579 24588 runOnlyForDeploymentPostprocessing = 0; … … 27557 27566 9B2B7AC11509850A008932CC /* MicroDataItemValue.cpp in Sources */, 27558 27567 7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */, 27568 A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */, 27559 27569 ); 27560 27570 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/page/DOMWindow.cpp
r110981 r110994 73 73 #include "MessageEvent.h" 74 74 #include "Navigator.h" 75 #include "NotificationCenter.h"76 #include "NotificationController.h"77 75 #include "Page.h" 78 76 #include "PageGroup.h" … … 419 417 ASSERT(!m_localStorage); 420 418 ASSERT(!m_applicationCache); 421 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)422 ASSERT(!m_notifications);423 #endif424 419 #if ENABLE(BLOB) 425 420 ASSERT(!m_domURL); … … 479 474 InspectorInstrumentation::frameWindowDiscarded(m_frame, this); 480 475 481 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)482 // Clearing Notifications requests involves accessing the client so it must be done483 // before the frame is detached.484 resetNotifications();485 #endif486 487 476 HashSet<DOMWindowProperty*>::iterator stop = m_properties.end(); 488 477 for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it) … … 528 517 for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it) 529 518 (*it)->disconnectFrame(); 530 531 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)532 // FIXME: Notifications shouldn't have different disconnection logic than533 // the rest of the DOMWindowProperties.534 // There is currently no way to reconnect them in resumeFromPageCache() so535 // they will be broken after returning to a cached page.536 // This should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=79636537 resetNotifications();538 #endif539 519 } 540 520 … … 572 552 m_localStorage = 0; 573 553 m_applicationCache = 0; 574 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)575 // FIXME: Notifications shouldn't have different disconnection logic than576 // the rest of the DOMWindowProperties.577 resetNotifications();578 #endif579 554 #if ENABLE(BLOB) 580 555 m_domURL = 0; … … 784 759 return m_localStorage.get(); 785 760 } 786 787 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)788 NotificationCenter* DOMWindow::webkitNotifications() const789 {790 if (!isCurrentlyDisplayedInFrame())791 return 0;792 if (m_notifications)793 return m_notifications.get();794 795 Document* document = this->document();796 if (!document)797 return 0;798 799 Page* page = document->page();800 if (!page)801 return 0;802 803 NotificationClient* provider = NotificationController::clientFrom(page);804 if (provider)805 m_notifications = NotificationCenter::create(document, provider);806 807 return m_notifications.get();808 }809 810 void DOMWindow::resetNotifications()811 {812 if (!m_notifications)813 return;814 m_notifications->disconnectFrame();815 m_notifications = 0;816 }817 #endif818 761 819 762 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) -
trunk/Source/WebCore/page/DOMWindow.h
r110784 r110994 57 57 class Navigator; 58 58 class Node; 59 class NotificationCenter;60 59 class Page; 61 60 class Performance; … … 357 356 Storage* localStorage(ExceptionCode&) const; 358 357 359 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)360 NotificationCenter* webkitNotifications() const;361 // Renders webkitNotifications object safely inoperable, disconnects362 // if from embedder-provided NotificationClient.363 void resetNotifications();364 #endif365 366 358 #if ENABLE(QUOTA) 367 359 StorageInfo* webkitStorageInfo() const; … … 451 443 mutable RefPtr<DOMApplicationCache> m_applicationCache; 452 444 453 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)454 mutable RefPtr<NotificationCenter> m_notifications;455 #endif456 457 445 #if ENABLE(WEB_TIMING) 458 446 mutable RefPtr<Performance> m_performance; -
trunk/Source/WebCore/page/DOMWindow.idl
r110784 r110994 170 170 readonly attribute [V8EnabledAtRuntime] Storage localStorage 171 171 getter raises(DOMException); 172 173 #if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)174 readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;175 #endif176 172 177 173 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS -
trunk/Source/WebCore/page/Frame.cpp
r110784 r110994 688 688 parent->loader()->checkLoadComplete(); 689 689 690 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)691 if (m_domWindow)692 m_domWindow->resetNotifications();693 #endif694 695 690 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end(); 696 691 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it) … … 735 730 736 731 m_page->decrementFrameCount(); 737 }738 739 if (m_domWindow) {740 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)741 m_domWindow->resetNotifications();742 #endif743 732 } 744 733
Note: See TracChangeset
for help on using the changeset viewer.