Changeset 121312 in webkit


Ignore:
Timestamp:
Jun 26, 2012 7:11:13 PM (12 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Change return type in bandwidth attribute of network information API
https://bugs.webkit.org/show_bug.cgi?id=89959

Reviewed by Adam Barth.

According to network information API spec, bandwidth attribute should return double type.
But, existing implementation has used *long* and *unsigned int* types.

Source/WebCore:

No new tests. Covered by existing tests.

  • Modules/networkinfo/NetworkInfo.cpp:

(WebCore::NetworkInfo::NetworkInfo):

  • Modules/networkinfo/NetworkInfo.h:

(WebCore::NetworkInfo::create):
(WebCore::NetworkInfo::bandwidth):
(NetworkInfo):

  • Modules/networkinfo/NetworkInfoClient.h:

(NetworkInfoClient):

  • Modules/networkinfo/NetworkInfoConnection.cpp:

(WebCore::NetworkInfoConnection::bandwidth):

  • Modules/networkinfo/NetworkInfoConnection.h:

(NetworkInfoConnection):

  • testing/Internals.cpp:

(WebCore::Internals::setNetworkInformation):

  • testing/Internals.h:

(Internals):

  • testing/Internals.idl:

Source/WebKit/efl:

  • WebCoreSupport/NetworkInfoClientEfl.cpp:

(WebCore::NetworkInfoClientEfl::bandwidth):

  • WebCoreSupport/NetworkInfoClientEfl.h:

(NetworkInfoClientEfl):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121311 r121312  
     12012-06-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Change return type in bandwidth attribute of network information API
     4        https://bugs.webkit.org/show_bug.cgi?id=89959
     5
     6        Reviewed by Adam Barth.
     7
     8        According to network information API spec, bandwidth attribute should return double type.
     9        But, existing implementation has used *long* and *unsigned int* types.
     10
     11        No new tests. Covered by existing tests.
     12
     13        * Modules/networkinfo/NetworkInfo.cpp:
     14        (WebCore::NetworkInfo::NetworkInfo):
     15        * Modules/networkinfo/NetworkInfo.h:
     16        (WebCore::NetworkInfo::create):
     17        (WebCore::NetworkInfo::bandwidth):
     18        (NetworkInfo):
     19        * Modules/networkinfo/NetworkInfoClient.h:
     20        (NetworkInfoClient):
     21        * Modules/networkinfo/NetworkInfoConnection.cpp:
     22        (WebCore::NetworkInfoConnection::bandwidth):
     23        * Modules/networkinfo/NetworkInfoConnection.h:
     24        (NetworkInfoConnection):
     25        * testing/Internals.cpp:
     26        (WebCore::Internals::setNetworkInformation):
     27        * testing/Internals.h:
     28        (Internals):
     29        * testing/Internals.idl:
     30
    1312012-06-26  Luke Macpherson  <macpherson@chromium.org>
    232
  • trunk/Source/WebCore/Modules/networkinfo/NetworkInfo.cpp

    r112815 r121312  
    3333namespace WebCore {
    3434
    35 NetworkInfo::NetworkInfo(long bandwidth, bool metered)
     35NetworkInfo::NetworkInfo(double bandwidth, bool metered)
    3636    : m_bandwidth(bandwidth)
    3737    , m_metered(metered)
  • trunk/Source/WebCore/Modules/networkinfo/NetworkInfo.h

    r112815 r121312  
    3939class NetworkInfo : public RefCounted<NetworkInfo> {
    4040public:
    41     static PassRefPtr<NetworkInfo> create(long bandwidth, bool metered) { return adoptRef(new NetworkInfo(bandwidth, metered)); }
     41    static PassRefPtr<NetworkInfo> create(double bandwidth, bool metered) { return adoptRef(new NetworkInfo(bandwidth, metered)); }
    4242
    43     long bandwidth() const { return m_bandwidth; }
     43    double bandwidth() const { return m_bandwidth; }
    4444    bool metered() const { return m_metered; }
    4545
    4646private:
    47     NetworkInfo(long bandwidth, bool metered);
     47    NetworkInfo(double bandwidth, bool metered);
    4848
    49     long m_bandwidth;
     49    double m_bandwidth;
    5050    bool m_metered;
    5151};
  • trunk/Source/WebCore/Modules/networkinfo/NetworkInfoClient.h

    r117515 r121312  
    4141    virtual ~NetworkInfoClient() { }
    4242
    43     virtual unsigned int bandwidth() const = 0;
     43    virtual double bandwidth() const = 0;
    4444    virtual bool metered() const = 0;
    4545   
  • trunk/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.cpp

    r112815 r121312  
    5656}
    5757
    58 unsigned int NetworkInfoConnection::bandwidth() const
     58double NetworkInfoConnection::bandwidth() const
    5959{
    6060    if (m_networkInfo)
  • trunk/Source/WebCore/Modules/networkinfo/NetworkInfoConnection.h

    r112815 r121312  
    5252    ~NetworkInfoConnection();
    5353
    54     unsigned int bandwidth() const;
     54    double bandwidth() const;
    5555    bool metered() const;
    5656   
  • trunk/Source/WebCore/testing/Internals.cpp

    r121299 r121312  
    10061006}
    10071007
    1008 void Internals::setNetworkInformation(Document* document, const String& eventType, long bandwidth, bool metered, ExceptionCode& ec)
     1008void Internals::setNetworkInformation(Document* document, const String& eventType, double bandwidth, bool metered, ExceptionCode& ec)
    10091009{
    10101010    if (!document || !document->page()) {
  • trunk/Source/WebCore/testing/Internals.h

    r121299 r121312  
    171171    void setBatteryStatus(Document*, const String& eventType, bool charging, double chargingTime, double dischargingTime, double level, ExceptionCode&);
    172172
    173     void setNetworkInformation(Document*, const String& eventType, long bandwidth, bool metered, ExceptionCode&);
     173    void setNetworkInformation(Document*, const String& eventType, double bandwidth, bool metered, ExceptionCode&);
    174174
    175175    void suspendAnimations(Document*, ExceptionCode&) const;
  • trunk/Source/WebCore/testing/Internals.idl

    r121299 r121312  
    151151
    152152#if defined(ENABLE_NETWORK_INFO) && ENABLE_NETWORK_INFO
    153         void setNetworkInformation(in Document document, in DOMString eventType, in long bandwidth, in boolean metered) raises (DOMException);
     153        void setNetworkInformation(in Document document, in DOMString eventType, in double bandwidth, in boolean metered) raises (DOMException);
    154154#endif
    155155
  • trunk/Source/WebKit/efl/ChangeLog

    r121170 r121312  
     12012-06-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Change return type in bandwidth attribute of network information API
     4        https://bugs.webkit.org/show_bug.cgi?id=89959
     5
     6        Reviewed by Adam Barth.
     7
     8        According to network information API spec, bandwidth attribute should return double type.
     9        But, existing implementation has used *long* and *unsigned int* types.
     10
     11        * WebCoreSupport/NetworkInfoClientEfl.cpp:
     12        (WebCore::NetworkInfoClientEfl::bandwidth):
     13        * WebCoreSupport/NetworkInfoClientEfl.h:
     14        (NetworkInfoClientEfl):
     15
    1162012-06-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    217
  • trunk/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.cpp

    r121170 r121312  
    6666}
    6767
    68 unsigned int NetworkInfoClientEfl::bandwidth() const
     68double NetworkInfoClientEfl::bandwidth() const
    6969{
    7070    // FIXME : This function should consider cellular network as well. For example, 2G, 3G and 4G.
     
    8383        return 0; // If network is offline, return 0.
    8484
    85     unsigned int bandwidth;
     85    double bandwidth;
    8686    const char* attribute = eeze_net_attribute_get(ethNet, "speed");
    8787    if (attribute) {
     
    8989        bandwidth = String::fromUTF8(attribute).toUIntStrict(&ok);
    9090    } else
    91         bandwidth = UINT_MAX; // If bandwidth is unknown, return infinity value.
    92    
     91        bandwidth = std::numeric_limits<double>::infinity(); // If bandwidth is unknown, return infinity value.
     92
    9393    eeze_net_free(ethNet);
    9494
  • trunk/Source/WebKit/efl/WebCoreSupport/NetworkInfoClientEfl.h

    r121170 r121312  
    4242    virtual void stopUpdating();
    4343
    44     virtual unsigned int bandwidth() const;
     44    virtual double bandwidth() const;
    4545    virtual bool metered() const;
    4646
Note: See TracChangeset for help on using the changeset viewer.