[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

satish at chromium.org satish at chromium.org
Wed Dec 22 15:02:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7ee69691fc3f42ae99e231002a0944e4a2edce2c
Author: satish at chromium.org <satish at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 27 17:46:18 2010 +0000

    2010-10-27  Satish Sampath  <satish at chromium.org>
    
            Unreviewed, rolling out r70665.
            http://trac.webkit.org/changeset/70665
            https://bugs.webkit.org/show_bug.cgi?id=47089
    
            Need to address Alexey's review comments.
    
            * fast/speech/input-text-language-tag-expected.txt: Removed.
            * fast/speech/input-text-language-tag.html: Removed.
            * fast/speech/input-text-speechbutton.html:
            * fast/speech/speech-button-ignore-generated-events.html:
            * platform/chromium/test_expectations.txt:
    2010-10-27  Satish Sampath  <satish at chromium.org>
    
            Unreviewed, rolling out r70665.
            http://trac.webkit.org/changeset/70665
            https://bugs.webkit.org/show_bug.cgi?id=47089
    
            Need to address Alexey's review comments.
    
            * page/SpeechInput.cpp:
            (WebCore::SpeechInput::startRecognition):
            * page/SpeechInput.h:
            * page/SpeechInputClient.h:
            * platform/mock/SpeechInputClientMock.cpp:
            (WebCore::SpeechInputClientMock::startRecognition):
            (WebCore::SpeechInputClientMock::setRecognitionResult):
            (WebCore::SpeechInputClientMock::timerFired):
            * platform/mock/SpeechInputClientMock.h:
            * rendering/TextControlInnerElements.cpp:
            (WebCore::TextControlInnerElement::attachInnerElement):
            (WebCore::SearchFieldCancelButtonElement::detach):
            (WebCore::SpinButtonElement::defaultEventHandler):
            (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
            (WebCore::InputFieldSpeechButtonElement::detach):
    2010-10-27  Satish Sampath  <satish at chromium.org>
    
            Unreviewed, rolling out r70665.
            http://trac.webkit.org/changeset/70665
            https://bugs.webkit.org/show_bug.cgi?id=47089
    
            Need to address Alexey's review comments.
    
            * public/WebSpeechInputController.h:
            (WebKit::WebSpeechInputController::startRecognition):
            * public/WebSpeechInputControllerMock.h:
            * src/SpeechInputClientImpl.cpp:
            (WebKit::SpeechInputClientImpl::startRecognition):
            * src/SpeechInputClientImpl.h:
            * src/WebSpeechInputControllerMockImpl.cpp:
            (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
            (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
            * src/WebSpeechInputControllerMockImpl.h:
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::WebViewImpl):
            * src/WebViewImpl.h:
    2010-10-27  Satish Sampath  <satish at chromium.org>
    
            Unreviewed, rolling out r70665.
            http://trac.webkit.org/changeset/70665
            https://bugs.webkit.org/show_bug.cgi?id=47089
    
            Need to address Alexey's review comments.
    
            * DumpRenderTree/LayoutTestController.cpp:
            (setMockSpeechInputResultCallback):
            * DumpRenderTree/LayoutTestController.h:
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::setMockSpeechInputResult):
            * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
            (LayoutTestController::setMockSpeechInputResult):
            * DumpRenderTree/mac/LayoutTestControllerMac.mm:
            (LayoutTestController::setMockSpeechInputResult):
            * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
            (LayoutTestController::setMockSpeechInputResult):
            * DumpRenderTree/qt/LayoutTestControllerQt.h:
            * DumpRenderTree/win/LayoutTestControllerWin.cpp:
            (LayoutTestController::setMockSpeechInputResult):
            * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
            (LayoutTestController::setMockSpeechInputResult):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70669 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b38d259..f08bb39 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-27  Satish Sampath  <satish at chromium.org>
+
+        Unreviewed, rolling out r70665.
+        http://trac.webkit.org/changeset/70665
+        https://bugs.webkit.org/show_bug.cgi?id=47089
+
+        Need to address Alexey's review comments.
+
+        * fast/speech/input-text-language-tag-expected.txt: Removed.
+        * fast/speech/input-text-language-tag.html: Removed.
+        * fast/speech/input-text-speechbutton.html:
+        * fast/speech/speech-button-ignore-generated-events.html:
+        * platform/chromium/test_expectations.txt:
+
 2010-10-27  Dimitri Glazkov  <dglazkov at chromium.org>
 
         [Chromium] Update expectations after r70654.
diff --git a/LayoutTests/fast/speech/input-text-language-tag-expected.txt b/LayoutTests/fast/speech/input-text-language-tag-expected.txt
deleted file mode 100644
index aecb475..0000000
--- a/LayoutTests/fast/speech/input-text-language-tag-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Tests for language tag inheritance and validation in speech buttons.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.getElementById("speechInputNone").value is "error: no result found for language ''"
-PASS document.getElementById("speechInputElement").value is "Pictures of the moon"
-PASS document.getElementById("speechInputInherited").value is "月の写真"
-PASS successfullyParsed is true
-
-TEST COMPLETE
- 
diff --git a/LayoutTests/fast/speech/input-text-language-tag.html b/LayoutTests/fast/speech/input-text-language-tag.html
deleted file mode 100644
index 3158d3e..0000000
--- a/LayoutTests/fast/speech/input-text-language-tag.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<meta charset="utf-8">
-<link rel="stylesheet" href="../js/resources/js-test-style.css">
-<script src="../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script type="text/javascript">
-description('Tests for language tag inheritance and validation in speech buttons.');
-
-// Note: test cases are sequential to ensure that no new recognition starts when another recognition recording is active.
-function onChangeNone() {
-    shouldBeEqualToString('document.getElementById("speechInputNone").value', 'error: no result found for language \'\'');
-    setTimeout(function() { speechButtonClick('speechInputElement'); }, 50);
-}
-
-function onChangeElement() {
-    shouldBeEqualToString('document.getElementById("speechInputElement").value', 'Pictures of the moon');
-    setTimeout(function() { speechButtonClick('speechInputInherited'); }, 50);
-}
-
-function onChangeInherited() {
-    shouldBeEqualToString('document.getElementById("speechInputInherited").value', '月の写真');
-    finishJSTest();
-}
-
-function speechButtonClick(elementId) {
-    var element = document.getElementById(elementId);
-    var x = element.offsetLeft + element.offsetWidth - 4;
-    var y = element.offsetTop + element.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-}
-
-function run() {
-    if (window.layoutTestController && window.eventSender) {
-        layoutTestController.setMockSpeechInputResult('Pictures of the moon', 'en-GB');
-        layoutTestController.setMockSpeechInputResult('月の写真', 'ja');
-        speechButtonClick('speechInputNone');
-    }
-}
-
-window.onload = run;
-window.jsTestIsAsync = true;
-window.successfullyParsed = true;
-</script>
-<script src="../js/resources/js-test-post.js"></script>
-<input id="speechInputNone" x-webkit-speech onwebkitspeechchange="onChangeNone()">
-<input id="speechInputElement" x-webkit-speech onwebkitspeechchange="onChangeElement()" lang="en-GB">
-<div lang="ja"> <input id="speechInputInherited" x-webkit-speech onwebkitspeechchange="onChangeInherited()"> </div>
-</body>
-</html>
diff --git a/LayoutTests/fast/speech/input-text-speechbutton.html b/LayoutTests/fast/speech/input-text-speechbutton.html
index cef7705..6f5bc4b 100644
--- a/LayoutTests/fast/speech/input-text-speechbutton.html
+++ b/LayoutTests/fast/speech/input-text-speechbutton.html
@@ -32,7 +32,7 @@ function onWebkitSpeechChange() {
 
 function run() {
     if (window.layoutTestController && window.eventSender) {
-        layoutTestController.setMockSpeechInputResult('Pictures of the moon', '');
+        layoutTestController.setMockSpeechInputResult('Pictures of the moon');
 
         // Clicking the speech button should fill in mock speech-recognized text.
         var input = document.getElementById('speechInput');
diff --git a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
index c684863..b9b8ec3 100644
--- a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
+++ b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
@@ -49,7 +49,7 @@ function setupDispatchEventTest() {
 function run() {
     if (window.layoutTestController && window.eventSender) {
         // Running in DRT, test the eventSender case.
-        layoutTestController.setMockSpeechInputResult('Pictures of the moon', '');
+        layoutTestController.setMockSpeechInputResult('Pictures of the moon');
         document.getElementById('speechInput').onwebkitspeechchange = function() {
             shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
 
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 5802557..0dbc5fe 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3253,6 +3253,3 @@ BUGWK48164 : plugins/invalid-mime-with-valid-extension-shows-missing-plugin.html
 
 // Chromium-mac-specific test, and only runs in DRT.
 BUGWK46868 : platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html = TEXT
-
-// Temporarily disabled for a 4-sided patch. Will be enabled again by BUGWK47420.
-BUGWK47089 : fast/speech/input-text-language-tag.html = FAIL
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 768a7d2..507f731 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-27  Satish Sampath  <satish at chromium.org>
+
+        Unreviewed, rolling out r70665.
+        http://trac.webkit.org/changeset/70665
+        https://bugs.webkit.org/show_bug.cgi?id=47089
+
+        Need to address Alexey's review comments.
+
+        * page/SpeechInput.cpp:
+        (WebCore::SpeechInput::startRecognition):
+        * page/SpeechInput.h:
+        * page/SpeechInputClient.h:
+        * platform/mock/SpeechInputClientMock.cpp:
+        (WebCore::SpeechInputClientMock::startRecognition):
+        (WebCore::SpeechInputClientMock::setRecognitionResult):
+        (WebCore::SpeechInputClientMock::timerFired):
+        * platform/mock/SpeechInputClientMock.h:
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::attachInnerElement):
+        (WebCore::SearchFieldCancelButtonElement::detach):
+        (WebCore::SpinButtonElement::defaultEventHandler):
+        (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+        (WebCore::InputFieldSpeechButtonElement::detach):
+
 2010-10-27  ZHenyao Mo  <zmo at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index 6de0af2..c533a80 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -93,10 +93,10 @@ void SpeechInput::setRecognitionResult(int listenerId, const SpeechInputResultAr
         m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
 }
 
-bool SpeechInput::startRecognition(int listenerId, const String& language, const IntRect& elementRect, const String& grammar)
+bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const String& grammar)
 {
     ASSERT(m_listeners.contains(listenerId));
-    return m_client->startRecognition(listenerId, language, elementRect, grammar);
+    return m_client->startRecognition(listenerId, elementRect, grammar);
 }
 
 void SpeechInput::stopRecording(int listenerId)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index d03a1ce..08d95de 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -61,7 +61,7 @@ public:
     void unregisterListener(int);
 
     // Methods invoked by the input elements.
-    bool startRecognition(int listenerId, const String& language, const IntRect& elementRect, const String& grammar);
+    bool startRecognition(int listenerId, const IntRect& elementRect, const String& grammar);
     void stopRecording(int);
     void cancelRecognition(int);
 
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index a9a3e13..45b309a 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -50,7 +50,7 @@ public:
     virtual void setListener(SpeechInputListener*) = 0;
 
     // Starts speech recognition and audio recording.
-    virtual bool startRecognition(int requestId, const String& language, const IntRect& elementRect, const String& grammar) = 0;
+    virtual bool startRecognition(int requestId, const IntRect& elementRect, const String& grammar) = 0;
 
     // Stops audio recording and performs recognition with the audio recorded until now
     // (does not discard audio).
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index f9ae4fe..0b3c8ac 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -35,11 +35,6 @@
 
 #include "SpeechInputListener.h"
 
-namespace {
-    // HashMap doesn't support empty strings as keys, so this value (an invalid BCP47 tag) is used for those cases.
-    const String emptyLanguage = "_";
-}
-
 namespace WebCore {
 
 SpeechInputClientMock::SpeechInputClientMock()
@@ -55,13 +50,12 @@ void SpeechInputClientMock::setListener(SpeechInputListener* listener)
     m_listener = listener;
 }
 
-bool SpeechInputClientMock::startRecognition(int requestId, const String& language, const IntRect& elementRect, const String& grammar)
+bool SpeechInputClientMock::startRecognition(int requestId, const IntRect& elementRect, const String& grammar)
 {
     if (m_timer.isActive())
         return false;
     m_requestId = requestId;
     m_recording = true;
-    m_language = language;
     m_timer.startOneShot(0);
     return true;
 }
@@ -86,12 +80,9 @@ void SpeechInputClientMock::cancelRecognition(int requestId)
     }
 }
 
-void SpeechInputClientMock::setRecognitionResult(const String& result, const String& language)
+void SpeechInputClientMock::setRecognitionResult(const String& result)
 {
-    if (language.isEmpty())
-        m_recognitionResult.set(emptyLanguage, result);
-    else
-        m_recognitionResult.set(language, result);
+    m_recognitionResult = result;
 }
 
 void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
@@ -102,19 +93,7 @@ void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
         m_timer.startOneShot(0);
     } else {
         SpeechInputResultArray results;
-
-        // Empty language strings crash the HashMap. Using an invalid language value for that case.
-        String language = m_language.isEmpty() ? String(emptyLanguage) : m_language;
-        if (!m_recognitionResult.contains(language)) {
-            // Can't avoid setting a result on empty or invalid language strings.
-            // This would avoid generating the events used to check the results and the test would timeout.
-            String error("error: no result found for language '");
-            error.append(m_language);
-            error.append("'");
-            results.append(SpeechInputResult::create(error, 1.0));
-        } else
-            results.append(SpeechInputResult::create(m_recognitionResult.get(language), 1.0));
-
+        results.append(SpeechInputResult::create(m_recognitionResult, 1.0));
         m_listener->setRecognitionResult(m_requestId, results);
         m_listener->didCompleteRecognition(m_requestId);
         m_requestId = 0;
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index 491b9c8..7900f36 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -34,8 +34,6 @@
 #include "PlatformString.h"
 #include "SpeechInputClient.h"
 #include "Timer.h"
-#include <wtf/HashMap.h>
-#include <wtf/text/StringHash.h>
 
 #if ENABLE(INPUT_SPEECH)
 
@@ -48,11 +46,11 @@ class SpeechInputClientMock : public SpeechInputClient {
 public:
     SpeechInputClientMock();
 
-    void setRecognitionResult(const String& result, const String& language);
+    void setRecognitionResult(const String& result);
 
     // SpeechInputClient methods.
     void setListener(SpeechInputListener*);
-    bool startRecognition(int requestId, const String& language, const IntRect& elementRect, const String& grammar);
+    bool startRecognition(int requestId, const IntRect& elementRect, const String& grammar);
     void stopRecording(int);
     void cancelRecognition(int);
 
@@ -63,9 +61,7 @@ private:
     Timer<SpeechInputClientMock> m_timer;
     SpeechInputListener* m_listener;
     int m_requestId;
-
-    HashMap<String, String> m_recognitionResult;
-    String m_language;
+    String m_recognitionResult;
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index d42607f..9248395 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -21,9 +21,9 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
-
+ 
 #include "config.h"
 #include "TextControlInnerElements.h"
 
@@ -107,18 +107,18 @@ void TextControlInnerElement::attachInnerElement(Node* parent, PassRefPtr<Render
         setRenderer(renderer);
         renderer->setStyle(style);
     }
-
+    
     // Set these explicitly since this normally happens during an attach()
     setAttached();
     setInDocument();
-
+    
     // For elements without a shadow parent, add the node to the DOM normally.
     if (!m_shadowParent) {
         // FIXME: This code seems very wrong.  Why are we magically adding |this| to the DOM here?
         //        We shouldn't be calling parser API methods outside of the parser!
         parent->deprecatedParserAddChild(this);
     }
-
+ 
     // Add the renderer to the render tree
     if (renderer)
         parent->renderer()->addChild(renderer);
@@ -208,7 +208,7 @@ void SearchFieldCancelButtonElement::detach()
 {
     if (m_capturing) {
         if (Frame* frame = document()->frame())
-            frame->eventHandler()->setCapturingMouseEventsNode(0);
+            frame->eventHandler()->setCapturingMouseEventsNode(0);      
     }
     TextControlInnerElement::detach();
 }
@@ -281,9 +281,9 @@ void SpinButtonElement::defaultEventHandler(Event* event)
     if (!box) {
         if (!event->defaultHandled())
             HTMLDivElement::defaultEventHandler(event);
-        return;
+        return;        
     }
-
+    
     HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
     if (input->disabled() || input->isReadOnlyFormControl()) {
         if (!event->defaultHandled())
@@ -431,7 +431,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
     if (event->type() == eventNames().clickEvent) {
         switch (m_state) {
         case Idle:
-            if (speechInput()->startRecognition(m_listenerId, input->computeInheritedLanguage(), input->renderer()->absoluteBoundingBoxRect(), input->getAttribute(webkitgrammarAttr)))
+            if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect(), input->getAttribute(webkitgrammarAttr)))
                 setState(Recording);
             break;
         case Recording:
@@ -489,7 +489,7 @@ void InputFieldSpeechButtonElement::detach()
 {
     if (m_capturing) {
         if (Frame* frame = document()->frame())
-            frame->eventHandler()->setCapturingMouseEventsNode(0);
+            frame->eventHandler()->setCapturingMouseEventsNode(0);      
     }
 
     if (m_state != Idle)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index cdbed9c..a3a0e61 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,25 @@
+2010-10-27  Satish Sampath  <satish at chromium.org>
+
+        Unreviewed, rolling out r70665.
+        http://trac.webkit.org/changeset/70665
+        https://bugs.webkit.org/show_bug.cgi?id=47089
+
+        Need to address Alexey's review comments.
+
+        * public/WebSpeechInputController.h:
+        (WebKit::WebSpeechInputController::startRecognition):
+        * public/WebSpeechInputControllerMock.h:
+        * src/SpeechInputClientImpl.cpp:
+        (WebKit::SpeechInputClientImpl::startRecognition):
+        * src/SpeechInputClientImpl.h:
+        * src/WebSpeechInputControllerMockImpl.cpp:
+        (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+        (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+        * src/WebSpeechInputControllerMockImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        * src/WebViewImpl.h:
+
 2010-10-27  ZHenyao Mo  <zmo at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h
index ce4b8b3..63250cd 100644
--- a/WebKit/chromium/public/WebSpeechInputController.h
+++ b/WebKit/chromium/public/WebSpeechInputController.h
@@ -35,7 +35,6 @@
 
 namespace WebKit {
 
-class WebString;
 struct WebRect;
 class WebString;
 
@@ -45,14 +44,14 @@ public:
     // Starts speech recognition. Speech will get recorded until the endpointer detects silence,
     // runs to the limit or stopRecording is called. Progress indications and the recognized
     // text are returned via the listener interface.
-    virtual bool startRecognition(int requestId, const WebString& language, const WebRect& elementRect, const WebString& grammar)
+    virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar)
     {
-        startRecognition(requestId, language, elementRect);
+        startRecognition(requestId, elementRect);
         return false;
     }
 
     // FIXME: Remove this method once chromium implements the above method.
-    virtual bool startRecognition(int requestId, const WebString& language, const WebRect& elementRect)
+    virtual bool startRecognition(int requestId, const WebRect&)
     {
         WEBKIT_ASSERT_NOT_REACHED();
         return false;
diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h
index b4c50a0..9a26235 100644
--- a/WebKit/chromium/public/WebSpeechInputControllerMock.h
+++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h
@@ -44,10 +44,6 @@ public:
         WebSpeechInputListener* listener);
     virtual ~WebSpeechInputControllerMock() { }
 
-    virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0;
-
-    // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
-    // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
     virtual void setMockRecognitionResult(const WebString& result) = 0;
 };
 
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 242a174..672de63 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -32,21 +32,15 @@
 #include "SpeechInputClientImpl.h"
 
 #include "PlatformString.h"
-#include "SpeechInputListener.h"
 #include "WebSpeechInputController.h"
 #include "WebString.h"
 #include "WebViewClient.h"
-#include <wtf/PassOwnPtr.h>
+#include "page/SpeechInputListener.h"
 
 #if ENABLE(INPUT_SPEECH)
 
 namespace WebKit {
 
-PassOwnPtr<SpeechInputClientImpl> SpeechInputClientImpl::create(WebViewClient* client)
-{
-    return adoptPtr(new SpeechInputClientImpl(client));
-}
-
 SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client)
     : m_controller(web_view_client ? web_view_client->speechInputController(this) : 0)
     , m_listener(0)
@@ -62,10 +56,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener)
     m_listener = listener;
 }
 
-bool SpeechInputClientImpl::startRecognition(int requestId, const String& language, const WebCore::IntRect& elementRect, const String& grammar)
+bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const WTF::String& grammar)
 {
     ASSERT(m_listener);
-    return m_controller->startRecognition(requestId, language, elementRect, grammar);
+    return m_controller->startRecognition(requestId, elementRect, grammar);
 }
 
 void SpeechInputClientImpl::stopRecording(int requestId)
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h
index 9e5961f..d2db453 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.h
+++ b/WebKit/chromium/src/SpeechInputClientImpl.h
@@ -33,11 +33,8 @@
 
 #if ENABLE(INPUT_SPEECH)
 
-#include "SpeechInputClient.h"
 #include "WebSpeechInputListener.h"
-#include <wtf/Forward.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
+#include "page/SpeechInputClient.h"
 
 namespace WebCore {
 class SpeechInputListener;
@@ -52,12 +49,12 @@ class SpeechInputClientImpl
     : public WebCore::SpeechInputClient,
       public WebSpeechInputListener {
 public:
-    static PassOwnPtr<SpeechInputClientImpl> create(WebViewClient*);
+    SpeechInputClientImpl(WebViewClient*);
     virtual ~SpeechInputClientImpl();
 
     // SpeechInputClient methods.
     void setListener(WebCore::SpeechInputListener*);
-    bool startRecognition(int requestId, const String& language, const WebCore::IntRect& elementRect, const String& grammar);
+    bool startRecognition(int requestId, const WebCore::IntRect& elementRect, const WTF::String& grammar);
     void stopRecording(int);
     void cancelRecognition(int);
 
@@ -67,8 +64,6 @@ public:
     void didCompleteRecognition(int);
 
 private:
-    SpeechInputClientImpl(WebViewClient*);
-
     WebSpeechInputController* m_controller; // To call into the embedder.
     WebCore::SpeechInputListener* m_listener;
 };
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
index 0a176fd..98cc6cf 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -57,12 +57,7 @@ WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl()
 
 void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result)
 {
-    m_webcoreMock->setRecognitionResult(result, WebString::fromUTF8(""));
-}
-
-void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language)
-{
-    m_webcoreMock->setRecognitionResult(result, language);
+    m_webcoreMock->setRecognitionResult(result);
 }
 
 void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId)
@@ -80,9 +75,9 @@ void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const
     m_listener->setRecognitionResult(requestId, result);
 }
 
-bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebString& language, const WebRect& elementRect, const WebString& grammar)
+bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar)
 {
-    return m_webcoreMock->startRecognition(requestId, language, elementRect, grammar);
+    return m_webcoreMock->startRecognition(requestId, elementRect, grammar);
 }
 
 void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId)
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
index 06ab8c2..146793a 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -57,15 +57,11 @@ public:
     void setRecognitionResult(int requestId, const WebCore::SpeechInputResultArray& result);
 
     // WebSpeechInputController methods.
-    bool startRecognition(int requestId, const WebString& language, const WebRect& elementRect, const WebString& grammar);
+    bool startRecognition(int requestId, const WebRect& elementRect, const WebString& grammar);
     void cancelRecognition(int requestId);
     void stopRecording(int requestId);
 
     // WebSpeechInputControllerMock methods.
-    void setMockRecognitionResult(const WebString& result, const WebString& language);
-
-    // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
-    // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
     void setMockRecognitionResult(const WebString& result);
 
 private:
@@ -76,3 +72,4 @@ private:
 } // namespace WebKit
 
 #endif // WebSpeechInputControllerMockImpl_h
