Title: [112263] trunk/Source/WebCore
Revision
112263
Author
apav...@chromium.org
Date
2012-03-27 07:30:29 -0700 (Tue, 27 Mar 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112262 => 112263)


--- trunk/Source/WebCore/ChangeLog	2012-03-27 14:23:22 UTC (rev 112262)
+++ trunk/Source/WebCore/ChangeLog	2012-03-27 14:30:29 UTC (rev 112263)
@@ -1,3 +1,20 @@
+2012-03-27  Alexander Pavlov  <apav...@chromium.org>
+
+        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):
+
 2012-03-27  Alexei Filippov  <alex...@chromium.org>
 
         Web Inspector: Fix missing objects in the dominators view.

Modified: trunk/Source/WebCore/inspector/CodeGeneratorInspector.py (112262 => 112263)


--- trunk/Source/WebCore/inspector/CodeGeneratorInspector.py	2012-03-27 14:23:22 UTC (rev 112262)
+++ trunk/Source/WebCore/inspector/CodeGeneratorInspector.py	2012-03-27 14:30:29 UTC (rev 112263)
@@ -338,7 +338,7 @@
     class Number(BaseType):
         @staticmethod
         def get_getter_name():
-            return "Object"
+            return "Double"
 
         @staticmethod
         def get_setter_name():
@@ -346,15 +346,19 @@
 
         @staticmethod
         def get_c_initializer():
-            raise Exception("Unsupported")
+            return "0"
 
         @staticmethod
         def get_js_bind_type():
-            raise Exception("Unsupported")
+            return "number"
 
         @staticmethod
         def get_validate_method_params():
-            raise Exception("TODO")
+            class ValidateMethodParams:
+                name = "Double"
+                var_type = "double"
+                as_method_name = "Number"
+            return ValidateMethodParams
 
         @staticmethod
         def get_output_pass_model():
@@ -1881,6 +1885,7 @@
     static R getPropertyValueImpl(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors, V0 initial_value, bool (*as_method)(InspectorValue*, V*), const char* type_name);
 
     static int getInt(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static double getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
     static String getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
     static bool getBoolean(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
     static PassRefPtr<InspectorObject> getObject(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
@@ -2049,6 +2054,7 @@
 
 struct AsMethodBridges {
     static bool asInt(InspectorValue* value, int* output) { return value->asNumber(output); }
+    static bool asDouble(InspectorValue* value, double* output) { return value->asNumber(output); }
     static bool asString(InspectorValue* value, String* output) { return value->asString(output); }
     static bool asBoolean(InspectorValue* value, bool* output) { return value->asBoolean(output); }
     static bool asObject(InspectorValue* value, RefPtr<InspectorObject>* output) { return value->asObject(output); }
@@ -2060,6 +2066,11 @@
     return getPropertyValueImpl<int, int, int>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInt, "Number");
 }
 
+double InspectorBackendDispatcherImpl::getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+{
+    return getPropertyValueImpl<double, double, double>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asDouble, "Number");
+}
+
 String InspectorBackendDispatcherImpl::getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
     return getPropertyValueImpl<String, String, String>(object, name, valueFound, protocolErrors, "", AsMethodBridges::asString, "String");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to