Changeset 112263 in webkit


Ignore:
Timestamp:
Mar 27, 2012 7:30:29 AM (12 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: Enable "number" parameters in the web inspector protocol methods
https://bugs.webkit.org/show_bug.cgi?id=82334

The generated protocol dispatcher does not understand protocol method parameters of type "number"
(mapped to "double" in the native code.)

Reviewed by Vsevolod Vlasov.

  • inspector/CodeGeneratorInspector.py:

(RawTypes.Number.get_getter_name):
(RawTypes.Number.get_c_initializer):
(RawTypes.Number.get_js_bind_type):
(RawTypes.Number.get_validate_method_params.ValidateMethodParams):
(RawTypes.Number.get_validate_method_params):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112262 r112263  
     12012-03-27  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: Enable "number" parameters in the web inspector protocol methods
     4        https://bugs.webkit.org/show_bug.cgi?id=82334
     5
     6        The generated protocol dispatcher does not understand protocol method parameters of type "number"
     7        (mapped to "double" in the native code.)
     8
     9        Reviewed by Vsevolod Vlasov.
     10
     11        * inspector/CodeGeneratorInspector.py:
     12        (RawTypes.Number.get_getter_name):
     13        (RawTypes.Number.get_c_initializer):
     14        (RawTypes.Number.get_js_bind_type):
     15        (RawTypes.Number.get_validate_method_params.ValidateMethodParams):
     16        (RawTypes.Number.get_validate_method_params):
     17
    1182012-03-27  Alexei Filippov  <alexeif@chromium.org>
    219
  • trunk/Source/WebCore/inspector/CodeGeneratorInspector.py

    r112087 r112263  
    339339        @staticmethod
    340340        def get_getter_name():
    341             return "Object"
     341            return "Double"
    342342
    343343        @staticmethod
     
    347347        @staticmethod
    348348        def get_c_initializer():
    349             raise Exception("Unsupported")
     349            return "0"
    350350
    351351        @staticmethod
    352352        def get_js_bind_type():
    353             raise Exception("Unsupported")
     353            return "number"
    354354
    355355        @staticmethod
    356356        def get_validate_method_params():
    357             raise Exception("TODO")
     357            class ValidateMethodParams:
     358                name = "Double"
     359                var_type = "double"
     360                as_method_name = "Number"
     361            return ValidateMethodParams
    358362
    359363        @staticmethod
     
    18821886
    18831887    static int getInt(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
     1888    static double getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
    18841889    static String getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
    18851890    static bool getBoolean(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
     
    20502055struct AsMethodBridges {
    20512056    static bool asInt(InspectorValue* value, int* output) { return value->asNumber(output); }
     2057    static bool asDouble(InspectorValue* value, double* output) { return value->asNumber(output); }
    20522058    static bool asString(InspectorValue* value, String* output) { return value->asString(output); }
    20532059    static bool asBoolean(InspectorValue* value, bool* output) { return value->asBoolean(output); }
     
    20592065{
    20602066    return getPropertyValueImpl<int, int, int>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInt, "Number");
     2067}
     2068
     2069double InspectorBackendDispatcherImpl::getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
     2070{
     2071    return getPropertyValueImpl<double, double, double>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asDouble, "Number");
    20612072}
    20622073
Note: See TracChangeset for help on using the changeset viewer.