Title: [91898] trunk/Tools
Revision
91898
Author
commit-qu...@webkit.org
Date
2011-07-27 21:08:40 -0700 (Wed, 27 Jul 2011)

Log Message

[EFL] Drop WorkQueueItemEfl.h in favour of the general WorkQueueItem.h
https://bugs.webkit.org/show_bug.cgi?id=65269

Patch by Raphael Kubo da Costa <k...@profusion.mobi> on 2011-07-27
Reviewed by Kent Tamura.

WorkQueueItemEfl.h was being included by efl's
LayoutTestControllerEfl.cpp, however the top-level
LayoutTestController still included WorkQueueItem.h, causing a lot of
type mismatches when running the WorkQueueItem code.

We can stick to the original WorkQueueItem header by making a few
changes to EFL's LayoutTestController.

This should make tests such as
fast/loader/non-deferred-substitute-load.html stop crashing.

* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::queueLoad):
* DumpRenderTree/efl/WorkQueueItemEfl.cpp:
(LoadItem::invoke):
(LoadHTMLStringItem::invoke):
(ScriptItem::invoke):
* DumpRenderTree/efl/WorkQueueItemEfl.h: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Tools/ChangeLog (91897 => 91898)


--- trunk/Tools/ChangeLog	2011-07-28 03:56:00 UTC (rev 91897)
+++ trunk/Tools/ChangeLog	2011-07-28 04:08:40 UTC (rev 91898)
@@ -1,3 +1,29 @@
+2011-07-27  Raphael Kubo da Costa  <k...@profusion.mobi>
+
+        [EFL] Drop WorkQueueItemEfl.h in favour of the general WorkQueueItem.h
+        https://bugs.webkit.org/show_bug.cgi?id=65269
+
+        Reviewed by Kent Tamura.
+
+        WorkQueueItemEfl.h was being included by efl's
+        LayoutTestControllerEfl.cpp, however the top-level
+        LayoutTestController still included WorkQueueItem.h, causing a lot of
+        type mismatches when running the WorkQueueItem code.
+
+        We can stick to the original WorkQueueItem header by making a few
+        changes to EFL's LayoutTestController.
+
+        This should make tests such as
+        fast/loader/non-deferred-substitute-load.html stop crashing.
+
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::queueLoad):
+        * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
+        (LoadItem::invoke):
+        (LoadHTMLStringItem::invoke):
+        (ScriptItem::invoke):
+        * DumpRenderTree/efl/WorkQueueItemEfl.h: Removed.
+
 2011-07-27  Dimitri Glazkov  <dglaz...@chromium.org>
 
         Re-add unit tests I accidentally zapped in r91878.

Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (91897 => 91898)


--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2011-07-28 03:56:00 UTC (rev 91897)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2011-07-28 04:08:40 UTC (rev 91898)
@@ -41,7 +41,7 @@
 #include "NotImplemented.h"
 #include "OwnFastMallocPtr.h"
 #include "WorkQueue.h"
-#include "WorkQueueItemEfl.h"
+#include "WorkQueueItem.h"
 #include "ewk_private.h"
 #include <EWebKit.h>
 #include <_javascript_Core/JSRetainPtr.h>
@@ -176,9 +176,11 @@
 {
     String absoluteUrl = String::fromUTF8(ewk_frame_uri_get(mainFrame));
     absoluteUrl.append(url->characters(), url->length());
-    String targetString(target->characters(), target->length());
 
-    WorkQueue::shared()->queue(new LoadItem(absoluteUrl, targetString));
+    JSRetainPtr<JSStringRef> jsAbsoluteURL(
+        Adopt, JSStringCreateWithUTF8CString(absoluteUrl.utf8().data()));
+
+    WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target));
 }
 
 void LayoutTestController::setAcceptsEditing(bool acceptsEditing)

Modified: trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp (91897 => 91898)


--- trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp	2011-07-28 03:56:00 UTC (rev 91897)
+++ trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp	2011-07-28 04:08:40 UTC (rev 91898)
@@ -20,34 +20,36 @@
  */
 
 #include "config.h"
-#include "WorkQueueItemEfl.h"
+#include "WorkQueueItem.h"
 
 #include "DumpRenderTree.h"
 
 #include <EWebKit.h>
 #include <_javascript_Core/JSStringRef.h>
