[Webkit-unassigned] [Bug 69295] Web Inspector: reimplement protocol backend/frontend source generator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 7 00:08:46 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=69295





--- Comment #21 from Ilya Tikhonovsky <loislo at chromium.org>  2011-10-07 00:08:46 PST ---
(From update of attachment 110041)
View in context: https://bugs.webkit.org/attachment.cgi?id=110041&action=review

> Source/WebCore/ChangeLog:10655
> +2011-10-03  Peter Rybin  <peter.rybin at gmail.com>
> +
> +        Web Inspector: reimplement protocol backend/frontend source generator
> +        https://bugs.webkit.org/show_bug.cgi?id=69295
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        No new tests. (OOPS!)
> +
> +        * WebCore.gyp/WebCore.gyp:
> +        * inspector/CodeGeneratorInspector.pm:
> +        (finish):
> +        * inspector/CodeGeneratorInspector.py: Added.
> +

second change log entry.

> Source/WebCore/CodeGenerators.pri:679
> +inspectorJSON.output = $${WC_GENERATED_SOURCES_DIR}/InspectorFrontend.cpp $${WC_GENERATED_SOURCES_DIR}/InspectorBackendDispatcher.cpp

please add headers too

> Source/WebCore/WebCore.gyp/WebCore.gyp:369
> +          'message': 'Generating Inspector protocol sources from Inspector.idl',

from Inspector.json

> Source/WebCore/inspector/CodeGeneratorInspector.py:446
> +if (!protocolErrors->length())
> +    $agentField->$methodName(&error$agentCallParams);

wrong indent in the generated file.

> Source/WebCore/inspector/CodeGeneratorInspector.py:449
> +${responseCook}sendResponse(callId, result, String::format("Some arguments of method '%s' can't be processed", "$domainName.$methodName"), protocolErrors, error);

wrong indent in the generated file.
It'd be nice to extract String::format("Some arguments of method '%s' can't be processed", "some method name") call to an inline function.

> Source/WebCore/inspector/CodeGeneratorInspector.py:457
> +$code    if (m_inspectorFrontendChannel)

improvement: I'd like to convert this if statement to guard.

> Source/WebCore/inspector/CodeGeneratorInspector.py:462
> +    frontend_h = string.Template("""// Copyright (c) 2010 The Chromium Authors. All rights reserved.

Copyright (c) 2011

> Source/WebCore/inspector/CodeGeneratorInspector.py:482
> +

unnecessary empty line

> Source/WebCore/inspector/CodeGeneratorInspector.py:485
> +$domainClassList
> +private:

unnecessary empty line was inserted between last class and private statement

> Source/WebCore/inspector/CodeGeneratorInspector.py:493
> +    backend_h = string.Template("""// Copyright (c) 2010 The Chromium Authors. All rights reserved.

license 2011

> Source/WebCore/inspector/CodeGeneratorInspector.py:539
> +

unnecessary empty line

> Source/WebCore/inspector/CodeGeneratorInspector.py:540
> +$enumConstants

$methodNamesEnumContent ?

> Source/WebCore/inspector/CodeGeneratorInspector.py:541
> +};

wrong indent

> Source/WebCore/inspector/CodeGeneratorInspector.py:565
> +    backend_cpp = string.Template("""// Copyright (c) 2010 The Chromium Authors. All rights reserved.

Copyright (c) 2011

> Source/WebCore/inspector/CodeGeneratorInspector.py:589
> +

unnecessary empty string

> Source/WebCore/inspector/CodeGeneratorInspector.py:601
> +$messageHandlers

wrong indent in the generated file.

> Source/WebCore/inspector/CodeGeneratorInspector.py:666
> +    if (m_inspectorFrontendChannel)

improvement: I'd like to convert this if statement to guard.

> Source/WebCore/inspector/CodeGeneratorInspector.py:701
> +    if (m_inspectorFrontendChannel)

improvement: I'd like to convert this if statement to guard.

> Source/WebCore/inspector/CodeGeneratorInspector.py:840
> +PassRefPtr<InspectorObject> InspectorBackendDispatcher::getObject(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
> +{
> +    ASSERT(protocolErrors);
> +
> +    if (valueFound)
> +        *valueFound = false;
> +
> +    RefPtr<InspectorObject> value = InspectorObject::create();
> +
> +    if (!object) {
> +        if (!valueFound) {
> +            // Required parameter in missing params container.
> +            protocolErrors->pushString(String::format("'params' object must contain required parameter '%s' with type 'Object'.", name.utf8().data()));
> +        }
> +        return value;
> +    }
> +
> +    InspectorObject::const_iterator end = object->end();
> +    InspectorObject::const_iterator valueIterator = object->find(name);
> +
> +    if (valueIterator == end) {
> +        if (!valueFound)
> +            protocolErrors->pushString(String::format("Parameter '%s' with type 'Object' was not found.", name.utf8().data()));
> +        return value;
> +    }
> +
> +    if (!valueIterator->second->asObject(&value))
> +        protocolErrors->pushString(String::format("Parameter '%s' has wrong type. It must be 'Object'.", name.utf8().data()));
> +    else
> +        if (valueFound)
> +            *valueFound = true;
> +    return value;
> +}
> +

The old version is generating the getters

> Source/WebCore/inspector/CodeGeneratorInspector.py:874
> +bool InspectorBackendDispatcher::getCommandName(const String& message, String* result)

empty line required

> Source/WebCore/inspector/CodeGeneratorInspector.py:914
> +
> +

unnecessary empty lines

> Source/WebCore/inspector/CodeGeneratorInspector.py:928
> +    backend_js = string.Template("""// Copyright (c) 2010 The Chromium Authors. All rights reserved.

license 2011

> Source/WebCore/inspector/CodeGeneratorInspector.py:940
> +$delegates$eventArgs$domainDispatchers    }

wrong indent in the generated code

> Source/WebCore/inspector/CodeGeneratorInspector.py:1398
> +    enumConstants=join(Generator.method_name_enum_list, "\n"),

bad name

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list