+
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 6782a23..9faedac 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -88,7 +88,6 @@
 #include "SecurityOrigin.h"
 #include "SelectionController.h"
 #include "Settings.h"
-#include "SpeechInputClientImpl.h"
 #include "Timer.h"
 #include "TypingCommand.h"
 #include "UserGestureIndicator.h"
@@ -283,7 +282,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
     , m_compositorCreationFailed(false)
 #endif
 #if ENABLE(INPUT_SPEECH)
-    , m_speechInputClient(SpeechInputClientImpl::create(client))
+    , m_speechInputClient(client)
 #endif
     , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))
 {
@@ -306,7 +305,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
     pageClients.dragClient = &m_dragClientImpl;
     pageClients.inspectorClient = &m_inspectorClientImpl;
 #if ENABLE(INPUT_SPEECH)
-    pageClients.speechInputClient = m_speechInputClient.get();
+    pageClients.speechInputClient = &m_speechInputClient;
 #endif
     pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get();
 
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 0388770..c3fd39e 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -49,6 +49,7 @@
 #include "IntRect.h"
 #include "LayerRendererChromium.h"
 #include "NotificationPresenterImpl.h"
+#include "SpeechInputClientImpl.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/RefCounted.h>
 
@@ -73,7 +74,6 @@ class AutoFillPopupMenuClient;
 class ContextMenuClientImpl;
 class DeviceOrientationClientProxy;
 class DragScrollTimer;
-class SpeechInputClientImpl;
 class WebAccessibilityObject;
 class WebDevToolsAgentClient;
 class WebDevToolsAgentPrivate;
@@ -548,7 +548,7 @@ private:
     static const WebInputEvent* m_currentInputEvent;
 
 #if ENABLE(INPUT_SPEECH)
-    OwnPtr<SpeechInputClientImpl> m_speechInputClient;
+    SpeechInputClientImpl m_speechInputClient;
 #endif
     // If we attempt to fetch the on-screen GraphicsContext3D before
     // the compositor has been turned on, we need to instantiate it
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 05eaccf..c1e813e 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,28 @@
+2010-10-27  Satish Sampath  <satish at chromium.org>
+
+        Unreviewed, rolling out r70665.
+        http://trac.webkit.org/changeset/70665
+        https://bugs.webkit.org/show_bug.cgi?id=47089
+
+        Need to address Alexey's review comments.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setMockSpeechInputResultCallback):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::setMockSpeechInputResult):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setMockSpeechInputResult):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setMockSpeechInputResult):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setMockSpeechInputResult):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setMockSpeechInputResult):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::setMockSpeechInputResult):
+
 2010-10-27  Leandro Gracia Gil  <leandrogracia at google.com>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 9619389..83655bd 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -1078,17 +1078,14 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject
 
 static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    if (argumentCount < 2)
+    if (argumentCount < 1)
         return JSValueMakeUndefined(context);
 
     JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[0], exception));
     ASSERT(!*exception);
 