+#include <_javascript_Core/OpaqueJSString.h>
+#include <_javascript_Core/runtime/UString.h>
 #include <_javascript_Core/wtf/text/CString.h>
 
 bool LoadItem::invoke() const
 {
     Evas_Object* targetFrame;
 
-    if (m_target.isEmpty())
+    if (!m_target->length())
         targetFrame = mainFrame;
     else
-        targetFrame = ewk_frame_child_find(mainFrame, m_target.utf8().data());
+        targetFrame = ewk_frame_child_find(mainFrame, m_target->ustring().utf8().data());
 
-    ewk_frame_uri_set(targetFrame, m_url.utf8().data());
+    ewk_frame_uri_set(targetFrame, m_url->ustring().utf8().data());
 
     return true;
 }
 
 bool LoadHTMLStringItem::invoke() const
 {
-    if (m_unreachableURL.isEmpty())
-        ewk_frame_contents_set(mainFrame, m_content.utf8().data(), 0, 0, 0, m_baseURL.utf8().data());
+    if (!m_unreachableURL->length())
+        ewk_frame_contents_set(mainFrame, m_content->ustring().utf8().data(), 0, 0, 0, m_baseURL->ustring().utf8().data());
     else
-        ewk_frame_contents_alternate_set(mainFrame, m_content.utf8().data(), 0, 0, 0, m_baseURL.utf8().data(), m_unreachableURL.utf8().data());
+        ewk_frame_contents_alternate_set(mainFrame, m_content->ustring().utf8().data(), 0, 0, 0, m_baseURL->ustring().utf8().data(), m_unreachableURL->ustring().utf8().data());
 
     return true;
 }
@@ -60,7 +62,7 @@
 
 bool ScriptItem::invoke() const
 {
-    return ewk_frame_script_execute(mainFrame, m_script.utf8().data());
+    return ewk_frame_script_execute(mainFrame, m_script->ustring().utf8().data());
 }
 
 bool BackForwardItem::invoke() const

Deleted: trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.h (91897 => 91898)


--- trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.h	2011-07-28 03:56:00 UTC (rev 91897)
+++ trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.h	2011-07-28 04:08:40 UTC (rev 91898)
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2011 ProFUSION Embedded Systems
- * Copyright (C) 2011 Samsung Electronics
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR 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.
- */
-
-#ifndef WorkQueueItemEfl_h
-#define WorkQueueItemEfl_h
-
-#include <_javascript_Core/wtf/text/WTFString.h>
-
-class WorkQueueItem {
-public:
-    virtual ~WorkQueueItem() { }
-    virtual bool invoke() const = 0; // Returns true if this started a load.
-};
-
-class LoadItem : public WorkQueueItem {
-public:
-    LoadItem(const WTF::String& url, const WTF::String& target)
-        : m_target(target)
-        , m_url(url)
-    {
-    }
-
-    virtual bool invoke() const;
-
-private:
-    WTF::String m_target;
-    WTF::String m_url;
-};
-
-class LoadHTMLStringItem : public WorkQueueItem {
-public:
-    LoadHTMLStringItem(const WTF::String& content, const WTF::String& baseURL, const WTF::String& unreachableURL = WTF::String())
-        : m_content(content)
-        , m_baseURL(baseURL)
-        , m_unreachableURL(unreachableURL)
-    {
-    }
-
-private:
-    virtual bool invoke() const;
-
-    WTF::String m_content;
-    WTF::String m_baseURL;
-    WTF::String m_unreachableURL;
-};
-
-class ReloadItem : public WorkQueueItem {
-private:
-    virtual bool invoke() const;
-};
-
-class ScriptItem : public WorkQueueItem {
-protected:
-    ScriptItem(const WTF::String& script)
-        : m_script(script)
-    {
-    }
-
-protected:
-    virtual bool invoke() const;
-
-private:
-    WTF::String m_script;
-};
-
-class LoadingScriptItem : public ScriptItem {
-public:
-    LoadingScriptItem(const WTF::String& script)
-        : ScriptItem(script)
-    {
-    }
-
-private:
-    virtual bool invoke() const { return ScriptItem::invoke(); }
-};
-
-class NonLoadingScriptItem : public ScriptItem {
-public:
-    NonLoadingScriptItem(const WTF::String& script)
-        : ScriptItem(script)
-    {
-    }
-
-private:
-    virtual bool invoke() const { ScriptItem::invoke(); return false; }
-};
-
-class BackForwardItem : public WorkQueueItem {
-protected:
-    BackForwardItem(int howFar)
-        : m_howFar(howFar)
-    {
-    }
-
-private:
-    virtual bool invoke() const;
-
-    int m_howFar;
-};
-
-class BackItem : public BackForwardItem {
-public:
-    BackItem(unsigned howFar)
-        : BackForwardItem(-howFar)
-    {
-    }
-};
-
-class ForwardItem : public BackForwardItem {
-public:
-    ForwardItem(unsigned howFar)
-        : BackForwardItem(howFar)
-    {
-    }
-};
-
-#endif // WorkQueueEfl_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to