Changeset 160445 in webkit


Ignore:
Timestamp:
Dec 11, 2013 10:23:02 AM (10 years ago)
Author:
zandobersek@gmail.com
Message:

[GTK][WK2] Add the WebKitBatteryProvider class
https://bugs.webkit.org/show_bug.cgi?id=115720

Reviewed by Martin Robinson.

Source/WebKit2:

This patch adds the WebKitBatteryProvider class which sets up a BatteryProviderUPower instance,
controlling the provider's activity when instrumented to do so by the WebBatteryManagerProxy
and relaying the battery status updates from the battery provider to the battery manager.

  • GNUmakefile.list.am: Add the build targets for the new source files.
  • UIProcess/API/gtk/WebKitBatteryProvider.cpp: Added.

(toBatteryProvider): A helper inline method that casts the client info to the battery provider instance.
(startUpdatingCallback): Relays the instruction to the WebKitBattery instance.
(stopUpdatingCallback): Ditto.
(WebKitBatteryProvider::create):
(WebKitBatteryProvider::WebKitBatteryProvider): Set up a WKBatteryProvider and set it to the passed-in battery manager.
(WebKitBatteryProvider::~WebKitBatteryProvider): Force the BatteryProviderUPower to stop updating.
(WebKitBatteryProvider::startUpdating): Relays the instruction to the BatteryProviderUPower instance.
(WebKitBatteryProvider::stopUpdating): Ditto.
(WebKitBatteryProvider::notifyBatteryStatusUnavailable): Update the battery manager with the new status that
has the default values that are to be used when the implementation cannot determine the battery status (as per
the Battery Status API specification).
(WebKitBatteryProvider::notifyBatteryStatusUpdated): Update the battery status.

  • UIProcess/API/gtk/WebKitBatteryProvider.h: Added.

(WebKitBatteryProvider): Define the WebKitBatteryProvider reference-counted interface that also inherits from the
BatteryProviderUPowerClient interface.

  • UIProcess/API/gtk/WebKitWebContext.cpp:

(_WebKitWebContextPrivate): Add a WebKitBatteryProvider member variable to the struct.
(createDefaultWebContext): Create a new battery provider when initializing the default web context.

Tools:

  • gtk/generate-gtkdoc:

