Changeset 122197 in webkit
- Timestamp:
- Jul 9, 2012 11:42:40 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 6 edited
- 1 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122196 r122197 1 2012-07-09 Christophe Dumez <christophe.dumez@intel.com> 2 3 [EFL] Battery status code needs refactoring to be reused in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=90760 5 6 Reviewed by Hajime Morita. 7 8 Rename BatteryClientEfl to BatteryProviderEfl and remove dependency 9 on BatteryController by introducing the BatteryProviderEflClient 10 interface. This will allow reusing the BatteryProviderEfl class 11 in WebKit2. 12 13 No new tests. Already tested by batterystatus/*. 14 15 * PlatformEfl.cmake: 16 * platform/efl/BatteryProviderEfl.cpp: Renamed from Source/WebCore/platform/efl/BatteryClientEfl.cpp. 17 (WebCore): 18 (WebCore::BatteryProviderEfl::BatteryProviderEfl): 19 (WebCore::BatteryProviderEfl::batteryStatus): 20 (WebCore::BatteryProviderEfl::startUpdating): 21 (WebCore::BatteryProviderEfl::stopUpdating): 22 (WebCore::BatteryProviderEfl::setBatteryStatus): 23 (WebCore::BatteryProviderEfl::timerFired): 24 (WebCore::BatteryProviderEfl::getBatteryStatus): 25 (WebCore::BatteryProviderEfl::setBatteryClient): 26 * platform/efl/BatteryProviderEfl.h: Copied from Source/WebCore/platform/efl/BatteryClientEfl.h. 27 (WebCore): 28 (BatteryProviderEfl): 29 (WebCore::BatteryProviderEfl::~BatteryProviderEfl): 30 * platform/efl/BatteryProviderEflClient.h: Added. 31 (WebCore): 32 (BatteryProviderEflClient): 33 1 34 2012-07-09 Hayato Ito <hayato@chromium.org> 2 35 -
trunk/Source/WebCore/PlatformEfl.cmake
r121828 r122197 24 24 page/efl/EventHandlerEfl.cpp 25 25 platform/Cursor.cpp 26 platform/efl/Battery ClientEfl.cpp26 platform/efl/BatteryProviderEfl.cpp 27 27 platform/efl/ClipboardEfl.cpp 28 28 platform/efl/ColorChooserEfl.cpp -
trunk/Source/WebCore/platform/efl/BatteryProviderEfl.cpp
r122196 r122197 19 19 20 20 #include "config.h" 21 #include "Battery ClientEfl.h"21 #include "BatteryProviderEfl.h" 22 22 23 23 #if ENABLE(BATTERY_STATUS) 24 24 25 #include "Battery Controller.h"25 #include "BatteryProviderEflClient.h" 26 26 #include "EventNames.h" 27 27 #include <E_Ukit.h> … … 30 30 namespace WebCore { 31 31 32 Battery ClientEfl::BatteryClientEfl()33 : m_c ontroller(0)34 , m_timer(this, &Battery ClientEfl::timerFired)32 BatteryProviderEfl::BatteryProviderEfl(BatteryProviderEflClient* client) 33 : m_client(client) 34 , m_timer(this, &BatteryProviderEfl::timerFired) 35 35 , m_batteryStatusRefreshInterval(1.0) 36 36 { 37 37 } 38 38 39 BatteryStatus* Battery ClientEfl::batteryStatus() const39 BatteryStatus* BatteryProviderEfl::batteryStatus() const 40 40 { 41 41 return m_batteryStatus.get(); 42 42 } 43 43 44 void BatteryClientEfl::setController(BatteryController* controller) 45 { 46 m_controller = controller; 47 } 48 49 void BatteryClientEfl::startUpdating() 44 void BatteryProviderEfl::startUpdating() 50 45 { 51 46 if (m_timer.isActive()) … … 63 58 } 64 59 65 void Battery ClientEfl::stopUpdating()60 void BatteryProviderEfl::stopUpdating() 66 61 { 67 62 m_timer.stop(); … … 70 65 } 71 66 72 void Battery ClientEfl::batteryControllerDestroyed()67 void BatteryProviderEfl::setBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus> batteryStatus) 73 68 { 74 delete this; 69 m_batteryStatus = batteryStatus; 70 m_client->didChangeBatteryStatus(eventType, m_batteryStatus); 75 71 } 76 72 77 void BatteryClientEfl::setBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus> batteryStatus) 78 { 79 m_batteryStatus = batteryStatus; 80 m_controller->didChangeBatteryStatus(eventType, m_batteryStatus); 81 } 82 83 void BatteryClientEfl::timerFired(Timer<BatteryClientEfl>* timer) 73 void BatteryProviderEfl::timerFired(Timer<BatteryProviderEfl>* timer) 84 74 { 85 75 ASSERT_UNUSED(timer, timer == &m_timer); … … 89 79 } 90 80 91 void Battery ClientEfl::getBatteryStatus(void* data, void* replyData, DBusError* dBusError)81 void BatteryProviderEfl::getBatteryStatus(void* data, void* replyData, DBusError* dBusError) 92 82 { 93 83 E_Ukit_Get_All_Devices_Return* eukitDeviceNames = static_cast<E_Ukit_Get_All_Devices_Return*>(replyData); … … 104 94 } 105 95 106 void Battery ClientEfl::setBatteryClient(void* data, void* replyData, DBusError* dBusError)96 void BatteryProviderEfl::setBatteryClient(void* data, void* replyData, DBusError* dBusError) 107 97 { 108 98 E_Ukit_Get_All_Properties_Return* eukitPropertyNames = static_cast<E_Ukit_Get_All_Properties_Return*>(replyData); … … 120 110 return; 121 111 122 Battery ClientEfl* client = static_cast<BatteryClientEfl*>(data);112 BatteryProviderEfl* client = static_cast<BatteryProviderEfl*>(data); 123 113 BatteryStatus* clientBatteryStatus = client->batteryStatus(); 124 114 bool charging = false; -
trunk/Source/WebCore/platform/efl/BatteryProviderEfl.h
r122196 r122197 18 18 */ 19 19 20 #ifndef Battery ClientEfl_h21 #define Battery ClientEfl_h20 #ifndef BatteryProviderEfl_h 21 #define BatteryProviderEfl_h 22 22 23 23 #if ENABLE(BATTERY_STATUS) … … 32 32 namespace WebCore { 33 33 34 class Battery Controller;34 class BatteryProviderEflClient; 35 35 36 class Battery ClientEfl : public BatteryClient{36 class BatteryProviderEfl { 37 37 public: 38 Battery ClientEfl();39 ~Battery ClientEfl() { };38 BatteryProviderEfl(BatteryProviderEflClient*); 39 ~BatteryProviderEfl() { } 40 40 41 virtual void setController(BatteryController*);42 41 virtual void startUpdating(); 43 42 virtual void stopUpdating(); 44 virtual void batteryControllerDestroyed();45 43 46 44 void setBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus>); … … 48 46 49 47 private: 50 void timerFired(Timer<Battery ClientEfl>*);48 void timerFired(Timer<BatteryProviderEfl>*); 51 49 static void getBatteryStatus(void* data, void* replyData, DBusError*); 52 50 static void setBatteryClient(void* data, void* replyData, DBusError*); 53 51 54 Battery Controller* m_controller;55 Timer<Battery ClientEfl> m_timer;52 BatteryProviderEflClient* m_client; 53 Timer<BatteryProviderEfl> m_timer; 56 54 RefPtr<BatteryStatus> m_batteryStatus; 57 55 const double m_batteryStatusRefreshInterval; … … 61 59 62 60 #endif // ENABLE(BATTERY_STATUS) 63 #endif // Battery ClientEfl_h61 #endif // BatteryProviderEfl_h 64 62 -
trunk/Source/WebKit/ChangeLog
r122073 r122197 1 2012-07-09 Christophe Dumez <christophe.dumez@intel.com> 2 3 [EFL] Battery status code needs refactoring to be reused in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=90760 5 6 Reviewed by Hajime Morita. 7 8 Add BatteryClientEfl to PlatformEfl.cmake. 9 10 * PlatformEfl.cmake: 11 1 12 2012-07-08 Kihong Kwon <kihong.kwon@samsung.com> 2 13 -
trunk/Source/WebKit/PlatformEfl.cmake
r122073 r122197 92 92 LIST(APPEND WebKit_SOURCES 93 93 efl/WebCoreSupport/AssertMatchingEnums.cpp 94 efl/WebCoreSupport/BatteryClientEfl.cpp 94 95 efl/WebCoreSupport/ChromeClientEfl.cpp 95 96 efl/WebCoreSupport/DeviceOrientationClientEfl.cpp -
trunk/Source/WebKit/efl/ChangeLog
r122159 r122197 1 2012-07-09 Christophe Dumez <christophe.dumez@intel.com> 2 3 [EFL] Battery status code needs refactoring to be reused in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=90760 5 6 Reviewed by Hajime Morita. 7 8 Add BatteryClientEfl to WebKit, which uses BatteryProviderEfl from 9 WebCore internally. 10 11 * WebCoreSupport/BatteryClientEfl.cpp: Added. 12 (BatteryClientEfl::BatteryClientEfl): 13 (BatteryClientEfl::setController): 14 (BatteryClientEfl::startUpdating): 15 (BatteryClientEfl::stopUpdating): 16 (BatteryClientEfl::batteryControllerDestroyed): 17 (BatteryClientEfl::didChangeBatteryStatus): 18 * WebCoreSupport/BatteryClientEfl.h: Renamed from Source/WebCore/platform/efl/BatteryClientEfl.h. 19 (WebCore): 20 (BatteryClientEfl): 21 (BatteryClientEfl::~BatteryClientEfl): 22 * ewk/ewk_view.cpp: 23 (_ewk_view_priv_new): 24 1 25 2012-07-09 Adam Klein <adamk@chromium.org> 2 26 -
trunk/Source/WebKit/efl/WebCoreSupport/BatteryClientEfl.h
r122196 r122197 1 1 /* 2 * Copyright (C) 2012 Samsung Electronics 2 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2012 Intel Corporation. All rights reserved. 3 4 * 4 5 * This library is free software; you can redistribute it and/or … … 24 25 25 26 #include "BatteryClient.h" 27 #include "BatteryProviderEfl.h" 28 #include "BatteryProviderEflClient.h" 26 29 #include "BatteryStatus.h" 27 #include "Timer.h" 28 #include <wtf/text/AtomicString.h> 29 30 typedef struct DBusError DBusError; 30 #include <wtf/PassRefPtr.h> 31 31 32 32 namespace WebCore { 33 class BatteryController; 34 } 33 35 34 class BatteryController; 35 36 class BatteryClientEfl : public BatteryClient { 36 class BatteryClientEfl : public WebCore::BatteryClient, public WebCore::BatteryProviderEflClient { 37 37 public: 38 38 BatteryClientEfl(); 39 ~BatteryClientEfl() { };39 virtual ~BatteryClientEfl() { } 40 40 41 virtual void setController(BatteryController*); 41 // BatteryClient interface. 42 virtual void setController(WebCore::BatteryController*); 42 43 virtual void startUpdating(); 43 44 virtual void stopUpdating(); 44 45 virtual void batteryControllerDestroyed(); 45 46 46 void setBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus>); 47 BatteryStatus* batteryStatus() const; 47 private: 48 // BatteryProviderEflClient interface. 49 virtual void didChangeBatteryStatus(const AtomicString& eventType, PassRefPtr<WebCore::BatteryStatus>); 48 50 49 private: 50 void timerFired(Timer<BatteryClientEfl>*); 51 static void getBatteryStatus(void* data, void* replyData, DBusError*); 52 static void setBatteryClient(void* data, void* replyData, DBusError*); 53 54 BatteryController* m_controller; 55 Timer<BatteryClientEfl> m_timer; 56 RefPtr<BatteryStatus> m_batteryStatus; 57 const double m_batteryStatusRefreshInterval; 51 WebCore::BatteryController* m_controller; 52 WebCore::BatteryProviderEfl m_provider; 58 53 }; 59 54 60 } 55 #endif // ENABLE(BATTERY_STATUS) 61 56 62 #endif // ENABLE(BATTERY_STATUS)63 57 #endif // BatteryClientEfl_h 64 -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r121947 r122197 755 755 756 756 #if ENABLE(BATTERY_STATUS) 757 WebCore::provideBatteryTo(priv->page.get(), new WebCore::BatteryClientEfl);757 WebCore::provideBatteryTo(priv->page.get(), new BatteryClientEfl); 758 758 #endif 759 759
Note: See TracChangeset
for help on using the changeset viewer.