Remove ScriptExecutionContext from NavigatorBattery.idl

https://bugs.webkit.org/show_bug.cgi?id=82556

Reviewed by Adam Barth.

As Bug 73528 comment #71, NavigatorBattery.idl doesn't need to have ScriptExecutionContext.
Document can be used instead of ScriptExecutionContext.

Tests: batterystatus/add-listener-from-callback.html
       batterystatus/basic-all-types-of-events.html
       batterystatus/basic-operation.html
       batterystatus/event-after-navigation.html
       batterystatus/multiple-frames.html
       batterystatus/updates.html
       batterystatus/window-property.html

* Modules/battery/BatteryManager.cpp:
(WebCore::BatteryManager::create):
(WebCore::BatteryManager::BatteryManager):
* Modules/battery/BatteryManager.h:
(BatteryManager):
* Modules/battery/NavigatorBattery.cpp:
(WebCore::NavigatorBattery::webkitBattery):
* Modules/battery/NavigatorBattery.h:
(NavigatorBattery):
* Modules/battery/NavigatorBattery.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d02147ea
2012-03-28 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Remove ScriptExecutionContext from NavigatorBattery.idl
https://bugs.webkit.org/show_bug.cgi?id=82556
Reviewed by Adam Barth.
As Bug 73528 comment #71, NavigatorBattery.idl doesn't need to have ScriptExecutionContext.
Document can be used instead of ScriptExecutionContext.
Tests: batterystatus/add-listener-from-callback.html
batterystatus/basic-all-types-of-events.html
batterystatus/basic-operation.html
batterystatus/event-after-navigation.html
batterystatus/multiple-frames.html
batterystatus/updates.html
batterystatus/window-property.html
* Modules/battery/BatteryManager.cpp:
(WebCore::BatteryManager::create):
(WebCore::BatteryManager::BatteryManager):
* Modules/battery/BatteryManager.h:
(BatteryManager):
* Modules/battery/NavigatorBattery.cpp:
(WebCore::NavigatorBattery::webkitBattery):
* Modules/battery/NavigatorBattery.h:
(NavigatorBattery):
* Modules/battery/NavigatorBattery.idl:
2012-03-28 Jason Liu <jason.liu@torchmobile.com.cn>
[BlackBerry]Missing cookies from HTTP response header in Network tab of Web Inspector.
......@@ -31,9 +31,9 @@
namespace WebCore {
PassRefPtr<BatteryManager> BatteryManager::create(ScriptExecutionContext* context, Navigator* navigator)
PassRefPtr<BatteryManager> BatteryManager::create(Navigator* navigator)
{
RefPtr<BatteryManager> batteryManager(adoptRef(new BatteryManager(context, navigator)));
RefPtr<BatteryManager> batteryManager(adoptRef(new BatteryManager(navigator)));
batteryManager->suspendIfNeeded();
return batteryManager.release();
}
......@@ -42,8 +42,8 @@ BatteryManager::~BatteryManager()
{
}
BatteryManager::BatteryManager(ScriptExecutionContext* context, Navigator* navigator)
: ActiveDOMObject(context, this)
BatteryManager::BatteryManager(Navigator* navigator)
: ActiveDOMObject(navigator->frame()->document(), this)
, m_batteryController(BatteryController::from(navigator->frame()->page()))
, m_batteryStatus(0)
{
......
......@@ -35,7 +35,7 @@ class ScriptExecutionContext;
class BatteryManager : public ActiveDOMObject, public RefCounted<BatteryManager>, public EventTarget {
public:
virtual ~BatteryManager();
static PassRefPtr<BatteryManager> create(ScriptExecutionContext*, Navigator*);
static PassRefPtr<BatteryManager> create(Navigator*);
// EventTarget implementation.
virtual const WTF::AtomicString& interfaceName() const { return eventNames().interfaceForBatteryManager; }
......@@ -68,7 +68,7 @@ protected:
virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }
private:
BatteryManager(ScriptExecutionContext*, Navigator*);
explicit BatteryManager(Navigator*);
// EventTarget implementation.
virtual void refEventTarget() { ref(); }
......
......@@ -37,14 +37,14 @@ NavigatorBattery::~NavigatorBattery()
{
}
BatteryManager* NavigatorBattery::webkitBattery(ScriptExecutionContext* context, Navigator* navigator)
BatteryManager* NavigatorBattery::webkitBattery(Navigator* navigator)
{
if (!navigator->frame())
return 0;
NavigatorBattery* navigatorBattery = NavigatorBattery::from(navigator);
if (!navigatorBattery->m_batteryManager)
navigatorBattery->m_batteryManager = BatteryManager::create(context, navigator);
navigatorBattery->m_batteryManager = BatteryManager::create(navigator);
return navigatorBattery->m_batteryManager.get();
}
......
......@@ -36,7 +36,7 @@ public:
static NavigatorBattery* from(Navigator*);
static BatteryManager* webkitBattery(ScriptExecutionContext*, Navigator*);
static BatteryManager* webkitBattery(Navigator*);
BatteryManager* batteryManager();
private:
......
......@@ -20,7 +20,6 @@
module window {
interface [
CallWith=ScriptExecutionContext,
Conditional=BATTERY_STATUS,
Supplemental=Navigator
] NavigatorBattery {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment