2011-03-03 Yury Semikhatsky <yurys@chromium.org>
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 11:58:46 +0000 (11:58 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 11:58:46 +0000 (11:58 +0000)
        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).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/report-protocol-errors-expected.txt
LayoutTests/inspector/report-protocol-errors.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/CodeGeneratorInspector.pm

index bd0ca0f..710c1b9 100644 (file)
@@ -1,3 +1,13 @@
+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-03  Kenji Imasaki  <imasaki@chromium.org>
 
         Reviewed by David Levin.
index 4b28a4a..d96f06b 100644 (file)
@@ -39,7 +39,7 @@ Tests that InspectorBackendDispatcher is catching incorrect messages.
     seq : 1
     success : false
     errors : {
-        0 : "Protocol Error: Invalid command was received. 'test' wasn't found."
+        0 : "Protocol Error: Invalid command was received. 'test' wasn't found in domain DOM."
     }
 }
 {
index 3539bf2..13ecac5 100644 (file)
@@ -9,13 +9,13 @@ function test()
         'some wrong string',
         '{}',
         '{"command":1}',
-        '{"command":"test"}',
-        '{"seq":"not a number","command":"test"}',
-        '{"seq":1,"command":"test"}',
-        '{"seq":2,"command":"resourceContent"}',
-        '{"seq":3,"command":"resourceContent","arguments":[]}',
-        '{"seq":4,"command":"resourceContent","arguments":{}}',
-        '{"seq":5,"command":"resourceContent","arguments":{"identifier":"not a number"}}',
+        '{"domain":"Network","command":"resourceContent"}',
+        '{"seq":"not a number","domain":"Network","command":"resourceContent"}',
+        '{"seq":1,"domain":"DOM","command":"test"}',
+        '{"seq":2,"domain":"Network","command":"resourceContent"}',
+        '{"seq":3,"domain":"Network","command":"resourceContent","arguments":[]}',
+        '{"seq":4,"domain":"Network","command":"resourceContent","arguments":{}}',
+        '{"seq":5,"domain":"Network","command":"resourceContent","arguments":{"identifier":"not a number"}}',
     ];
     var numberOfReports = 0;
 
index a71214e..6a25956 100644 (file)
@@ -1,3 +1,12 @@
+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).
+
 2011-03-02  Pavel Podivilov  <podivilov@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 72f4958..2a407b9 100644 (file)
@@ -455,7 +455,7 @@ sub generateBackendFunction
     my $fullQualifiedFunctionName = $interface->name . "_" . $function->signature->name;
 
     push(@backendConstantDeclarations, "    static const char* ${fullQualifiedFunctionName}Cmd;");
-    push(@backendConstantDefinitions, "const char* ${backendClassName}::${fullQualifiedFunctionName}Cmd = \"${functionName}\";");
+    push(@backendConstantDefinitions, "const char* ${backendClassName}::${fullQualifiedFunctionName}Cmd = \"${fullQualifiedFunctionName}\";");
 
     map($backendTypes{$_->type} = 1, @{$function->parameters}); # register required types
     my @inArgs = grep($_->direction eq "in" && !($_->name eq "callId") , @{$function->parameters});
@@ -686,6 +686,18 @@ $mapEntries
         return;
     }
 
+    RefPtr<InspectorValue> domainValue = messageObject->get("domain");
+    if (!domainValue) {
+        reportProtocolError(callId, "Protocol Error: Invalid message format. 'domain' property wasn't found.");
+        return;
+    }
+
+    String domain;
+    if (!domainValue->asString(&domain)) {
+        reportProtocolError(callId, "Protocol Error: Invalid message format. The type of 'domain' property should be string.");
+        return;
+    }
+
     RefPtr<InspectorValue> callIdValue = messageObject->get("seq");
     if (!callIdValue) {
         reportProtocolError(callId, "Protocol Error: Invalid message format. 'seq' property was not found in the request.");
@@ -697,9 +709,9 @@ $mapEntries
         return;
     }
 
-    HashMap<String, CallHandler>::iterator it = dispatchMap.find(command);
+    HashMap<String, CallHandler>::iterator it = dispatchMap.find(makeString(domain, "_", command));
     if (it == dispatchMap.end()) {
-        reportProtocolError(callId, makeString("Protocol Error: Invalid command was received. '", command, "' wasn't found."));
+        reportProtocolError(callId, makeString("Protocol Error: Invalid command was received. '", command, "' wasn't found in domain ", domain, "."));
         return;
     }