Changeset 116470 in webkit


Ignore:
Timestamp:
May 8, 2012 5:42:52 PM (12 years ago)
Author:
rakuco@webkit.org
Message:

[EFL] Pass a WTF::String directly from DRT to ewebkit when possible
https://bugs.webkit.org/show_bug.cgi?id=84634

Reviewed by Gustavo Noronha Silva.

Drop unnecessary const char* -> WTF::String conversions by
creating String objects directly in LayoutTestController out of
JSStringRef's and passing them to DumpRenderTreeSupportEfl.

Source/WebKit/efl:

  • WebCoreSupport/DumpRenderTreeSupportEfl.cpp:

(DumpRenderTreeSupportEfl::setValueForUser):
(DumpRenderTreeSupportEfl::addUserStyleSheet):
(DumpRenderTreeSupportEfl::findString):

  • WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools:

  • DumpRenderTree/efl/LayoutTestControllerEfl.cpp:

(LayoutTestController::queueLoad):
(LayoutTestController::setValueForUser):
(LayoutTestController::findString):
(LayoutTestController::addUserStyleSheet):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r116413 r116470  
     12012-04-23  Raphael Kubo da Costa  <rakuco@webkit.org>
     2
     3        [EFL] Pass a WTF::String directly from DRT to ewebkit when possible
     4        https://bugs.webkit.org/show_bug.cgi?id=84634
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Drop unnecessary const char* -> WTF::String conversions by
     9        creating String objects directly in LayoutTestController out of
     10        JSStringRef's and passing them to DumpRenderTreeSupportEfl.
     11
     12        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
     13        (DumpRenderTreeSupportEfl::setValueForUser):
     14        (DumpRenderTreeSupportEfl::addUserStyleSheet):
     15        (DumpRenderTreeSupportEfl::findString):
     16        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
     17
    1182012-05-08  Krzysztof Czech  <k.czech@samsung.com>
    219
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp

    r116285 r116470  
    4848#include <history/HistoryItem.h>
    4949#include <workers/WorkerThread.h>
    50 #include <wtf/OwnArrayPtr.h>
    51 #include <wtf/text/AtomicString.h>
    5250
    5351unsigned DumpRenderTreeSupportEfl::activeAnimationsCount(const Evas_Object* ewkFrame)
     
    337335}
    338336
    339 void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
     337void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef nodeObject, const String& value)
    340338{
    341339    JSC::ExecState* exec = toJS(context);
     
    347345        return;
    348346
    349     size_t bufferSize = JSStringGetMaximumUTF8CStringSize(value);
    350     OwnArrayPtr<char> valueBuffer = adoptArrayPtr(new char[bufferSize]);
    351     JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize);
    352     inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
     347    inputElement->setValueForUser(value);
    353348}
    354349
     
    385380}
    386381
    387 void DumpRenderTreeSupportEfl::addUserStyleSheet(const Evas_Object* ewkView, const char* sourceCode, bool allFrames)
     382void DumpRenderTreeSupportEfl::addUserStyleSheet(const Evas_Object* ewkView, const String& sourceCode, bool allFrames)
    388383{
    389384    WebCore::Page* page = EWKPrivate::corePage(ewkView);
     
    403398}
    404399
    405 bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions options)
    406 {
    407     WebCore::Page* page = EWKPrivate::corePage(ewkView);
    408 
    409     if (!page)
    410         return false;
    411 
    412     return page->findString(String::fromUTF8(text), options);
     400bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions options)
     401{
     402    WebCore::Page* page = EWKPrivate::corePage(ewkView);
     403
     404    if (!page)
     405        return false;
     406
     407    return page->findString(text, options);
    413408}
    414409
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h

    r116285 r116470  
    6767    static String suitableDRTFrameName(const Evas_Object* ewkFrame);
    6868    static void suspendAnimations(Evas_Object* ewkFrame);
    69     static void setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value);
     69    static void setValueForUser(JSContextRef, JSValueRef nodeObject, const String& value);
    7070    static void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled);
    7171    static void setDefersLoading(Evas_Object* ewkView, bool defers);
    7272    static void setLoadsSiteIconsIgnoringImageLoadingSetting(Evas_Object* ewkView, bool loadsSiteIconsIgnoringImageLoadingPreferences);
    7373
    74     static void addUserStyleSheet(const Evas_Object* ewkView, const char* sourceCode, bool allFrames);
     74    static void addUserStyleSheet(const Evas_Object* ewkView, const String& sourceCode, bool allFrames);
    7575    static void executeCoreCommandByName(const Evas_Object* ewkView, const char* name, const char* value);
    76     static bool findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions);
     76    static bool findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions);
    7777    static bool isCommandEnabled(const Evas_Object* ewkView, const char* name);
    7878    static void setJavaScriptProfilingEnabled(const Evas_Object* ewkView, bool enabled);
  • trunk/Tools/ChangeLog

    r116464 r116470  
     12012-04-23  Raphael Kubo da Costa  <rakuco@webkit.org>
     2
     3        [EFL] Pass a WTF::String directly from DRT to ewebkit when possible
     4        https://bugs.webkit.org/show_bug.cgi?id=84634
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Drop unnecessary const char* -> WTF::String conversions by
     9        creating String objects directly in LayoutTestController out of
     10        JSStringRef's and passing them to DumpRenderTreeSupportEfl.
     11
     12        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
     13        (LayoutTestController::queueLoad):
     14        (LayoutTestController::setValueForUser):
     15        (LayoutTestController::findString):
     16        (LayoutTestController::addUserStyleSheet):
     17
    1182012-05-08  Alexander Shalamov  <alexander.shalamov@intel.com>
    219
  • trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp

    r116416 r116470  
    185185{
    186186    WebCore::KURL baseURL(WebCore::KURL(), String::fromUTF8(ewk_frame_uri_get(browser->mainFrame())));
    187     WebCore::KURL absoluteURL(baseURL, WTF::String(url->characters(), url->length()));
     187    WebCore::KURL absoluteURL(baseURL, WTF::String(url->ustring().impl()));
    188188
    189189    JSRetainPtr<JSStringRef> jsAbsoluteURL(
     
    271271void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
    272272{
    273     DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, value);
     273    DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, WTF::String(value->ustring().impl()));
    274274}
    275275
     
    516516    }
    517517
    518     return DumpRenderTreeSupportEfl::findString(browser->mainView(), target->ustring().utf8().data(), options);
     518    return DumpRenderTreeSupportEfl::findString(browser->mainView(), WTF::String(target->ustring().impl()), options);
    519519}
    520520
     
    702702void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
    703703{
    704     DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), source->ustring().utf8().data(), allFrames);
     704    DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), WTF::String(source->ustring().impl()), allFrames);
    705705}
    706706
Note: See TracChangeset for help on using the changeset viewer.