Changeset 133167 in webkit
- Timestamp:
- Nov 1, 2012 7:26:09 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r133143 r133167 1712 1712 page/ContextMenuController.cpp 1713 1713 page/Crypto.cpp 1714 page/DeviceController.cpp1715 1714 page/DiagnosticLoggingKeys.cpp 1716 1715 page/DOMSecurityPolicy.cpp -
trunk/Source/WebCore/ChangeLog
r133162 r133167 1 2012-11-01 Stephen White <senorblanco@chromium.org> 2 3 Unreviewed, rolling out r133143. 4 http://trac.webkit.org/changeset/133143 5 https://bugs.webkit.org/show_bug.cgi?id=96894 6 7 Causing content_browsertests failures 8 9 * CMakeLists.txt: 10 * GNUmakefile.list.am: 11 * Target.pri: 12 * WebCore.gypi: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * dom/DeviceOrientationClient.h: 16 (DeviceOrientationClient): 17 * dom/DeviceOrientationController.cpp: 18 (WebCore::DeviceOrientationController::DeviceOrientationController): 19 (WebCore): 20 (WebCore::DeviceOrientationController::~DeviceOrientationController): 21 (WebCore::DeviceOrientationController::timerFired): 22 (WebCore::DeviceOrientationController::addListener): 23 (WebCore::DeviceOrientationController::removeListener): 24 (WebCore::DeviceOrientationController::removeAllListeners): 25 (WebCore::DeviceOrientationController::suspendEventsForAllListeners): 26 (WebCore::DeviceOrientationController::resumeEventsForAllListeners): 27 (WebCore::DeviceOrientationController::didChangeDeviceOrientation): 28 (WebCore::DeviceOrientationController::supplementName): 29 * dom/DeviceOrientationController.h: 30 (WebCore): 31 (DeviceOrientationController): 32 (WebCore::DeviceOrientationController::isActive): 33 (WebCore::DeviceOrientationController::client): 34 (WebCore::DeviceOrientationController::from): 35 * dom/Document.cpp: 36 (WebCore::Document::suspendActiveDOMObjects): 37 (WebCore::Document::resumeActiveDOMObjects): 38 * loader/EmptyClients.h: 39 (WebCore::EmptyDeviceOrientationClient::startUpdating): 40 (WebCore::EmptyDeviceOrientationClient::stopUpdating): 41 * page/DOMWindow.cpp: 42 (WebCore::DOMWindow::addEventListener): 43 (WebCore::DOMWindow::removeEventListener): 44 (WebCore::DOMWindow::removeAllEventListeners): 45 * page/DeviceClient.h: Removed. 46 * page/DeviceController.cpp: Removed. 47 * page/DeviceController.h: Removed. 48 1 49 2012-11-01 Kondapally Kalyan <kalyan.kondapally@intel.com> 2 50 -
trunk/Source/WebCore/GNUmakefile.list.am
r133143 r133167 4010 4010 Source/WebCore/page/Crypto.cpp \ 4011 4011 Source/WebCore/page/Crypto.h \ 4012 Source/WebCore/page/DeviceClient.h \4013 Source/WebCore/page/DeviceController.cpp \4014 Source/WebCore/page/DeviceController.h \4015 4012 Source/WebCore/page/DiagnosticLoggingKeys.cpp \ 4016 4013 Source/WebCore/page/DiagnosticLoggingKeys.h \ -
trunk/Source/WebCore/Target.pri
r133143 r133167 873 873 page/ContextMenuController.cpp \ 874 874 page/Crypto.cpp \ 875 page/DeviceController.cpp \876 875 page/DiagnosticLoggingKeys.cpp \ 877 876 page/DOMSelection.cpp \ … … 2001 2000 page/ContextMenuProvider.h \ 2002 2001 page/Coordinates.h \ 2003 page/DeviceClient.h \2004 page/DeviceController.h \2005 2002 page/DiagnosticLoggingKeys.h \ 2006 2003 page/DOMSelection.h \ -
trunk/Source/WebCore/WebCore.gypi
r133143 r133167 3116 3116 'page/Crypto.cpp', 3117 3117 'page/Crypto.h', 3118 'page/DeviceClient.h',3119 'page/DeviceController.cpp',3120 'page/DeviceController.h',3121 3118 'page/DiagnosticLoggingKeys.cpp', 3122 3119 'page/DiagnosticLoggingKeys.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r133143 r133167 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
r133143 r133167 5894 5894 CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; }; 5895 5895 CAE9F910146441F000C245B1 /* CSSVariableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B1 /* CSSVariableValue.h */; }; 5896 CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };5897 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };5898 CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; };5899 5896 CD127DED14F3097D00E84779 /* WebCoreFullScreenWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */; }; 5900 5897 CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 13274 13271 CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; }; 13275 13272 CAE9F90E146441F000C245B1 /* CSSVariableValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableValue.h; sourceTree = "<group>"; }; 13276 CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };13277 CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };13278 CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; };13279 13273 CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWindow.h; sourceTree = "<group>"; }; 13280 13274 CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWindow.mm; sourceTree = "<group>"; }; … … 15865 15859 975CA288130365F800E99AD9 /* Crypto.h */, 15866 15860 975CA289130365F800E99AD9 /* Crypto.idl */, 15867 CCC2B51015F613060048CDD6 /* DeviceClient.h */,15868 CCC2B51115F613060048CDD6 /* DeviceController.cpp */,15869 CCC2B51215F613060048CDD6 /* DeviceController.h */,15870 15861 CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */, 15871 15862 CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */, … … 22793 22784 FD1660A513787C6D001FFA7B /* DenormalDisabler.h in Headers */, 22794 22785 A7C9ABF91357A3BF00F5503F /* DetailsMarkerControl.h in Headers */, 22795 CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */,22796 CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */,22797 22786 31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */, 22798 22787 31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */, … … 26354 26343 93309DE0099E64920056E581 /* DeleteSelectionCommand.cpp in Sources */, 26355 26344 A7C9ABF81357A3BF00F5503F /* DetailsMarkerControl.cpp in Sources */, 26356 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */,26357 26345 31FB1A58120A5D0600DC02A0 /* DeviceMotionController.cpp in Sources */, 26358 26346 31FB1A5A120A5D0600DC02A0 /* DeviceMotionData.cpp in Sources */, -
trunk/Source/WebCore/dom/DeviceOrientationClient.h
r133143 r133167 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
r133143 r133167 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 134 orientation = InspectorInstrumentation::overrideDeviceOrientation(m_page, orientation); 53 dispatchDeviceEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation)); 54 } 55 56 DeviceOrientationClient* DeviceOrientationController::deviceOrientationClient() 57 { 58 return static_cast<DeviceOrientationClient*>(m_client); 59 } 60 61 bool DeviceOrientationController::hasLastData() 62 { 63 return deviceOrientationClient()->lastOrientation(); 64 } 65 66 PassRefPtr<Event> DeviceOrientationController::getLastEvent() 67 { 68 return DeviceOrientationEvent::create(eventNames().deviceorientationEvent, deviceOrientationClient()->lastOrientation()); 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); 69 140 } 70 141 … … 73 144 DEFINE_STATIC_LOCAL(AtomicString, name, ("DeviceOrientationController")); 74 145 return name; 75 }76 77 DeviceOrientationController* DeviceOrientationController::from(Page* page)78 {79 return static_cast<DeviceOrientationController*>(Supplement<Page>::from(page, supplementName()));80 146 } 81 147 -
trunk/Source/WebCore/dom/DeviceOrientationController.h
r133143 r133167 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
r133143 r133167 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
r133143 r133167 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
r133143 r133167 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
r133143 r133167 1 2012-11-01 Stephen White <senorblanco@chromium.org> 2 3 Unreviewed, rolling out r133143. 4 http://trac.webkit.org/changeset/133143 5 https://bugs.webkit.org/show_bug.cgi?id=96894 6 7 Causing content_browsertests failures 8 9 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 10 (DumpRenderTreeSupportQt::setMockDeviceOrientation): 11 1 12 2012-11-01 Kihong Kwon <kihong.kwon@samsung.com> 2 13 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r133143 r133167 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.