(get_webkit2_options): Ignore the WebKitBatteryProvider source files when generating the documentation.

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r160444 r160445  
     12013-12-11  José Dapena Paz  <jdapena@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK][WK2] Add the WebKitBatteryProvider class
     4        https://bugs.webkit.org/show_bug.cgi?id=115720
     5
     6        Reviewed by Martin Robinson.
     7
     8        This patch adds the WebKitBatteryProvider class which sets up a BatteryProviderUPower instance,
     9        controlling the provider's activity when instrumented to do so by the WebBatteryManagerProxy
     10        and relaying the battery status updates from the battery provider to the battery manager.
     11
     12        * GNUmakefile.list.am: Add the build targets for the new source files.
     13        * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Added.
     14        (toBatteryProvider): A helper inline method that casts the client info to the battery provider instance.
     15        (startUpdatingCallback): Relays the instruction to the WebKitBattery instance.
     16        (stopUpdatingCallback): Ditto.
     17        (WebKitBatteryProvider::create):
     18        (WebKitBatteryProvider::WebKitBatteryProvider): Set up a WKBatteryProvider and set it to the passed-in battery manager.
     19        (WebKitBatteryProvider::~WebKitBatteryProvider): Force the BatteryProviderUPower to stop updating.
     20        (WebKitBatteryProvider::startUpdating): Relays the instruction to the BatteryProviderUPower instance.
     21        (WebKitBatteryProvider::stopUpdating): Ditto.
     22        (WebKitBatteryProvider::notifyBatteryStatusUnavailable): Update the battery manager with the new status that
     23        has the default values that are to be used when the implementation cannot determine the battery status (as per
     24        the Battery Status API specification).
     25        (WebKitBatteryProvider::notifyBatteryStatusUpdated): Update the battery status.
     26        * UIProcess/API/gtk/WebKitBatteryProvider.h: Added.
     27        (WebKitBatteryProvider): Define the WebKitBatteryProvider reference-counted interface that also inherits from the
     28        BatteryProviderUPowerClient interface.
     29        * UIProcess/API/gtk/WebKitWebContext.cpp:
     30        (_WebKitWebContextPrivate): Add a WebKitBatteryProvider member variable to the struct.
     31        (createDefaultWebContext): Create a new battery provider when initializing the default web context.
     32
    1332013-12-11  José Dapena Paz  <jdapena@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
    234
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r160409 r160445  
    725725        Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp \
    726726        Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h \
     727        Source/WebKit2/UIProcess/API/gtk/WebKitBatteryProvider.cpp \
     728        Source/WebKit2/UIProcess/API/gtk/WebKitBatteryProvider.h \
    727729        Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.cpp \
    728730        Source/WebKit2/UIProcess/API/gtk/WebKitCertificateInfo.h \
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp

    r160358 r160445  
    2121#include "WebKitWebContext.h"
    2222
     23#include "WebBatteryManagerProxy.h"
    2324#include "WebCertificateInfo.h"
    2425#include "WebCookieManagerProxy.h"
    2526#include "WebGeolocationManagerProxy.h"
     27#include "WebKitBatteryProvider.h"
    2628#include "WebKitCertificateInfoPrivate.h"
    2729#include "WebKitCookieManagerPrivate.h"
     
    140142    RefPtr<WebKitGeolocationProvider> geolocationProvider;
    141143#endif
     144#if ENABLE(BATTERY_STATUS)
     145    RefPtr<WebKitBatteryProvider> batteryProvider;
     146#endif
    142147#if ENABLE(SPELLCHECK)
    143148    OwnPtr<WebKitTextChecker> textChecker;
     
    212217    priv->geolocationProvider = WebKitGeolocationProvider::create(priv->context->supplement<WebGeolocationManagerProxy>());
    213218#endif
     219#if ENABLE(BATTERY_STATUS)
     220    priv->batteryProvider = WebKitBatteryProvider::create(priv->context->supplement<WebBatteryManagerProxy>());
     221#endif
    214222#if ENABLE(SPELLCHECK)
    215223    priv->textChecker = WebKitTextChecker::create();
  • trunk/Tools/ChangeLog

    r160439 r160445  
     12013-12-11  José Dapena Paz  <jdapena@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK][WK2] Add the WebKitBatteryProvider class
     4        https://bugs.webkit.org/show_bug.cgi?id=115720
     5
     6        Reviewed by Martin Robinson.
     7
     8        * gtk/generate-gtkdoc:
     9        (get_webkit2_options): Ignore the WebKitBatteryProvider source files when generating the documentation.
     10
    1112013-12-11  Mark Rowe  <mrowe@apple.com>
    212
  • trunk/Tools/gtk/generate-gtkdoc

    r159614 r160445  
    105105                         glob.glob(injected_bundle_src_path('*Private.h')) + \
    106106                         glob.glob(src_path('*Client*')) + \
     107                         glob.glob(src_path('WebKitAuthenticationDialog.*')) + \
     108                         glob.glob(src_path('WebKitBatteryProvider.*')) + \
    107109                         glob.glob(src_path('WebKitGeolocationProvider.*')) + \
    108110                         glob.glob(src_path('WebKitTextChecker.*')) + \
    109                          glob.glob(src_path('WebKitAuthenticationDialog.*')) + \
    110111                         glob.glob(src_path('WebKitWebViewBaseAccessible.*')) + \
    111112                         glob.glob(src_path('WebViewBaseInputMethodFilter.*')) + \
Note: See TracChangeset for help on using the changeset viewer.