-    JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception));
-    ASSERT(!*exception);
-
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    controller->setMockSpeechInputResult(result.get(), language.get());
+    controller->setMockSpeechInputResult(result.get());
 
     return JSValueMakeUndefined(context);
 }
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index b61860b..27518b7 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -94,7 +94,7 @@ public:
     void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
     void setMockGeolocationError(int code, JSStringRef message);
     void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
-    void setMockSpeechInputResult(JSStringRef result, JSStringRef language);
+    void setMockSpeechInputResult(JSStringRef result);
     void setPersistentUserStyleSheetLocation(JSStringRef path);
     void setPluginsEnabled(bool flag);
     void setPopupBlockingEnabled(bool flag);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index d713b04..1a6187e 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -1534,10 +1534,10 @@ void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVaria
 void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();
-    if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())
+    if (arguments.size() < 1 || !arguments[0].isString())
         return;
 
-    m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));
+    m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]));
 }
 
 WebKit::WebSpeechInputController* LayoutTestController::speechInputController(WebKit::WebSpeechInputListener* listener)
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 688b3f8..04d97eb 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -501,7 +501,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     setGeolocationPermissionCommon(allow);
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 150b6f9..c5d5a90 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -371,7 +371,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     [[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index f99ec4f..b2c3807 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -765,7 +765,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo
     DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
 }
 
-void LayoutTestController::setMockSpeechInputResult(const QString& result, const QString& language)
+void LayoutTestController::setMockSpeechInputResult(const QString& result)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 11d72e4..68ebe1d 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -216,7 +216,7 @@ public slots:
     bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
     bool geolocationPermission() const { return m_geolocationPermission; }
 
-    void setMockSpeechInputResult(const QString& result, const QString& language);
+    void setMockSpeechInputResult(const QString& result);
 
     // Empty stub method to keep parity with object model exposed by global LayoutTestController.
     void abortModal() {}
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index d7c41e0..9e8ed1e 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -405,7 +405,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     setGeolocationPermissionCommon(allow);
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index 32614c1..eefc587 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -320,7 +320,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     setGeolocationPermissionCommon(allow);
 }
 
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
@@ -528,3 +528,4 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pa
     // FIXME: Implement
     return 0;
 }
+

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list