Changeset 108958 in webkit
- Timestamp:
- Feb 26, 2012 10:33:45 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 4 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r108954 r108958 1038 1038 page/NavigatorBase.cpp 1039 1039 page/NavigatorRegisterProtocolHandler.cpp 1040 page/NavigatorSupplement.cpp1041 1040 page/OriginAccessEntry.cpp 1042 1041 page/Page.cpp … … 1044 1043 page/PageGroupLoadDeferrer.cpp 1045 1044 page/PageSerializer.cpp 1046 page/PageSupplement.cpp1047 1045 page/PageVisibilityState.cpp 1048 1046 page/Performance.cpp -
trunk/Source/WebCore/ChangeLog
r108957 r108958 1 2012-02-26 Adam Barth <abarth@webkit.org> 2 3 Extract Supplementable base class from Page and Navigator 4 https://bugs.webkit.org/show_bug.cgi?id=79624 5 6 Reviewed by Hajime Morita. 7 8 We'll use this pattern again soon for ScriptExecutionContext. 9 10 * CMakeLists.txt: 11 * GNUmakefile.list.am: 12 * Modules/gamepad/NavigatorGamepad.cpp: 13 (WebCore::NavigatorGamepad::from): 14 * Modules/gamepad/NavigatorGamepad.h: 15 * Modules/geolocation/NavigatorGeolocation.cpp: 16 (WebCore::NavigatorGeolocation::from): 17 * Modules/geolocation/NavigatorGeolocation.h: 18 * Modules/mediastream/NavigatorMediaStream.cpp: 19 (WebCore::NavigatorMediaStream::webkitGetUserMedia): 20 * Modules/mediastream/UserMediaController.cpp: 21 (WebCore::provideUserMediaTo): 22 * Modules/mediastream/UserMediaController.h: 23 (WebCore::UserMediaController::from): 24 * Target.pri: 25 * WebCore.gypi: 26 * WebCore.vcproj/WebCore.vcproj: 27 * WebCore.xcodeproj/project.pbxproj: 28 * dom/DeviceMotionController.cpp: 29 (WebCore::provideDeviceMotionTo): 30 * dom/DeviceMotionController.h: 31 (WebCore::DeviceMotionController::from): 32 * dom/DeviceOrientationController.cpp: 33 (WebCore::provideDeviceOrientationTo): 34 * dom/DeviceOrientationController.h: 35 (WebCore): 36 (WebCore::DeviceOrientationController::from): 37 * notifications/NotificationController.cpp: 38 (WebCore::provideNotification): 39 * notifications/NotificationController.h: 40 (WebCore): 41 (WebCore::NotificationController::from): 42 * page/DOMWindow.cpp: 43 (WebCore::DOMWindow::page): 44 (WebCore): 45 (WebCore::DOMWindow::addEventListener): 46 (WebCore::DOMWindow::removeEventListener): 47 (WebCore::DOMWindow::removeAllEventListeners): 48 * page/DOMWindow.h: 49 (WebCore): 50 (DOMWindow): 51 * page/Navigator.cpp: 52 (WebCore): 53 * page/Navigator.h: 54 (Navigator): 55 * page/NavigatorSupplement.cpp: Removed. 56 * page/NavigatorSupplement.h: Removed. 57 * page/Page.cpp: 58 (WebCore): 59 * page/Page.h: 60 (Page): 61 * page/PageSupplement.cpp: Removed. 62 * page/PageSupplement.h: Removed. 63 * page/SpeechInput.cpp: 64 (WebCore::provideSpeechInputTo): 65 * page/SpeechInput.h: 66 (WebCore::SpeechInput::from): 67 * platform/Supplementable.h: Added. 68 (WebCore): 69 (Supplement): 70 (WebCore::Supplement::~Supplement): 71 (WebCore::Supplement::provideTo): 72 (WebCore::Supplement::from): 73 (Supplementable): 74 (WebCore::Supplementable::provideSupplement): 75 (WebCore::Supplementable::requireSupplement): 76 1 77 2012-02-26 Hajime Morrita <morrita@chromium.org> 2 78 -
trunk/Source/WebCore/GNUmakefile.list.am
r108954 r108958 2783 2783 Source/WebCore/page/NavigatorRegisterProtocolHandler.cpp \ 2784 2784 Source/WebCore/page/NavigatorRegisterProtocolHandler.h \ 2785 Source/WebCore/page/NavigatorSupplement.cpp \2786 Source/WebCore/page/NavigatorSupplement.h \2787 2785 Source/WebCore/page/OriginAccessEntry.cpp \ 2788 2786 Source/WebCore/page/OriginAccessEntry.h \ … … 2795 2793 Source/WebCore/page/PageSerializer.cpp \ 2796 2794 Source/WebCore/page/PageSerializer.h \ 2797 Source/WebCore/page/PageSupplement.cpp \2798 Source/WebCore/page/PageSupplement.h \2799 2795 Source/WebCore/page/PageVisibilityState.cpp \ 2800 2796 Source/WebCore/page/PageVisibilityState.h \ … … 3351 3347 Source/WebCore/platform/SSLKeyGenerator.h \ 3352 3348 Source/WebCore/platform/SuddenTermination.h \ 3349 Source/WebCore/platform/Supplementable.h \ 3353 3350 Source/WebCore/platform/SystemTime.h \ 3354 3351 Source/WebCore/platform/text/Base64.cpp \ -
trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp
r107536 r108958 47 47 { 48 48 DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorGamepad")); 49 NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>( NavigatorSupplement::from(navigator, name));49 NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, name)); 50 50 if (!supplement) { 51 51 supplement = new NavigatorGamepad(); -
trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.h
r107536 r108958 29 29 #if ENABLE(GAMEPAD) 30 30 31 #include " NavigatorSupplement.h"31 #include "Supplementable.h" 32 32 33 33 namespace WebCore { … … 36 36 class Navigator; 37 37 38 class NavigatorGamepad : public NavigatorSupplement{38 class NavigatorGamepad : public Supplement<Navigator> { 39 39 public: 40 40 virtual ~NavigatorGamepad(); -
trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp
r108428 r108958 55 55 { 56 56 DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorGeolocation")); 57 NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>( NavigatorSupplement::from(navigator, name));57 NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, name)); 58 58 if (!supplement) { 59 59 supplement = new NavigatorGeolocation(navigator->frame()); -
trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h
r108428 r108958 28 28 29 29 #include "DOMWindowProperty.h" 30 #include " NavigatorSupplement.h"30 #include "Supplementable.h" 31 31 32 32 namespace WebCore { … … 36 36 class Navigator; 37 37 38 class NavigatorGeolocation : public NavigatorSupplement, public DOMWindowProperty {38 class NavigatorGeolocation : public Supplement<Navigator>, public DOMWindowProperty { 39 39 public: 40 40 virtual ~NavigatorGeolocation(); -
trunk/Source/WebCore/Modules/mediastream/NavigatorMediaStream.cpp
r108437 r108958 54 54 return; 55 55 56 UserMediaController* userMedia = UserMediaController::from(navigator->frame() );56 UserMediaController* userMedia = UserMediaController::from(navigator->frame() ? navigator->frame()->page() : 0); 57 57 if (!userMedia) { 58 58 ec = NOT_SUPPORTED_ERR; -
trunk/Source/WebCore/Modules/mediastream/UserMediaController.cpp
r108608 r108958 53 53 void provideUserMediaTo(Page* page, UserMediaClient* client) 54 54 { 55 PageSupplement::provideTo(page, UserMediaController::supplementName(), UserMediaController::create(client));55 UserMediaController::provideTo(page, UserMediaController::supplementName(), UserMediaController::create(client)); 56 56 } 57 57 -
trunk/Source/WebCore/Modules/mediastream/UserMediaController.h
r108437 r108958 28 28 #if ENABLE(MEDIA_STREAM) 29 29 30 #include "Page Supplement.h"30 #include "Page.h" 31 31 #include "UserMediaClient.h" 32 32 #include <wtf/PassOwnPtr.h> … … 34 34 namespace WebCore { 35 35 36 class Frame; 37 class Page; 38 39 class UserMediaController : public PageSupplement { 36 class UserMediaController : public Supplement<Page> { 40 37 public: 41 38 ~UserMediaController(); … … 47 44 static PassOwnPtr<UserMediaController> create(UserMediaClient*); 48 45 static const AtomicString& supplementName(); 49 static UserMediaController* from(Frame* frame) { return static_cast<UserMediaController*>(PageSupplement::from(frame, supplementName())); } 50 static UserMediaController* from(Page* page) { return static_cast<UserMediaController*>(PageSupplement::from(page, supplementName())); } 46 static UserMediaController* from(Page* page) { return static_cast<UserMediaController*>(Supplement<Page>::from(page, supplementName())); } 51 47 52 48 protected: -
trunk/Source/WebCore/Modules/vibration/Vibration.cpp
r108272 r108958 125 125 const AtomicString& Vibration::supplementName() 126 126 { 127 DEFINE_STATIC_LOCAL(AtomicString, name, (" vibration"));127 DEFINE_STATIC_LOCAL(AtomicString, name, ("Vibration")); 128 128 return name; 129 129 } … … 136 136 void provideVibrationTo(Page* page, VibrationClient* client) 137 137 { 138 PageSupplement::provideTo(page, Vibration::supplementName(), Vibration::create(client));138 Vibration::provideTo(page, Vibration::supplementName(), Vibration::create(client)); 139 139 } 140 140 -
trunk/Source/WebCore/Modules/vibration/Vibration.h
r108272 r108958 23 23 #if ENABLE(VIBRATION) 24 24 25 #include "Page Supplement.h"25 #include "Page.h" 26 26 #include "Timer.h" 27 27 #include <wtf/PassOwnPtr.h> … … 33 33 class VibrationClient; 34 34 35 class Vibration : public PageSupplement{35 class Vibration : public Supplement<Page> { 36 36 public: 37 37 typedef Vector<unsigned long> VibrationPattern; … … 53 53 54 54 static const AtomicString& supplementName(); 55 static Vibration* from(Page* page) { return static_cast<Vibration*>( PageSupplement::from(page, supplementName())); }55 static Vibration* from(Page* page) { return static_cast<Vibration*>(Supplement<Page>::from(page, supplementName())); } 56 56 static bool isActive(Page*); 57 57 -
trunk/Source/WebCore/Target.pri
r108954 r108958 1007 1007 page/NavigatorBase.cpp \ 1008 1008 page/NavigatorRegisterProtocolHandler.cpp \ 1009 page/NavigatorSupplement.cpp \1010 1009 page/OriginAccessEntry.cpp \ 1011 1010 page/Page.cpp \ 1012 1011 page/PageGroup.cpp \ 1013 1012 page/PageGroupLoadDeferrer.cpp \ 1014 page/PageSupplement.cpp \1015 1013 page/PageVisibilityState.cpp \ 1016 1014 page/Performance.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r108954 r108958 224 224 'page/PageGroup.h', 225 225 'page/PageSerializer.h', 226 'page/PageSupplement.h',227 226 'page/PageVisibilityState.h', 228 227 'page/PrintContext.h', … … 296 295 'platform/SharedBuffer.h', 297 296 'platform/SharedBufferChunkReader.h', 297 'platform/Supplementable.h', 298 298 'platform/SystemTime.h', 299 299 'platform/Theme.h', … … 2683 2683 'page/NavigatorRegisterProtocolHandler.cpp', 2684 2684 'page/NavigatorRegisterProtocolHandler.h', 2685 'page/NavigatorSupplement.cpp',2686 'page/NavigatorSupplement.h',2687 2685 'page/OriginAccessEntry.cpp', 2688 2686 'page/OriginAccessEntry.h', … … 2692 2690 'page/PageGroupLoadDeferrer.h', 2693 2691 'page/PageSerializer.cpp', 2694 'page/PageSupplement.cpp',2695 2692 'page/PageVisibilityState.cpp', 2696 2693 'page/Performance.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r108954 r108958 25711 25711 </File> 25712 25712 <File 25713 RelativePath="..\page\NavigatorSupplement.cpp"25714 >25715 </File>25716 <File25717 RelativePath="..\page\NavigatorSupplement.h"25718 >25719 </File>25720 <File25721 25713 RelativePath="..\page\OriginAccessEntry.cpp" 25722 25714 > … … 25752 25744 <File 25753 25745 RelativePath="..\page\PageSerializer.h" 25754 >25755 </File>25756 <File25757 RelativePath="..\page\PageSupplement.cpp"25758 >25759 </File>25760 <File25761 RelativePath="..\page\PageSupplement.h"25762 25746 > 25763 25747 </File> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r108956 r108958 3353 3353 97627B8D14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97627B8B14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp */; }; 3354 3354 97627B8E14FB3CEE002CDCA1 /* ContextDestructionObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 97627B8C14FB3CEE002CDCA1 /* ContextDestructionObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3355 97627B9814FB5424002CDCA1 /* Supplementable.h in Headers */ = {isa = PBXBuildFile; fileRef = 97627B9714FB5424002CDCA1 /* Supplementable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3355 3356 97665013144FAA4200F6BB51 /* EventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 97665011144FAA4200F6BB51 /* EventFactory.h */; }; 3356 3357 9766504F144FBFFE00F6BB51 /* EventFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9766504E144FBFFE00F6BB51 /* EventFactory.cpp */; }; … … 3467 3468 97C471DB12F925BD0086354B /* ContentSecurityPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */; }; 3468 3469 97C471DC12F925BD0086354B /* ContentSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3469 97CC3AE214E8E4A200894988 /* NavigatorSupplement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97CC3AE014E8E4A200894988 /* NavigatorSupplement.cpp */; };3470 97CC3AE314E8E4A200894988 /* NavigatorSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 97CC3AE114E8E4A200894988 /* NavigatorSupplement.h */; settings = {ATTRIBUTES = (Private, ); }; };3471 3470 97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */; }; 3472 3471 97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 3592 3591 A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3593 3592 A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; }; 3594 A71E083714E3CEAF006A4619 /* PageSupplement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71E083514E3CEAF006A4619 /* PageSupplement.cpp */; };3595 A71E083814E3CEAF006A4619 /* PageSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = A71E083614E3CEAF006A4619 /* PageSupplement.h */; settings = {ATTRIBUTES = (Private, ); }; };3596 3593 A723F77B1484CA4C008C6DBE /* PlatformExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3597 3594 A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */; }; … … 10238 10235 97627B8B14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContextDestructionObserver.cpp; sourceTree = "<group>"; }; 10239 10236 97627B8C14FB3CEE002CDCA1 /* ContextDestructionObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextDestructionObserver.h; sourceTree = "<group>"; }; 10237 97627B9714FB5424002CDCA1 /* Supplementable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Supplementable.h; sourceTree = "<group>"; }; 10240 10238 97665011144FAA4200F6BB51 /* EventFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventFactory.h; sourceTree = "<group>"; }; 10241 10239 9766504E144FBFFE00F6BB51 /* EventFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventFactory.cpp; sourceTree = "<group>"; }; … … 10356 10354 97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentSecurityPolicy.cpp; sourceTree = "<group>"; }; 10357 10355 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentSecurityPolicy.h; sourceTree = "<group>"; }; 10358 97CC3AE014E8E4A200894988 /* NavigatorSupplement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorSupplement.cpp; sourceTree = "<group>"; };10359 97CC3AE114E8E4A200894988 /* NavigatorSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorSupplement.h; sourceTree = "<group>"; };10360 10356 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowProperty.cpp; sourceTree = "<group>"; }; 10361 10357 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowProperty.h; sourceTree = "<group>"; }; … … 10491 10487 A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; }; 10492 10488 A71A70C911AFB02000989D6D /* HTMLMeterElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMeterElement.idl; sourceTree = "<group>"; }; 10493 A71E083514E3CEAF006A4619 /* PageSupplement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageSupplement.cpp; sourceTree = "<group>"; };10494 A71E083614E3CEAF006A4619 /* PageSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageSupplement.h; sourceTree = "<group>"; };10495 10489 A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformExportMacros.h; sourceTree = "<group>"; }; 10496 10490 A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedRect.cpp; sourceTree = "<group>"; }; … … 15274 15268 9730BE1514EF286B00DF06B9 /* NavigatorRegisterProtocolHandler.h */, 15275 15269 9730BE1614EF286B00DF06B9 /* NavigatorRegisterProtocolHandler.idl */, 15276 97CC3AE014E8E4A200894988 /* NavigatorSupplement.cpp */,15277 97CC3AE114E8E4A200894988 /* NavigatorSupplement.h */,15278 15270 00146288103CD1DE000B20DB /* OriginAccessEntry.cpp */, 15279 15271 00146289103CD1DE000B20DB /* OriginAccessEntry.h */, … … 15286 15278 371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */, 15287 15279 371E65CB13661EDC00BEEDB0 /* PageSerializer.h */, 15288 A71E083514E3CEAF006A4619 /* PageSupplement.cpp */,15289 A71E083614E3CEAF006A4619 /* PageSupplement.h */,15290 15280 FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */, 15291 15281 FFD5B978135CC97800D5E92A /* PageVisibilityState.h */, … … 19970 19960 F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */, 19971 19961 93B2D8150F9920D2006AE6B2 /* SuddenTermination.h */, 19962 97627B9714FB5424002CDCA1 /* Supplementable.h */, 19972 19963 93E62D990985F41600E1B5E3 /* SystemTime.h */, 19973 19964 BCE65D310EAD1211007E4533 /* Theme.cpp */, … … 23365 23356 9711460414EF009A00674FD9 /* NavigatorGeolocation.h in Headers */, 23366 23357 97E4A12614F4C5D400870E43 /* NavigatorRegisterProtocolHandler.h in Headers */, 23367 97CC3AE314E8E4A200894988 /* NavigatorSupplement.h in Headers */,23368 23358 8A309C9F123950BE00CB9204 /* NestingLevelIncrementer.h in Headers */, 23369 23359 656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */, … … 23429 23419 F34742E51343633C00531BC2 /* PageScriptDebugServer.h in Headers */, 23430 23420 371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */, 23431 A71E083814E3CEAF006A4619 /* PageSupplement.h in Headers */,23432 23421 E1284AE110447D4500EAEB52 /* PageTransitionEvent.h in Headers */, 23433 23422 51E1ECC30C91C90400DC255B /* PageURLRecord.h in Headers */, … … 23886 23875 93B2D8160F9920D2006AE6B2 /* SuddenTermination.h in Headers */, 23887 23876 97C078501165D5BE003A32EF /* SuffixTree.h in Headers */, 23877 97627B9814FB5424002CDCA1 /* Supplementable.h in Headers */, 23888 23878 087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */, 23889 23879 62C1217D11AB9E77003C462C /* SuspendableTimer.h in Headers */, … … 26526 26516 9711460314EF009A00674FD9 /* NavigatorGeolocation.cpp in Sources */, 26527 26517 97E4A12714F4C5D700870E43 /* NavigatorRegisterProtocolHandler.cpp in Sources */, 26528 97CC3AE214E8E4A200894988 /* NavigatorSupplement.cpp in Sources */,26529 26518 5D874F130D161D3200796C3B /* NetscapePlugInStreamLoader.cpp in Sources */, 26530 26519 59C27F05138D28C10079B7E2 /* NetworkResourcesData.cpp in Sources */, … … 26574 26563 F34742E41343633C00531BC2 /* PageScriptDebugServer.cpp in Sources */, 26575 26564 371E65CE13661EED00BEEDB0 /* PageSerializer.cpp in Sources */, 26576 A71E083714E3CEAF006A4619 /* PageSupplement.cpp in Sources */,26577 26565 E1284AEA10447DEE00EAEB52 /* PageTransitionEvent.cpp in Sources */, 26578 26566 51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */, -
trunk/Source/WebCore/dom/DeviceMotionController.cpp
r107536 r108958 151 151 void provideDeviceMotionTo(Page* page, DeviceMotionClient* client) 152 152 { 153 PageSupplement::provideTo(page, DeviceMotionController::supplementName(), DeviceMotionController::create(client));153 DeviceMotionController::provideTo(page, DeviceMotionController::supplementName(), DeviceMotionController::create(client)); 154 154 } 155 155 -
trunk/Source/WebCore/dom/DeviceMotionController.h
r107518 r108958 28 28 29 29 #include "DOMWindow.h" 30 #include "Page Supplement.h"30 #include "Page.h" 31 31 #include "Timer.h" 32 32 #include <wtf/HashCountedSet.h> … … 37 37 class DeviceMotionClient; 38 38 39 class DeviceMotionController : public PageSupplement{39 class DeviceMotionController : public Supplement<Page> { 40 40 public: 41 41 ~DeviceMotionController(); … … 55 55 56 56 static const AtomicString& supplementName(); 57 static DeviceMotionController* from(Frame* frame) { return static_cast<DeviceMotionController*>(PageSupplement::from(frame, supplementName())); } 58 static DeviceMotionController* from(Page* page) { return static_cast<DeviceMotionController*>(PageSupplement::from(page, supplementName())); } 57 static DeviceMotionController* from(Page* page) { return static_cast<DeviceMotionController*>(Supplement<Page>::from(page, supplementName())); } 59 58 static bool isActiveAt(Page*); 60 59 -
trunk/Source/WebCore/dom/DeviceOrientationController.cpp
r108608 r108958 153 153 void provideDeviceOrientationTo(Page* page, DeviceOrientationClient* client) 154 154 { 155 PageSupplement::provideTo(page, DeviceOrientationController::supplementName(), DeviceOrientationController::create(page, client));155 DeviceOrientationController::provideTo(page, DeviceOrientationController::supplementName(), DeviceOrientationController::create(page, client)); 156 156 } 157 157 -
trunk/Source/WebCore/dom/DeviceOrientationController.h
r107518 r108958 28 28 29 29 #include "DOMWindow.h" 30 #include "Page Supplement.h"30 #include "Page.h" 31 31 #include "Timer.h" 32 32 … … 37 37 class DeviceOrientation; 38 38 class DeviceOrientationClient; 39 class Page;40 39 41 class DeviceOrientationController : public PageSupplement{40 class DeviceOrientationController : public Supplement<Page> { 42 41 public: 43 42 ~DeviceOrientationController(); … … 59 58 60 59 static const AtomicString& supplementName(); 61 static DeviceOrientationController* from(Frame* frame) { return static_cast<DeviceOrientationController*>(PageSupplement::from(frame, supplementName())); } 62 static DeviceOrientationController* from(Page* page) { return static_cast<DeviceOrientationController*>(PageSupplement::from(page, supplementName())); } 60 static DeviceOrientationController* from(Page* page) { return static_cast<DeviceOrientationController*>(Supplement<Page>::from(page, supplementName())); } 63 61 static bool isActiveAt(Page*); 64 62 -
trunk/Source/WebCore/notifications/NotificationController.cpp
r108615 r108958 66 66 void provideNotification(Page* page, NotificationPresenter* client) 67 67 { 68 PageSupplement::provideTo(page, NotificationController::supplementName(), NotificationController::create(page, client));68 NotificationController::provideTo(page, NotificationController::supplementName(), NotificationController::create(page, client)); 69 69 } 70 70 -
trunk/Source/WebCore/notifications/NotificationController.h
r108615 r108958 29 29 #if ENABLE(NOTIFICATIONS) 30 30 31 #include "Page Supplement.h"31 #include "Page.h" 32 32 #include <wtf/Forward.h> 33 33 #include <wtf/Noncopyable.h> … … 36 36 37 37 class NotificationPresenter; 38 class Page;39 38 40 class NotificationController : public PageSupplement{39 class NotificationController : public Supplement<Page> { 41 40 WTF_MAKE_NONCOPYABLE(NotificationController); 42 41 public: … … 45 44 static PassOwnPtr<NotificationController> create(Page*, NotificationPresenter*); 46 45 static const AtomicString& supplementName(); 47 static NotificationController* from(Frame* frame) { return static_cast<NotificationController*>(PageSupplement::from(frame, supplementName())); } 48 static NotificationController* from(Page* page) { return static_cast<NotificationController*>(PageSupplement::from(page, supplementName())); } 46 static NotificationController* from(Page* page) { return static_cast<NotificationController*>(Supplement<Page>::from(page, supplementName())); } 49 47 static NotificationPresenter* clientFrom(Page*); 50 48 -
trunk/Source/WebCore/page/DOMWindow.cpp
r108700 r108958 464 464 } 465 465 466 Page* DOMWindow::page() 467 { 468 return frame() ? frame()->page() : 0; 469 } 470 466 471 void DOMWindow::frameDestroyed() 467 472 { … … 1495 1500 #if ENABLE(DEVICE_ORIENTATION) 1496 1501 else if (eventType == eventNames().devicemotionEvent) { 1497 if (DeviceMotionController* controller = DeviceMotionController::from( frame()))1502 if (DeviceMotionController* controller = DeviceMotionController::from(page())) 1498 1503 controller->addListener(this); 1499 1504 } else if (eventType == eventNames().deviceorientationEvent) { 1500 if (DeviceOrientationController* controller = DeviceOrientationController::from( frame()))1505 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1501 1506 controller->addListener(this); 1502 1507 } … … 1522 1527 #if ENABLE(DEVICE_ORIENTATION) 1523 1528 else if (eventType == eventNames().devicemotionEvent) { 1524 if (DeviceMotionController* controller = DeviceMotionController::from( frame()))1529 if (DeviceMotionController* controller = DeviceMotionController::from(page())) 1525 1530 controller->removeListener(this); 1526 1531 } else if (eventType == eventNames().deviceorientationEvent) { 1527 if (DeviceOrientationController* controller = DeviceOrientationController::from( frame()))1532 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1528 1533 controller->removeListener(this); 1529 1534 } … … 1580 1585 1581 1586 #if ENABLE(DEVICE_ORIENTATION) 1582 if (DeviceMotionController* controller = DeviceMotionController::from( frame()))1587 if (DeviceMotionController* controller = DeviceMotionController::from(page())) 1583 1588 controller->removeAllListeners(this); 1584 if (DeviceOrientationController* controller = DeviceOrientationController::from( frame()))1589 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1585 1590 controller->removeAllListeners(this); 1586 1591 #endif -
trunk/Source/WebCore/page/DOMWindow.h
r108603 r108958 57 57 class Node; 58 58 class NotificationCenter; 59 class Page; 59 60 class Performance; 60 61 class PostMessageTimer; … … 401 402 explicit DOMWindow(Frame*); 402 403 404 Page* page(); 405 403 406 virtual void frameDestroyed() OVERRIDE; 404 407 virtual void willDetachPage() OVERRIDE; -
trunk/Source/WebCore/page/Navigator.cpp
r108450 r108958 50 50 Navigator::~Navigator() 51 51 { 52 }53 54 void Navigator::provideSupplement(const AtomicString& name, PassOwnPtr<NavigatorSupplement> supplement)55 {56 ASSERT(!m_suppliments.get(name.impl()));57 m_suppliments.set(name.impl(), supplement);58 }59 60 NavigatorSupplement* Navigator::requireSupplement(const AtomicString& name)61 {62 return m_suppliments.get(name.impl());63 52 } 64 53 -
trunk/Source/WebCore/page/Navigator.h
r108450 r108958 23 23 #include "DOMWindowProperty.h" 24 24 #include "NavigatorBase.h" 25 #include " NavigatorSupplement.h"25 #include "Supplementable.h" 26 26 #include <wtf/Forward.h> 27 27 #include <wtf/HashMap.h> … … 40 40 typedef int ExceptionCode; 41 41 42 class Navigator : public NavigatorBase, public RefCounted<Navigator>, public DOMWindowProperty {42 class Navigator : public NavigatorBase, public RefCounted<Navigator>, public DOMWindowProperty, public Supplementable<Navigator> { 43 43 public: 44 44 static PassRefPtr<Navigator> create(Frame* frame) { return adoptRef(new Navigator(frame)); } … … 61 61 void getStorageUpdates(); 62 62 63 void provideSupplement(const AtomicString&, PassOwnPtr<NavigatorSupplement>);64 NavigatorSupplement* requireSupplement(const AtomicString&);65 66 63 private: 67 64 explicit Navigator(Frame*); 68 69 typedef HashMap<AtomicStringImpl*, OwnPtr<NavigatorSupplement> > NavigatorSupplementMap;70 NavigatorSupplementMap m_suppliments;71 65 72 66 mutable RefPtr<DOMPluginArray> m_plugins; -
trunk/Source/WebCore/page/Page.cpp
r108615 r108958 1050 1050 } 1051 1051 1052 void Page::provideSupplement(const AtomicString& name, PassOwnPtr<PageSupplement> supplement)1053 {1054 ASSERT(!m_supplements.get(name.impl()));1055 m_supplements.set(name.impl(), supplement);1056 }1057 1058 PageSupplement* Page::requireSupplement(const AtomicString& name)1059 {1060 return m_supplements.get(name.impl());1061 }1062 1063 1052 Page::PageClients::PageClients() 1064 1053 : chromeClient(0) -
trunk/Source/WebCore/page/Page.h
r108615 r108958 25 25 #include "FindOptions.h" 26 26 #include "LayoutTypes.h" 27 #include "PageSupplement.h"28 27 #include "PageVisibilityState.h" 29 28 #include "PlatformScreen.h" 30 29 #include "PlatformString.h" 30 #include "Supplementable.h" 31 31 #include "ViewportArguments.h" 32 32 #include <wtf/Forward.h> … … 90 90 float deviceScaleFactor(Frame*); 91 91 92 class Page {92 class Page : public Supplementable<Page> { 93 93 WTF_MAKE_NONCOPYABLE(Page); 94 94 friend class Settings; … … 325 325 void addRelevantRepaintedObject(RenderObject*, const IntRect& objectPaintRect); 326 326 327 void provideSupplement(const AtomicString&, PassOwnPtr<PageSupplement>);328 PageSupplement* requireSupplement(const AtomicString&);329 330 327 private: 331 328 void initGroup(); 332 333 typedef HashMap<AtomicStringImpl*, OwnPtr<PageSupplement> > PageSupplementMap;334 PageSupplementMap m_supplements;335 329 336 330 #if ASSERT_DISABLED -
trunk/Source/WebCore/page/SpeechInput.cpp
r108446 r108958 126 126 void provideSpeechInputTo(Page* page, SpeechInputClient* client) 127 127 { 128 PageSupplement::provideTo(page, SpeechInput::supplementName(), SpeechInput::create(client));128 SpeechInput::provideTo(page, SpeechInput::supplementName(), SpeechInput::create(client)); 129 129 } 130 130 -
trunk/Source/WebCore/page/SpeechInput.h
r108446 r108958 34 34 #if ENABLE(INPUT_SPEECH) 35 35 36 #include "Page Supplement.h"36 #include "Page.h" 37 37 #include "SpeechInputListener.h" 38 38 #include <wtf/Forward.h> … … 50 50 // recognition and methods for the speech recognition engine to return back the results. 51 51 class SpeechInput : public SpeechInputListener, 52 public PageSupplement{52 public Supplement<Page> { 53 53 WTF_MAKE_NONCOPYABLE(SpeechInput); 54 54 public: … … 57 57 static PassOwnPtr<SpeechInput> create(SpeechInputClient*); 58 58 static const AtomicString& supplementName(); 59 static SpeechInput* from(Frame* frame) { return static_cast<SpeechInput*>(PageSupplement::from(frame, supplementName())); } 60 static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(PageSupplement::from(page, supplementName())); } 59 static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(Supplement<Page>::from(page, supplementName())); } 61 60 62 61 // Generates a unique ID for the given listener to be used for speech requests.
Note: See TracChangeset
for help on using the changeset viewer.