- Revision
- 118962
- Author
- [email protected]
- Date
- 2012-05-30 13:47:07 -0700 (Wed, 30 May 2012)
Log Message
[EFL] Ewk_Intent_Request's postResult/postFailure should take serialized script values in argument
https://bugs.webkit.org/show_bug.cgi?id=87829
Patch by Christophe Dumez <[email protected]> on 2012-05-30
Reviewed by Adam Barth.
Source/WebKit/efl:
Ewk_Intent_Request's postResult/postFailure methods now take
SerializedScriptValues in argument instead of strings. The client can
now post results of any type, not just strings, which is according to
spec. Those methods are now moved to private header and a helper
function was added to DumpRenderTreeSupportEfl so that the DRT can
still send intent results.
* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::sendWebIntentResponse):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
* ewk/ewk_intent_private.h:
(WebCore):
* ewk/ewk_intent_request.cpp:
(ewk_intent_request_result_post):
(ewk_intent_request_failure_post):
* ewk/ewk_intent_request.h:
Tools:
EFL's LayoutTestController now makes uses of the new helper method in
DumpRenderTreeSupportEfl in order to send the intent response. This is
now needed because the Ewk_Intent_Request postResult / postFailure
methods were made private.
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::sendWebIntentResponse):
Modified Paths
Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (118961 => 118962)
--- trunk/Source/WebKit/efl/ChangeLog 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Source/WebKit/efl/ChangeLog 2012-05-30 20:47:07 UTC (rev 118962)
@@ -1,3 +1,27 @@
+2012-05-30 Christophe Dumez <[email protected]>
+
+ [EFL] Ewk_Intent_Request's postResult/postFailure should take serialized script values in argument
+ https://bugs.webkit.org/show_bug.cgi?id=87829
+
+ Reviewed by Adam Barth.
+
+ Ewk_Intent_Request's postResult/postFailure methods now take
+ SerializedScriptValues in argument instead of strings. The client can
+ now post results of any type, not just strings, which is according to
+ spec. Those methods are now moved to private header and a helper
+ function was added to DumpRenderTreeSupportEfl so that the DRT can
+ still send intent results.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::sendWebIntentResponse):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+ * ewk/ewk_intent_private.h:
+ (WebCore):
+ * ewk/ewk_intent_request.cpp:
+ (ewk_intent_request_result_post):
+ (ewk_intent_request_failure_post):
+ * ewk/ewk_intent_request.h:
+
2012-05-29 Christophe Dumez <[email protected]>
[EFL] Compilation warning in DumpRenderTreeView.cpp
Modified: trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp (118961 => 118962)
--- trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp 2012-05-30 20:47:07 UTC (rev 118962)
@@ -24,6 +24,7 @@
#include "FrameLoaderClientEfl.h"
#include "ewk_frame_private.h"
#include "ewk_history_private.h"
+#include "ewk_intent_private.h"
#include "ewk_private.h"
#include "ewk_view_private.h"
@@ -43,6 +44,7 @@
#include <IntRect.h>
#include <JSCSSStyleDeclaration.h>
#include <JSElement.h>
+#include <_javascript_Core/OpaqueJSString.h>
#include <MemoryCache.h>
#include <PageGroup.h>
#include <PrintContext.h>
@@ -666,6 +668,17 @@
WebCore::resourceLoadScheduler()->setSerialLoadingEnabled(enabled);
}
+void DumpRenderTreeSupportEfl::sendWebIntentResponse(Ewk_Intent_Request* request, JSStringRef response)
+{
+#if ENABLE(WEB_INTENTS)
+ JSC::UString responseString = response->ustring();
+ if (responseString.isNull())
+ ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));
+ else
+ ewk_intent_request_result_post(request, WebCore::SerializedScriptValue::create(String(responseString.impl())));
+#endif
+}
+
void DumpRenderTreeSupportEfl::setComposition(Evas_Object* ewkView, const char* text, int start, int length)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
Modified: trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h (118961 => 118962)
--- trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h 2012-05-30 20:47:07 UTC (rev 118962)
@@ -31,6 +31,7 @@
typedef struct _Evas_Object Evas_Object;
typedef struct _Ewk_History_Item Ewk_History_Item;
+typedef struct _Ewk_Intent_Request Ewk_Intent_Request;
typedef Vector<Ewk_History_Item*> HistoryItemChildrenVector;
@@ -104,6 +105,7 @@
static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
static void setAuthorAndUserStylesEnabled(Evas_Object* ewkView, bool);
static void setSerializeHTTPLoads(bool);
+ static void sendWebIntentResponse(Ewk_Intent_Request*, JSStringRef response);
// TextInputController
static void setComposition(Evas_Object*, const char*, int, int);
Modified: trunk/Source/WebKit/efl/ewk/ewk_intent_private.h (118961 => 118962)
--- trunk/Source/WebKit/efl/ewk/ewk_intent_private.h 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Source/WebKit/efl/ewk/ewk_intent_private.h 2012-05-30 20:47:07 UTC (rev 118962)
@@ -29,11 +29,15 @@
namespace WebCore {
class Intent;
class IntentRequest;
+class SerializedScriptValue;
}
Ewk_Intent* ewk_intent_new(WebCore::Intent* core);
void ewk_intent_free(Ewk_Intent* intent);
Ewk_Intent_Request* ewk_intent_request_new(PassRefPtr<WebCore::IntentRequest> core);
+
+void ewk_intent_request_result_post(Ewk_Intent_Request* request, PassRefPtr<WebCore::SerializedScriptValue> result);
+void ewk_intent_request_failure_post(Ewk_Intent_Request* request, PassRefPtr<WebCore::SerializedScriptValue> failure);
#endif
#endif // ewk_intent_private_h
Modified: trunk/Source/WebKit/efl/ewk/ewk_intent_request.cpp (118961 => 118962)
--- trunk/Source/WebKit/efl/ewk/ewk_intent_request.cpp 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Source/WebKit/efl/ewk/ewk_intent_request.cpp 2012-05-30 20:47:07 UTC (rev 118962)
@@ -80,27 +80,43 @@
#endif
}
-void ewk_intent_request_result_post(Ewk_Intent_Request* request, const char* result)
+#if ENABLE(WEB_INTENTS)
+/**
+ * @internal
+ *
+ * Report request success.
+ *
+ * The serialized payload data will be passed to the success callback registered by the
+ * client.
+ *
+ * @param request request item.
+ * @param result serialized payload data.
+ */
+void ewk_intent_request_result_post(Ewk_Intent_Request* request, PassRefPtr<WebCore::SerializedScriptValue> result)
{
-#if ENABLE(WEB_INTENTS)
EWK_INTENT_REQUEST_CORE_GET_OR_RETURN(request, core);
- RefPtr<WebCore::SerializedScriptValue> value = WebCore::SerializedScriptValue::create(String::fromUTF8(result));
- core->postResult(value.release().leakRef());
-#endif
+ core->postResult(result.get());
}
-void ewk_intent_request_failure_post(Ewk_Intent_Request* request, const char* failure)
+/**
+ * @internal
+ *
+ * Report request failure.
+ *
+ * The serialized payload data will be passed to the error callback registered by the
+ * client.
+ *
+ * @param request request item.
+ * @param failure serialized payload data.
+ */
+void ewk_intent_request_failure_post(Ewk_Intent_Request* request, PassRefPtr<WebCore::SerializedScriptValue> failure)
{
-#if ENABLE(WEB_INTENTS)
EWK_INTENT_REQUEST_CORE_GET_OR_RETURN(request, core);
- RefPtr<WebCore::SerializedScriptValue> value = WebCore::SerializedScriptValue::create(String::fromUTF8(failure));
- core->postFailure(value.release().leakRef());
-#endif
+ core->postFailure(failure.get());
}
-#if ENABLE(WEB_INTENTS)
/**
* @internal
*
Modified: trunk/Source/WebKit/efl/ewk/ewk_intent_request.h (118961 => 118962)
--- trunk/Source/WebKit/efl/ewk/ewk_intent_request.h 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Source/WebKit/efl/ewk/ewk_intent_request.h 2012-05-30 20:47:07 UTC (rev 118962)
@@ -56,26 +56,6 @@
*/
EAPI Ewk_Intent *ewk_intent_request_intent_get(const Ewk_Intent_Request *request);
-/**
- * Report request success.
- *
- * The payload data will be passed to the success callback registered by the client.
- *
- * @param request request item.
- * @param result payload data.
- */
-EAPI void ewk_intent_request_result_post(Ewk_Intent_Request *request, const char *result);
-
-/**
- * Report request failure.
- *
- * The payload data will be passed to the error callback registered by the client.
- *
- * @param request request item.
- * @param failure payload data.
- */
-EAPI void ewk_intent_request_failure_post(Ewk_Intent_Request *request, const char *failure);
-
#ifdef __cplusplus
}
#endif
Modified: trunk/Tools/ChangeLog (118961 => 118962)
--- trunk/Tools/ChangeLog 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Tools/ChangeLog 2012-05-30 20:47:07 UTC (rev 118962)
@@ -1,3 +1,18 @@
+2012-05-30 Christophe Dumez <[email protected]>
+
+ [EFL] Ewk_Intent_Request's postResult/postFailure should take serialized script values in argument
+ https://bugs.webkit.org/show_bug.cgi?id=87829
+
+ Reviewed by Adam Barth.
+
+ EFL's LayoutTestController now makes uses of the new helper method in
+ DumpRenderTreeSupportEfl in order to send the intent response. This is
+ now needed because the Ewk_Intent_Request postResult / postFailure
+ methods were made private.
+
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::sendWebIntentResponse):
+
2012-05-30 Xueqing Huang <[email protected]>
eventSender.beginDragWithFiles should be implemented in Windows, which blocked drag and drop related tests.
Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (118961 => 118962)
--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp 2012-05-30 20:30:51 UTC (rev 118961)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp 2012-05-30 20:47:07 UTC (rev 118962)
@@ -883,9 +883,5 @@
if (!request)
return;
- JSC::UString responseString = response->ustring();
- if (responseString.isNull())
- ewk_intent_request_failure_post(request, "ERROR");
- else
- ewk_intent_request_result_post(request, responseString.utf8().data());
+ DumpRenderTreeSupportEfl::sendWebIntentResponse(request, response);
}