Changeset 133028 in webkit
- Timestamp:
- Oct 31, 2012 7:59:59 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r133016 r133028 1711 1711 page/ContextMenuController.cpp 1712 1712 page/Crypto.cpp 1713 page/DeviceController.cpp1714 1713 page/DiagnosticLoggingKeys.cpp 1715 1714 page/DOMSecurityPolicy.cpp -
trunk/Source/WebCore/ChangeLog
r133021 r133028 1 2012-10-31 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r133016. 4 http://trac.webkit.org/changeset/133016 5 https://bugs.webkit.org/show_bug.cgi?id=100856 6 7 broke compile-webkit on several bots (Requested by podivilov 8 on #webkit). 9 10 * CMakeLists.txt: 11 * GNUmakefile.list.am: 12 * Target.pri: 13 * WebCore.gypi: 14 * WebCore.vcproj/WebCore.vcproj: 15 * WebCore.xcodeproj/project.pbxproj: 16 * dom/DeviceOrientationClient.h: 17 (DeviceOrientationClient): 18 * dom/DeviceOrientationController.cpp: 19 (WebCore::DeviceOrientationController::DeviceOrientationController): 20 (WebCore): 21 (WebCore::DeviceOrientationController::~DeviceOrientationController): 22 (WebCore::DeviceOrientationController::timerFired): 23 (WebCore::DeviceOrientationController::addListener): 24 (WebCore::DeviceOrientationController::removeListener): 25 (WebCore::DeviceOrientationController::removeAllListeners): 26 (WebCore::DeviceOrientationController::suspendEventsForAllListeners): 27 (WebCore::DeviceOrientationController::resumeEventsForAllListeners): 28 (WebCore::DeviceOrientationController::didChangeDeviceOrientation): 29 (WebCore::DeviceOrientationController::supplementName): 30 * dom/DeviceOrientationController.h: 31 (WebCore): 32 (DeviceOrientationController): 33 (WebCore::DeviceOrientationController::isActive): 34 (WebCore::DeviceOrientationController::client): 35 (WebCore::DeviceOrientationController::from): 36 * dom/Document.cpp: 37 (WebCore::Document::suspendActiveDOMObjects): 38 (WebCore::Document::resumeActiveDOMObjects): 39 * loader/EmptyClients.h: 40 (WebCore::EmptyDeviceOrientationClient::startUpdating): 41 (WebCore::EmptyDeviceOrientationClient::stopUpdating): 42 * page/DOMWindow.cpp: 43 (WebCore::DOMWindow::addEventListener): 44 (WebCore::DOMWindow::removeEventListener): 45 (WebCore::DOMWindow::removeAllEventListeners): 46 * page/DeviceClient.h: Removed. 47 * page/DeviceController.cpp: Removed. 48 * page/DeviceController.h: Removed. 49 1 50 2012-10-31 Antti Koivisto <antti@apple.com> 2 51 -
trunk/Source/WebCore/GNUmakefile.list.am
r133016 r133028 4008 4008 Source/WebCore/page/Crypto.cpp \ 4009 4009 Source/WebCore/page/Crypto.h \ 4010 Source/WebCore/page/DeviceClient.h \4011 Source/WebCore/page/DeviceController.cpp \4012 Source/WebCore/page/DeviceController.h \4013 4010 Source/WebCore/page/DiagnosticLoggingKeys.cpp \ 4014 4011 Source/WebCore/page/DiagnosticLoggingKeys.h \ -
trunk/Source/WebCore/Target.pri
r133016 r133028 872 872 page/ContextMenuController.cpp \ 873 873 page/Crypto.cpp \ 874 page/DeviceController.cpp \875 874 page/DiagnosticLoggingKeys.cpp \ 876 875 page/DOMSelection.cpp \ … … 1999 1998 page/ContextMenuProvider.h \ 2000 1999 page/Coordinates.h \ 2001 page/DeviceClient.h \2002 page/DeviceController.h \2003 2000 page/DiagnosticLoggingKeys.h \ 2004 2001 page/DOMSelection.h \ -
trunk/Source/WebCore/WebCore.gypi
r133016 r133028 3114 3114 'page/Crypto.cpp', 3115 3115 'page/Crypto.h', 3116 'page/DeviceClient.h',3117 'page/DeviceController.cpp',3118 'page/DeviceController.h',3119 3116 'page/DiagnosticLoggingKeys.cpp', 3120 3117 'page/DiagnosticLoggingKeys.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r133016 r133028 26964 26964 </File> 26965 26965 <File 26966 RelativePath="..\page\DeviceClient.h"26967 >26968 </File>26969 <File26970 RelativePath="..\page\DeviceController.cpp"26971 >26972 </File>26973 <File26974 RelativePath="..\page\DeviceController.h"26975 >26976 </File>26977 <File26978 26966 RelativePath="..\page\DiagnosticLoggingKeys.cpp" 26979 26967 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r133016 r133028 5892 5892 CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; }; 5893 5893 CAE9F910146441F000C245B1 /* CSSVariableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B1 /* CSSVariableValue.h */; }; 5894 CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };5895 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };5896 CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; };5897 5894 CD127DED14F3097D00E84779 /* WebCoreFullScreenWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */; }; 5898 5895 CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 13270 13267 CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; }; 13271 13268 CAE9F90E146441F000C245B1 /* CSSVariableValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableValue.h; sourceTree = "<group>"; }; 13272 CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };13273 CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };13274 CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; };13275 13269 CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWindow.h; sourceTree = "<group>"; }; 13276 13270 CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWindow.mm; sourceTree = "<group>"; }; … … 15861 15855 975CA288130365F800E99AD9 /* Crypto.h */, 15862 15856 975CA289130365F800E99AD9 /* Crypto.idl */, 15863 CCC2B51015F613060048CDD6 /* DeviceClient.h */,15864 CCC2B51115F613060048CDD6 /* DeviceController.cpp */,15865 CCC2B51215F613060048CDD6 /* DeviceController.h */,15866 15857 CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */, 15867 15858 CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */, … … 22787 22778 FD1660A513787C6D001FFA7B /* DenormalDisabler.h in Headers */, 22788 22779 A7C9ABF91357A3BF00F5503F /* DetailsMarkerControl.h in Headers */, 22789 CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */,22790 CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */,22791 22780 31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */, 22792 22781 31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */, … … 26347 26336 93309DE0099E64920056E581 /* DeleteSelectionCommand.cpp in Sources */, 26348 26337 A7C9ABF81357A3BF00F5503F /* DetailsMarkerControl.cpp in Sources */, 26349 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */,26350 26338 31FB1A58120A5D0600DC02A0 /* DeviceMotionController.cpp in Sources */, 26351 26339 31FB1A5A120A5D0600DC02A0 /* DeviceMotionData.cpp in Sources */, -
trunk/Source/WebCore/dom/DeviceOrientationClient.h
r133016 r133028 1 1 /* 2 2 * Copyright 2010, The Android Open Source Project 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved.4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 28 27 #define DeviceOrientationClient_h 29 28 30 #include "DeviceClient.h"31 32 29 namespace WebCore { 33 30 … … 36 33 class Page; 37 34 38 class DeviceOrientationClient : public DeviceClient{35 class DeviceOrientationClient { 39 36 public: 40 37 virtual ~DeviceOrientationClient() {} 41 38 virtual void setController(DeviceOrientationController*) = 0; 39 virtual void startUpdating() = 0; 40 virtual void stopUpdating() = 0; 42 41 virtual DeviceOrientationData* lastOrientation() const = 0; 43 42 virtual void deviceOrientationControllerDestroyed() = 0; -
trunk/Source/WebCore/dom/DeviceOrientationController.cpp
r133016 r133028 1 1 /* 2 2 * Copyright 2010, The Android Open Source Project 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved.4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 36 35 37 36 DeviceOrientationController::DeviceOrientationController(Page* page, DeviceOrientationClient* client) 38 : DeviceController(client)37 : m_client(client) 39 38 , m_page(page) 39 , m_timer(this, &DeviceOrientationController::timerFired) 40 40 { 41 41 ASSERT(m_client); 42 deviceOrientationClient()->setController(this); 42 m_client->setController(this); 43 } 44 45 DeviceOrientationController::~DeviceOrientationController() 46 { 47 m_client->deviceOrientationControllerDestroyed(); 43 48 } 44 49 … … 48 53 } 49 54 55 void DeviceOrientationController::timerFired(Timer<DeviceOrientationController>* timer) 56 { 57 ASSERT_UNUSED(timer, timer == &m_timer); 58 ASSERT(m_client->lastOrientation()); 59 60 RefPtr<DeviceOrientationData> orientation = m_client->lastOrientation(); 61 RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation.get()); 62 63 Vector<RefPtr<DOMWindow> > listenersVector; 64 copyToVector(m_newListeners, listenersVector); 65 m_newListeners.clear(); 66 for (size_t i = 0; i < listenersVector.size(); ++i) 67 listenersVector[i]->dispatchEvent(event); 68 } 69 70 void DeviceOrientationController::addListener(DOMWindow* window) 71 { 72 // If the client already has an orientation, we should fire an event with that 73 // orientation. The event is fired asynchronously, but without 74 // waiting for the client to get a new orientation. 75 if (m_client->lastOrientation()) { 76 m_newListeners.add(window); 77 if (!m_timer.isActive()) 78 m_timer.startOneShot(0); 79 } 80 81 // The client must not call back synchronously. 82 bool wasEmpty = m_listeners.isEmpty(); 83 m_listeners.add(window); 84 if (wasEmpty) 85 m_client->startUpdating(); 86 } 87 88 void DeviceOrientationController::removeListener(DOMWindow* window) 89 { 90 m_listeners.remove(window); 91 m_suspendedListeners.remove(window); 92 m_newListeners.remove(window); 93 if (m_listeners.isEmpty()) 94 m_client->stopUpdating(); 95 } 96 97 void DeviceOrientationController::removeAllListeners(DOMWindow* window) 98 { 99 // May be called with a DOMWindow that's not a listener. 100 if (!m_listeners.contains(window)) 101 return; 102 103 m_listeners.removeAll(window); 104 m_suspendedListeners.removeAll(window); 105 m_newListeners.remove(window); 106 if (m_listeners.isEmpty()) 107 m_client->stopUpdating(); 108 } 109 110 void DeviceOrientationController::suspendEventsForAllListeners(DOMWindow* window) 111 { 112 if (!m_listeners.contains(window)) 113 return; 114 115 int count = m_listeners.count(window); 116 removeAllListeners(window); 117 while (count--) 118 m_suspendedListeners.add(window); 119 } 120 121 void DeviceOrientationController::resumeEventsForAllListeners(DOMWindow* window) 122 { 123 if (!m_suspendedListeners.contains(window)) 124 return; 125 126 int count = m_suspendedListeners.count(window); 127 m_suspendedListeners.removeAll(window); 128 while (count--) 129 addListener(window); 130 } 131 50 132 void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientationData* orientation) 51 133 { 52 dispatchDeviceEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation)); 53 } 54 55 DeviceOrientationClient* DeviceOrientationController::deviceOrientationClient() 56 { 57 return static_cast<DeviceOrientationClient*>(m_client); 58 } 59 60 bool DeviceOrientationController::hasLastData() 61 { 62 return deviceOrientationClient()->lastOrientation(); 63 } 64 65 PassRefPtr<Event> DeviceOrientationController::getLastEvent() 66 { 67 return DeviceOrientationEvent::create(eventNames().deviceorientationEvent, deviceOrientationClient()->lastOrientation()); 134 orientation = InspectorInstrumentation::overrideDeviceOrientation(m_page, orientation); 135 RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation); 136 Vector<RefPtr<DOMWindow> > listenersVector; 137 copyToVector(m_listeners, listenersVector); 138 for (size_t i = 0; i < listenersVector.size(); ++i) 139 listenersVector[i]->dispatchEvent(event); 68 140 } 69 141 … … 72 144 DEFINE_STATIC_LOCAL(AtomicString, name, ("DeviceOrientationController")); 73 145 return name; 74 }75 76 DeviceOrientationController* DeviceOrientationController::from(Page* page)77 {78 return static_cast<DeviceOrientationController*>(Supplement<Page>::from(page, supplementName()));79 146 } 80 147 -
trunk/Source/WebCore/dom/DeviceOrientationController.h
r133016 r133028 1 1 /* 2 2 * Copyright 2010, The Android Open Source Project 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved.4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 28 27 #define DeviceOrientationController_h 29 28 30 #include "DeviceController.h" 29 #include "DOMWindow.h" 30 #include "Page.h" 31 #include "Timer.h" 32 31 33 #include <wtf/HashCountedSet.h> 32 34 33 35 namespace WebCore { 34 36 37 class DeviceOrientationData; 35 38 class DeviceOrientationClient; 36 class DeviceOrientationData;37 39 38 class DeviceOrientationController : public DeviceController{40 class DeviceOrientationController : public Supplement<Page> { 39 41 public: 40 ~DeviceOrientationController() { };42 ~DeviceOrientationController(); 41 43 42 44 static PassOwnPtr<DeviceOrientationController> create(Page*, DeviceOrientationClient*); 43 45 46 void addListener(DOMWindow*); 47 void removeListener(DOMWindow*); 48 void removeAllListeners(DOMWindow*); 49 50 void suspendEventsForAllListeners(DOMWindow*); 51 void resumeEventsForAllListeners(DOMWindow*); 52 44 53 void didChangeDeviceOrientation(DeviceOrientationData*); 45 DeviceOrientationClient* deviceOrientationClient();46 54 47 virtual bool hasLastData() OVERRIDE; 48 virtual PassRefPtr<Event> getLastEvent() OVERRIDE; 55 bool isActive() { return !m_listeners.isEmpty(); } 56 57 DeviceOrientationClient* client() const { return m_client; } 49 58 50 59 static const AtomicString& supplementName(); 51 static DeviceOrientationController* from(Page* );60 static DeviceOrientationController* from(Page* page) { return static_cast<DeviceOrientationController*>(Supplement<Page>::from(page, supplementName())); } 52 61 static bool isActiveAt(Page*); 53 62 54 63 private: 55 DeviceOrientationController(Page*, DeviceOrientationClient*);64 explicit DeviceOrientationController(Page*, DeviceOrientationClient*); 56 65 66 void timerFired(Timer<DeviceOrientationController>*); 67 68 DeviceOrientationClient* m_client; 57 69 Page* m_page; 70 typedef HashCountedSet<RefPtr<DOMWindow> > ListenersCountedSet; 71 ListenersCountedSet m_listeners; 72 ListenersCountedSet m_suspendedListeners; 73 typedef HashSet<RefPtr<DOMWindow> > ListenersSet; 74 ListenersSet m_newListeners; 75 Timer<DeviceOrientationController> m_timer; 58 76 }; 59 77 -
trunk/Source/WebCore/dom/Document.cpp
r133019 r133028 2183 2183 if (DeviceMotionController* controller = DeviceMotionController::from(page())) 2184 2184 controller->suspendEventsForAllListeners(domWindow()); 2185 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 2186 controller->suspendEventsForAllListeners(domWindow()); 2187 2185 2188 #endif 2186 2189 } … … 2195 2198 2196 2199 if (DeviceMotionController* controller = DeviceMotionController::from(page())) 2200 controller->resumeEventsForAllListeners(domWindow()); 2201 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 2197 2202 controller->resumeEventsForAllListeners(domWindow()); 2198 2203 #endif -
trunk/Source/WebCore/loader/EmptyClients.h
r133016 r133028 574 574 }; 575 575 576 class EmptyDeviceClient : public DeviceClient {577 public:578 virtual void startUpdating() OVERRIDE { }579 virtual void stopUpdating() OVERRIDE { }580 };581 582 576 class EmptyDeviceMotionClient : public DeviceMotionClient { 583 577 public: … … 592 586 public: 593 587 virtual void setController(DeviceOrientationController*) { } 588 virtual void startUpdating() { } 589 virtual void stopUpdating() { } 594 590 virtual DeviceOrientationData* lastOrientation() const { return 0; } 595 591 virtual void deviceOrientationControllerDestroyed() { } -
trunk/Source/WebCore/page/DOMWindow.cpp
r133016 r133028 1602 1602 } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) { 1603 1603 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1604 controller->add DeviceEventListener(this);1604 controller->addListener(this); 1605 1605 } 1606 1606 #endif … … 1631 1631 } else if (eventType == eventNames().deviceorientationEvent) { 1632 1632 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1633 controller->remove DeviceEventListener(this);1633 controller->removeListener(this); 1634 1634 } 1635 1635 #endif … … 1688 1688 controller->removeAllListeners(this); 1689 1689 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1690 controller->removeAll DeviceEventListeners(this);1690 controller->removeAllListeners(this); 1691 1691 #endif 1692 1692 -
trunk/Source/WebKit/qt/ChangeLog
r133016 r133028 1 2012-10-31 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r133016. 4 http://trac.webkit.org/changeset/133016 5 https://bugs.webkit.org/show_bug.cgi?id=100856 6 7 broke compile-webkit on several bots (Requested by podivilov 8 on #webkit). 9 10 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 11 (DumpRenderTreeSupportQt::setMockDeviceOrientation): 12 1 13 2012-10-31 Kihong Kwon <kihong.kwon@samsung.com> 2 14 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r133016 r133028 714 714 #if ENABLE(DEVICE_ORIENTATION) 715 715 Page* corePage = QWebPagePrivate::core(page); 716 DeviceOrientationClientMock* mockClient = toDeviceOrientationClientMock(DeviceOrientationController::from(corePage)-> deviceOrientationClient());716 DeviceOrientationClientMock* mockClient = toDeviceOrientationClientMock(DeviceOrientationController::from(corePage)->client()); 717 717 mockClient->setOrientation(DeviceOrientationData::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)); 718 718 #endif
Note: See TracChangeset
for help on using the changeset viewer.