Changeset 80230 in webkit


Ignore:
Timestamp:
Mar 3, 2011 3:58:46 AM (13 years ago)
Author:
yurys@chromium.org
Message:

2011-03-03 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: inspector protocol should allow different domains to have methods with same name
https://bugs.webkit.org/show_bug.cgi?id=55558

  • inspector/report-protocol-errors-expected.txt:
  • inspector/report-protocol-errors.html:

2011-03-02 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: inspector protocol should allow different domains to have methods with same name
https://bugs.webkit.org/show_bug.cgi?id=55558

  • inspector/CodeGeneratorInspector.pm: each command is now identified by domain + command-name(was command-name only).
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80227 r80230  
     12011-03-03  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: inspector protocol should allow different domains to have methods with same name
     6        https://bugs.webkit.org/show_bug.cgi?id=55558
     7
     8        * inspector/report-protocol-errors-expected.txt:
     9        * inspector/report-protocol-errors.html:
     10
    1112011-03-03  Kenji Imasaki  <imasaki@chromium.org>
    212
  • trunk/LayoutTests/inspector/report-protocol-errors-expected.txt

    r79858 r80230  
    4040    success : false
    4141    errors : {
    42         0 : "Protocol Error: Invalid command was received. 'test' wasn't found."
     42        0 : "Protocol Error: Invalid command was received. 'test' wasn't found in domain DOM."
    4343    }
    4444}
  • trunk/LayoutTests/inspector/report-protocol-errors.html

    r79858 r80230  
    1010        '{}',
    1111        '{"command":1}',
    12         '{"command":"test"}',
    13         '{"seq":"not a number","command":"test"}',
    14         '{"seq":1,"command":"test"}',
    15         '{"seq":2,"command":"resourceContent"}',
    16         '{"seq":3,"command":"resourceContent","arguments":[]}',
    17         '{"seq":4,"command":"resourceContent","arguments":{}}',
    18         '{"seq":5,"command":"resourceContent","arguments":{"identifier":"not a number"}}',
     12        '{"domain":"Network","command":"resourceContent"}',
     13        '{"seq":"not a number","domain":"Network","command":"resourceContent"}',
     14        '{"seq":1,"domain":"DOM","command":"test"}',
     15        '{"seq":2,"domain":"Network","command":"resourceContent"}',
     16        '{"seq":3,"domain":"Network","command":"resourceContent","arguments":[]}',
     17        '{"seq":4,"domain":"Network","command":"resourceContent","arguments":{}}',
     18        '{"seq":5,"domain":"Network","command":"resourceContent","arguments":{"identifier":"not a number"}}',
    1919    ];
    2020    var numberOfReports = 0;
  • trunk/Source/WebCore/ChangeLog

    r80228 r80230  
     12011-03-02  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: inspector protocol should allow different domains to have methods with same name
     6        https://bugs.webkit.org/show_bug.cgi?id=55558
     7
     8        * inspector/CodeGeneratorInspector.pm: each command is now identified by domain + command-name(was command-name only).
     9
    1102011-03-02  Pavel Podivilov  <podivilov@chromium.org>
    211
  • trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm

    r80204 r80230  
    456456
    457457    push(@backendConstantDeclarations, "    static const char* ${fullQualifiedFunctionName}Cmd;");
    458     push(@backendConstantDefinitions, "const char* ${backendClassName}::${fullQualifiedFunctionName}Cmd = \"${functionName}\";");
     458    push(@backendConstantDefinitions, "const char* ${backendClassName}::${fullQualifiedFunctionName}Cmd = \"${fullQualifiedFunctionName}\";");
    459459
    460460    map($backendTypes{$_->type} = 1, @{$function->parameters}); # register required types
     
    687687    }
    688688
     689    RefPtr<InspectorValue> domainValue = messageObject->get("domain");
     690    if (!domainValue) {
     691        reportProtocolError(callId, "Protocol Error: Invalid message format. 'domain' property wasn't found.");
     692        return;
     693    }
     694
     695    String domain;
     696    if (!domainValue->asString(&domain)) {
     697        reportProtocolError(callId, "Protocol Error: Invalid message format. The type of 'domain' property should be string.");
     698        return;
     699    }
     700
    689701    RefPtr<InspectorValue> callIdValue = messageObject->get("seq");
    690702    if (!callIdValue) {
     
    698710    }
    699711
    700     HashMap<String, CallHandler>::iterator it = dispatchMap.find(command);
     712    HashMap<String, CallHandler>::iterator it = dispatchMap.find(makeString(domain, "_", command));
    701713    if (it == dispatchMap.end()) {
    702         reportProtocolError(callId, makeString("Protocol Error: Invalid command was received. '", command, "' wasn't found."));
     714        reportProtocolError(callId, makeString("Protocol Error: Invalid command was received. '", command, "' wasn't found in domain ", domain, "."));
    703715        return;
    704716    }
Note: See TracChangeset for help on using the changeset viewer.