Changeset 121170 in webkit


Ignore:
Timestamp:
Jun 25, 2012 11:01:42 AM (12 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

[EFL] Implement Network Information API
https://bugs.webkit.org/show_bug.cgi?id=87067

Reviewed by Kenneth Rohde Christiansen.

.:

  • Source/cmake/FindEFL.cmake: Find eeze library in build system.

Source/WebKit:

  • PlatformEfl.cmake: Add dependency of eeze library.

Source/WebKit/efl:

Implement NetworkInfoClientEfl.cpp using eeze library. However, this patch only
supports this feature on ethernet interface.

  • WebCoreSupport/NetworkInfoClientEfl.cpp:

(WebCore):
(WebCore::NetworkInfoClientEfl::NetworkInfoClientEfl):
(WebCore::NetworkInfoClientEfl::startUpdating):
(WebCore::NetworkInfoClientEfl::stopUpdating):
(WebCore::NetworkInfoClientEfl::bandwidth):
(WebCore::NetworkInfoClientEfl::metered):

  • WebCoreSupport/NetworkInfoClientEfl.h:

(NetworkInfoClientEfl):

Tools:

  • efl/jhbuild.modules: Add eeze library dependency.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r121152 r121170  
     12012-06-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [EFL] Implement Network Information API
     4        https://bugs.webkit.org/show_bug.cgi?id=87067
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * Source/cmake/FindEFL.cmake: Find eeze library in build system.
     9
    1102012-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
    211
  • trunk/Source/WebKit/ChangeLog

    r121051 r121170  
     12012-06-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [EFL] Implement Network Information API
     4        https://bugs.webkit.org/show_bug.cgi?id=87067
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * PlatformEfl.cmake: Add dependency of eeze library.
     9
    1102012-06-22  Joshua Netterfield  <jnetterfield@rim.com>
    211
  • trunk/Source/WebKit/PlatformEfl.cmake

    r119374 r121170  
    6969
    7070IF (ENABLE_NETWORK_INFO)
     71  LIST(APPEND WebKit_LINK_FLAGS
     72    ${EEZE_LDFLAGS}
     73  )
    7174  LIST(APPEND WebKit_INCLUDE_DIRECTORIES
    7275    "${WEBCORE_DIR}/Modules/networkinfo"
     76     ${EEZE_INCLUDE_DIRS}
    7377  )
    7478  LIST(APPEND WebKit_SOURCES
    7579    efl/WebCoreSupport/NetworkInfoClientEfl.cpp
     80  )
     81  LIST(APPEND WebKit_LIBRARIES
     82    ${EEZE_LIBRARIES}
    7683  )
    7784ENDIF ()
  • trunk/Source/WebKit/efl/ChangeLog

    r121098 r121170  
     12012-06-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [EFL] Implement Network Information API
     4        https://bugs.webkit.org/show_bug.cgi?id=87067
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Implement NetworkInfoClientEfl.cpp using eeze library. However, this patch only
     9        supports this feature on ethernet interface.
     10
     11        * WebCoreSupport/NetworkInfoClientEfl.cpp:
     12        (WebCore):
     13        (WebCore::NetworkInfoClientEfl::NetworkInfoClientEfl):
     14        (WebCore::NetworkInfoClientEfl::startUpdating):
     15        (WebCore::NetworkInfoClientEfl::stopUpdating):
     16        (WebCore::NetworkInfoClientEfl::bandwidth):
     17        (WebCore::NetworkInfoClientEfl::metered):
     18        * WebCoreSupport/NetworkInfoClientEfl.h:
     19        (NetworkInfoClientEfl):
     20
    1212012-06-23  Sheriff Bot  <webkit.review.bot@gmail.com>
    222
  • trunk/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp

    r112815 r121170  
    3232#include "NetworkInfo.h"
    3333#include "NotImplemented.h"
     34
     35#include "ewk_private.h"
     36#include <Eeze.h>
     37#include <Eeze_Net.h>
    3438#include <wtf/text/CString.h>
    3539#include <wtf/text/WTFString.h>
    3640
    3741namespace WebCore {
     42
     43static const char* ethernetInterface = "eth0";
     44
    3845NetworkInfoClientEfl::NetworkInfoClientEfl()
    3946    : m_controller(0)
     47    , m_metered(false)
    4048{
    4149}
     
    4755void NetworkInfoClientEfl::startUpdating()
    4856{
    49     notImplemented();
     57    if (!eeze_init()) {
     58        ERR("Fail to start network information client.");
     59        return;
     60    }
    5061}
    5162
    5263void NetworkInfoClientEfl::stopUpdating()
    5364{
    54     notImplemented();
     65    eeze_shutdown();
    5566}
    5667
    5768unsigned int NetworkInfoClientEfl::bandwidth() const
    5869{
    59     notImplemented();
    60     return 10; // MB/s
     70    // FIXME : This function should consider cellular network as well. For example, 2G, 3G and 4G.
     71    // See https://bugs.webkit.org/show_bug.cgi?id=89851 for detail.
     72    Eeze_Net* ethNet = eeze_net_new(ethernetInterface);
     73    if (!ethNet)
     74        return 0;
     75
     76    eeze_net_scan(ethNet);
     77
     78    // FIXME : The eeze library doesn't support EEZE_NET_ADDR_TYPE_IP type yet. So, EEZE_NET_ADDR_TYPE_BROADCAST
     79    // is used for now.
     80    // See https://bugs.webkit.org/show_bug.cgi?id=89852 for detail.
     81    const char* address = eeze_net_addr_get(ethNet, EEZE_NET_ADDR_TYPE_BROADCAST);
     82    if (!address)
     83        return 0; // If network is offline, return 0.
     84
     85    unsigned int bandwidth;
     86    const char* attribute = eeze_net_attribute_get(ethNet, "speed");
     87    if (attribute) {
     88        bool ok;
     89        bandwidth = String::fromUTF8(attribute).toUIntStrict(&ok);
     90    } else
     91        bandwidth = UINT_MAX; // If bandwidth is unknown, return infinity value.
     92   
     93    eeze_net_free(ethNet);
     94
     95    return bandwidth / 8; // MB/s
    6196}
    6297
     
    6499{
    65100    notImplemented();
    66     return false;
     101    return m_metered;
    67102}
    68103
  • trunk/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h

    r112815 r121170  
    4646
    4747private:
     48    NetworkInfoController* m_controller;
    4849
    49     NetworkInfoController* m_controller;
     50    bool m_metered;
    5051};
    5152}
  • trunk/Source/cmake/FindEFL.cmake

    r118103 r121170  
    1313  eukit>=1.1.0
    1414  edbus>=1.1.0
    15   ecore-input>=1.0.0)
     15  ecore-input>=1.0.0
     16  eeze>=1.1.99)
    1617PKG_CHECK_MODULES (EINA REQUIRED eina>=1.0.0)
    1718PKG_CHECK_MODULES (ECORE_X ecore-x>=1.0.0)
  • trunk/Tools/ChangeLog

    r121147 r121170  
     12012-06-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [EFL] Implement Network Information API
     4        https://bugs.webkit.org/show_bug.cgi?id=87067
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * efl/jhbuild.modules: Add eeze library dependency.
     9
    1102012-06-25  Simon Hausmann  <simon.hausmann@nokia.com>
    211
  • trunk/Tools/efl/jhbuild.modules

    r120145 r121170  
    1515      <dep package="edje"/>
    1616      <dep package="e_dbus"/>
     17      <dep package="eeze"/>
    1718    </dependencies>
    1819  </metamodule>
     
    219220  </autotools>
    220221
     222  <autotools id="eeze">
     223    <branch module="eeze"
     224            repo="enlightenment.org"
     225            revision="68629"/>
     226    <dependencies>
     227      <dep package="ecore"/>
     228      <dep package="eina"/>
     229    </dependencies>
     230  </autotools>
     231
    221232</moduleset>
Note: See TracChangeset for help on using the changeset viewer.