Title: [147960] trunk
Revision
147960
Author
[email protected]
Date
2013-04-08 16:18:01 -0700 (Mon, 08 Apr 2013)

Log Message

[BlackBerry] Update BlackBerry _javascript_ API
https://bugs.webkit.org/show_bug.cgi?id=114065

Patch by Jeff Rogers <[email protected]> on 2013-04-08
Reviewed by Rob Buis.

.:

Internal PR 317350
Export JSC symbols in BlackBerry build.

* Source/cmake/OptionsBlackBerry.cmake:

Source/WebKit:

Internal PR 317350
Remove obsolete files.

* PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

Internal PR 317350
Add new API for determining if user gesture is being processed.
Remove obsolete files.
Properly expose JSC global context.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPage::executeJavaScriptFunction):
(BlackBerry::WebKit::WebPage::globalContext):
(BlackBerry::WebKit::WebPage::isProcessingUserGesture):
(WebKit):
* Api/WebPage.h:
* Api/WebPageClient.h:
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
* WebCoreSupport/ChromeClientBlackBerry.h:
(ChromeClientBlackBerry):
* WebCoreSupport/ClientExtension.cpp: Removed.
* WebCoreSupport/ClientExtension.h: Removed.
* WebCoreSupport/ExternalExtension.cpp: Removed.
* WebCoreSupport/ExternalExtension.h: Removed.
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidClearWindowObjectInWorld):

Modified Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (147959 => 147960)


--- trunk/ChangeLog	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/ChangeLog	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,3 +1,15 @@
+2013-04-08  Jeff Rogers  <[email protected]>
+
+        [BlackBerry] Update BlackBerry _javascript_ API
+        https://bugs.webkit.org/show_bug.cgi?id=114065
+
+        Reviewed by Rob Buis.
+
+        Internal PR 317350
+        Export JSC symbols in BlackBerry build.
+
+        * Source/cmake/OptionsBlackBerry.cmake:
+
 2013-04-08  Martin Robinson  <[email protected]>
 
         [GTK] Configure should verify ICU is installed on mingw

Modified: trunk/Source/WebKit/ChangeLog (147959 => 147960)


--- trunk/Source/WebKit/ChangeLog	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/ChangeLog	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,3 +1,15 @@
+2013-04-08  Jeff Rogers  <[email protected]>
+
+        [BlackBerry] Update BlackBerry _javascript_ API
+        https://bugs.webkit.org/show_bug.cgi?id=114065
+
+        Reviewed by Rob Buis.
+
+        Internal PR 317350
+        Remove obsolete files.
+
+        * PlatformBlackBerry.cmake:
+
 2013-04-07  Patrick Gansterer  <[email protected]>
 
         Remove references to Skia and V8 from CMake files

Modified: trunk/Source/WebKit/PlatformBlackBerry.cmake (147959 => 147960)


--- trunk/Source/WebKit/PlatformBlackBerry.cmake	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/PlatformBlackBerry.cmake	2013-04-08 23:18:01 UTC (rev 147960)
@@ -87,7 +87,6 @@
     blackberry/WebCoreSupport/BackForwardListBlackBerry.cpp
     blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
     blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
-    blackberry/WebCoreSupport/ClientExtension.cpp
     blackberry/WebCoreSupport/ContextMenuClientBlackBerry.cpp
     blackberry/WebCoreSupport/CredentialManager.cpp
     blackberry/WebCoreSupport/CredentialTransformData.cpp
@@ -95,7 +94,6 @@
     blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.cpp
     blackberry/WebCoreSupport/DragClientBlackBerry.cpp
     blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
-    blackberry/WebCoreSupport/ExternalExtension.cpp
     blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
     blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp
     blackberry/WebCoreSupport/GeolocationClientBlackBerry.cpp

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (147959 => 147960)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-04-08 23:18:01 UTC (rev 147960)
@@ -114,6 +114,7 @@
 #include "RenderTreeAsText.h"
 #include "RenderView.h"
 #include "RenderWidget.h"
+#include "ScriptController.h"
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
 #include "ScrollTypes.h"
@@ -344,11 +345,6 @@
     d->m_autofillManager->autofillTextField(item);
 }
 
-void WebPage::enableQnxJavaScriptObject(bool enabled)
-{
-    d->m_enableQnxJavaScriptObject = enabled;
-}
-
 BlackBerry::Platform::String WebPage::renderTreeAsText()
 {
     return externalRepresentation(d->m_mainFrame);
@@ -424,7 +420,6 @@
     , m_fullscreenNode(0)
     , m_hasInRegionScrollableAreas(false)
     , m_updateDelegatedOverlaysDispatched(false)
-    , m_enableQnxJavaScriptObject(false)
     , m_deferredTasksTimer(this, &WebPagePrivate::deferredTasksTimerFired)
     , m_selectPopup(0)
     , m_autofillManager(AutofillManager::create(this))
@@ -900,7 +895,7 @@
     for (unsigned i = 0; i < args.size(); ++i)
         argListRef[i] = BlackBerryJavaScriptVariantToJSValueRef(ctx, args[i]);
 
-    JSValueRef windowObjectValue = windowObject();
+    JSValueRef windowObjectValue = toRef(d->m_mainFrame->script()->globalObject(mainThreadNormalWorld()));
     JSObjectRef obj = JSValueToObject(ctx, windowObjectValue, 0);
     JSObjectRef thisObject = obj;
     for (unsigned i = 0; i < function.size(); ++i) {
@@ -4742,24 +4737,14 @@
     doc->globalData()->timeoutChecker.setTimeoutInterval(ms);
 }
 
-JSContextRef WebPage::scriptContext() const
+JSGlobalContextRef WebPage::globalContext() const
 {
     if (!d->m_mainFrame)
         return 0;
 
-    JSC::Bindings::RootObject *root = d->m_mainFrame->script()->bindingRootObject();
-    if (!root)
-        return 0;
-
-    JSC::ExecState *exec = root->globalObject()->globalExec();
-    return toRef(exec);
+    return toGlobalRef(d->m_mainFrame->script()->globalObject(mainThreadNormalWorld())->globalExec());
 }
 
-JSValueRef WebPage::windowObject() const
-{
-    return toRef(d->m_mainFrame->script()->globalObject(mainThreadNormalWorld()));
-}
-
 // Serialize only the members of HistoryItem which are needed by the client,
 // and copy them into a SharedArray. Also include the HistoryItem pointer which
 // will be used by the client as an opaque reference to identify the item.
@@ -6260,5 +6245,10 @@
     return color;
 }
 
+bool WebPage::isProcessingUserGesture() const
+{
+    return ScriptController::processingUserGesture();
 }
+
 }
+}

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.h (147959 => 147960)


--- trunk/Source/WebKit/blackberry/Api/WebPage.h	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.h	2013-04-08 23:18:01 UTC (rev 147960)
@@ -26,17 +26,12 @@
 #include <BlackBerryPlatformInputEvents.h>
 #include <BlackBerryPlatformString.h>
 #include <BlackBerryPlatformWebContext.h>
+#include <_javascript_Core/JSBase.h>
 #include <imf/input_data.h>
 #include <network/NetworkRequest.h>
 #include <string>
 #include <vector>
 
-struct OpaqueJSContext;
-typedef const struct OpaqueJSContext* JSContextRef;
-
-struct OpaqueJSValue;
-typedef const struct OpaqueJSValue* JSValueRef;
-
 namespace WebCore {
 class ChromeClientBlackBerry;
 class Frame;
@@ -240,8 +235,7 @@
     // Case sensitivity, wrapping, and highlighting all matches are also toggleable.
     bool findNextString(const char*, bool forward, bool caseSensitive, bool wrap, bool highlightAllMatches);
 
-    JSContextRef scriptContext() const;
-    JSValueRef windowObject() const;
+    JSGlobalContextRef globalContext() const;
 
     unsigned timeoutForJavaScriptExecution() const;
     void setTimeoutForJavaScriptExecution(unsigned ms);
@@ -383,8 +377,6 @@
 
     void autofillTextField(const BlackBerry::Platform::String&);
 
-    void enableQnxJavaScriptObject(bool);
-
     BlackBerry::Platform::String renderTreeAsText();
 
     void updateNotificationPermission(const BlackBerry::Platform::String& requestId, bool allowed);
@@ -395,6 +387,8 @@
 
     void animateToScaleAndDocumentScrollPosition(double destinationZoomScale, const BlackBerry::Platform::FloatPoint& destinationScrollPosition, bool shouldConstrainScrollingToContentEdge = true);
 
+    bool isProcessingUserGesture() const;
+
 private:
     virtual ~WebPage();
 

Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (147959 => 147960)


--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2013-04-08 23:18:01 UTC (rev 147960)
@@ -108,7 +108,6 @@
     virtual void notifyDocumentOnLoad(bool) = 0;
 
     virtual void notifyWindowObjectCleared() = 0;
-    virtual BlackBerry::Platform::String invokeClientJavaScriptCallback(const char* const* args, unsigned numArgs) = 0;
 
     virtual void addMessageToConsole(const unsigned short* message, unsigned messageLength, const unsigned short* source, unsigned sourceLength, unsigned lineNumber) = 0;
     virtual int showAlertDialog(AlertType) = 0;
@@ -123,11 +122,6 @@
 
     virtual bool shouldInterruptJavaScript() = 0;
 
-    virtual void _javascript_SourceParsed(const unsigned short* url, unsigned urlLength, const unsigned short* script, unsigned scriptLength) = 0;
-    virtual void _javascript_ParsingFailed(const unsigned short* url, unsigned urlLength, const unsigned short* error, unsigned errorLength, int lineNumber) = 0;
-    virtual void _javascript_Paused(const unsigned short* stack, unsigned stackLength) = 0;
-    virtual void _javascript_Continued() = 0;
-
     virtual void contentsSizeChanged() = 0;
     virtual void scrollChanged() = 0;
     virtual void scaleChanged() = 0;

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (147959 => 147960)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2013-04-08 23:18:01 UTC (rev 147960)
@@ -591,7 +591,6 @@
     bool m_wouldSetFocused;
     bool m_wouldSetPageVisibilityState;
     bool m_cachedFocused;
-    bool m_enableQnxJavaScriptObject;
     Vector<bool> m_cachedPopupListSelecteds;
     int m_cachedPopupListSelectedIndex;
     BlackBerry::Platform::String m_cachedDateTimeInput;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (147959 => 147960)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,3 +1,35 @@
+2013-04-08  Jeff Rogers  <[email protected]>
+
+        [BlackBerry] Update BlackBerry _javascript_ API
+        https://bugs.webkit.org/show_bug.cgi?id=114065
+
+        Reviewed by Rob Buis.
+
+        Internal PR 317350
+        Add new API for determining if user gesture is being processed.
+        Remove obsolete files.
+        Properly expose JSC global context.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+        (BlackBerry::WebKit::WebPage::executeJavaScriptFunction):
+        (BlackBerry::WebKit::WebPage::globalContext):
+        (BlackBerry::WebKit::WebPage::isProcessingUserGesture):
+        (WebKit):
+        * Api/WebPage.h:
+        * Api/WebPageClient.h:
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        * WebCoreSupport/ChromeClientBlackBerry.h:
+        (ChromeClientBlackBerry):
+        * WebCoreSupport/ClientExtension.cpp: Removed.
+        * WebCoreSupport/ClientExtension.h: Removed.
+        * WebCoreSupport/ExternalExtension.cpp: Removed.
+        * WebCoreSupport/ExternalExtension.h: Removed.
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::dispatchDidClearWindowObjectInWorld):
+
 2013-04-08  Jakob Petsovits  <[email protected]>
 
         [BlackBerry] More null checks for m_mainFrame

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2013-04-08 23:18:01 UTC (rev 147960)
@@ -824,31 +824,4 @@
     return nullptr;
 }
 
-void ChromeClientBlackBerry::addSearchProvider(const BlackBerry::Platform::String& originURL, const BlackBerry::Platform::String& newURL)
-{
-    // Early return if this function is not triggered by a user gesture.
-    if (!ScriptController::processingUserGesture())
-        return;
-
-    // Security origin host & target host must share a common registered domain
-    KURL url = "" newURL);
-    String originHost = KURL(KURL(), originURL).host();
-
-    if (url.isValid() && BlackBerry::Platform::getRegisteredDomain(originHost) == BlackBerry::Platform::getRegisteredDomain(url.host()))
-        m_webPagePrivate->client()->addSearchProvider(newURL);
-}
-
-int ChromeClientBlackBerry::isSearchProviderInstalled(const BlackBerry::Platform::String& newURL)
-{
-//    Returns a value based on comparing url to the URLs of the results pages of the installed search engines.
-//    0 - None of the installed search engines match url.
-//    1 - One or more installed search engines match url, but none are the user's default search engine.
-//    2 - The user's default search engine matches url.
-
-    KURL url = "" newURL);
-    if (url.isValid())
-        return m_webPagePrivate->client()->isSearchProviderInstalled(newURL);
-    return 0;
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h	2013-04-08 23:18:01 UTC (rev 147960)
@@ -151,9 +151,6 @@
     virtual bool allowsAcceleratedCompositing() const;
 #endif
 
-    virtual void addSearchProvider(const BlackBerry::Platform::String&, const BlackBerry::Platform::String&);
-    virtual int isSearchProviderInstalled(const BlackBerry::Platform::String&);
-
     BlackBerry::WebKit::WebPagePrivate* webPagePrivate() const { return m_webPagePrivate; }
 
 private:

Deleted: trunk/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2010, 2011, 2012 Research In Motion Limited. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "ClientExtension.h"
-
-#include "Frame.h"
-#include "WebPageClient.h"
-#include <_javascript_Core/API/JSCallbackObject.h>
-#include <_javascript_Core/JSObjectRef.h>
-#include <_javascript_Core/JSStringRef.h>
-#include <_javascript_Core/JSValueRef.h>
-#include <_javascript_Core/_javascript_.h>
-#include <string>
-
-using namespace WebCore;
-using namespace BlackBerry::WebKit;
-using namespace std;
-
-static JSValueRef clientExtensionMethod(
-    JSContextRef ctx, JSObjectRef functionObject, JSObjectRef thisObject,
-    size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    JSValueRef jsRetVal = JSValueMakeUndefined(ctx);
-    if (argumentCount <= 0)
-        return jsRetVal;
-
-    char** strArgs = new char*[argumentCount];
-    for (unsigned i = 0; i < argumentCount; ++i) {
-        JSStringRef string = JSValueToStringCopy(ctx, arguments[i], 0);
-        size_t sizeUTF8 = JSStringGetMaximumUTF8CStringSize(string);
-        strArgs[i] = new char[sizeUTF8];
-        JSStringGetUTF8CString(string, strArgs[i], sizeUTF8);
-        JSStringRelease(string);
-    }
-
-    WebPageClient* client = reinterpret_cast<WebPageClient*>(JSObjectGetPrivate(thisObject));
-    BlackBerry::Platform::String retVal;
-    if (client)
-        retVal = client->invokeClientJavaScriptCallback(strArgs, argumentCount);
-    // FIXME: add a mechanism to pass the length of the string here
-    if (!retVal.empty())
-        jsRetVal = JSValueMakeString(ctx, JSStringCreateWithUTF8CString(retVal.c_str()));
-
-    for (unsigned i = 0; i < argumentCount; ++i)
-        delete[] strArgs[i];
-    delete[] strArgs;
-
-    return jsRetVal;
-}
-
-static void clientExtensionInitialize(JSContextRef context, JSObjectRef object)
-{
-    UNUSED_PARAM(context);
-    UNUSED_PARAM(object);
-}
-
-static void clientExtensionFinalize(JSObjectRef object)
-{
-    UNUSED_PARAM(object);
-}
-
-static JSStaticFunction clientExtensionStaticFunctions[] = {
-    { "callExtensionMethod", clientExtensionMethod, kJSPropertyAttributeNone },
-    { 0, 0, 0 }
-};
-
-static JSStaticValue clientExtensionStaticValues[] = {
-    { 0, 0, 0, 0 }
-};
-
-// FIXME: Revisit the creation of this class and make sure this is the best way to approach it.
-void attachExtensionObjectToFrame(Frame* frame, WebPageClient* client)
-{
-    JSDOMWindow* window = frame->script()->windowShell(mainThreadNormalWorld())->window();
-
-    JSC::ExecState* exec = window->globalExec();
-    JSC::JSLockHolder lock(exec);
-
-    JSContextRef scriptCtx = toRef(exec);
-
-    JSClassDefinition definition = kJSClassDefinitionEmpty;
-    definition.staticValues = clientExtensionStaticValues;
-    definition.staticFunctions = clientExtensionStaticFunctions;
-    definition.initialize = clientExtensionInitialize;
-    definition.finalize = clientExtensionFinalize;
-    JSClassRef clientClass = JSClassCreate(&definition);
-
-    JSObjectRef clientClassObject = JSObjectMake(scriptCtx, clientClass, 0);
-    JSObjectSetPrivate(clientClassObject, reinterpret_cast<void*>(client));
-
-    String name("qnx");
-
-    JSC::PutPropertySlot slot;
-    window->put(window, exec, JSC::Identifier(exec, name), toJS(clientClassObject), slot);
-
-    JSClassRelease(clientClass);
-}

Deleted: trunk/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.h (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.h	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.h	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef ClientExtension_h
-#define ClientExtension_h
-
-namespace WebCore {
-class Frame;
-}
-
-namespace BlackBerry {
-namespace WebKit {
-class WebPageClient;
-}
-}
-
-void attachExtensionObjectToFrame(WebCore::Frame*, BlackBerry::WebKit::WebPageClient*);
-
-#endif // ClientExtension_h

Deleted: trunk/Source/WebKit/blackberry/WebCoreSupport/ExternalExtension.cpp (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ExternalExtension.cpp	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ExternalExtension.cpp	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,145 +0,0 @@
-/*
- * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "ExternalExtension.h"
-
-#include "Chrome.h"
-#include "ChromeClientBlackBerry.h"
-#include "Frame.h"
-#include "Page.h"
-#include "SecurityOrigin.h"
-#include "WebPageClient.h"
-#include <_javascript_Core/API/JSCallbackObject.h>
-#include <_javascript_Core/JSObjectRef.h>
-#include <_javascript_Core/JSStringRef.h>
-#include <_javascript_Core/JSValueRef.h>
-#include <_javascript_Core/_javascript_.h>
-#include <string>
-
-using namespace WebCore;
-using namespace BlackBerry::WebKit;
-using namespace std;
-
-static JSValueRef addSearchProviderMethod(
-    JSContextRef ctx, JSObjectRef functionObject, JSObjectRef thisObject,
-    size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    JSValueRef jsRetVal = JSValueMakeUndefined(ctx);
-    if (argumentCount < 1)
-        return jsRetVal;
-
-    // Double check if page chrome client exists
-    Frame* frame = reinterpret_cast<Frame*>(JSObjectGetPrivate(thisObject));
-    if (frame) {
-        Page* page = frame->page();
-        if (!page || !page->chrome())
-            return jsRetVal;
-
-        JSStringRef string = JSValueToStringCopy(ctx, arguments[0], 0);
-        size_t sizeUTF8 = JSStringGetMaximumUTF8CStringSize(string);
-        char* newURL = new char[sizeUTF8];
-        JSStringGetUTF8CString(string, newURL, sizeUTF8);
-        JSStringRelease(string);
-
-        String originURL = frame->document()->securityOrigin()->toString();
-        ChromeClientBlackBerry* chrome = static_cast<ChromeClientBlackBerry*> (page->chrome()->client());
-        chrome->addSearchProvider(originURL, newURL);
-    }
-
-    return jsRetVal;
-}
-
-static JSValueRef IsSearchProviderInstalledMethod(
-    JSContextRef ctx, JSObjectRef functionObject, JSObjectRef thisObject,
-    size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    JSValueRef jsRetVal = JSValueMakeUndefined(ctx);
-    if (argumentCount < 1)
-        return jsRetVal;
-
-    // Double check if page chrome client exists
-    Frame* frame = reinterpret_cast<Frame*>(JSObjectGetPrivate(thisObject));
-    if (frame) {
-        Page* page = frame->page();
-        if (!page || !page->chrome())
-            return jsRetVal;
-
-        JSStringRef string = JSValueToStringCopy(ctx, arguments[0], 0);
-        size_t sizeUTF8 = JSStringGetMaximumUTF8CStringSize(string);
-        char* newURL = new char[sizeUTF8];
-        JSStringGetUTF8CString(string, newURL, sizeUTF8);
-        JSStringRelease(string);
-
-        ChromeClientBlackBerry* chrome = static_cast<ChromeClientBlackBerry*> (page->chrome()->client());
-        int retVal = chrome->isSearchProviderInstalled(newURL);
-
-        jsRetVal = JSValueMakeNumber(ctx, retVal);
-    }
-
-    return jsRetVal;
-}
-
-static void externalExtensionInitialize(JSContextRef context, JSObjectRef object)
-{
-    UNUSED_PARAM(context);
-    UNUSED_PARAM(object);
-}
-
-static void externalExtensionFinalize(JSObjectRef object)
-{
-    UNUSED_PARAM(object);
-}
-
-static JSStaticFunction externalExtensionStaticFunctions[] = {
-    { "AddSearchProvider", addSearchProviderMethod, kJSPropertyAttributeNone },
-    { "IsSearchProviderInstalled", IsSearchProviderInstalledMethod, kJSPropertyAttributeReadOnly },
-    { 0, 0, 0 }
-};
-
-static JSStaticValue externalExtensionStaticValues[] = {
-    { 0, 0, 0, 0 }
-};
-
-// FIXME: Revisit the creation of this class and make sure this is the best way to approach it.
-void attachExternalExtensionObjectToFrame(Frame* frame)
-{
-    JSDOMWindow* window = frame->script()->windowShell(mainThreadNormalWorld())->window();
-
-    JSC::ExecState* exec = window->globalExec();
-    JSC::JSLockHolder lock(exec);
-
-    JSContextRef scriptCtx = toRef(exec);
-
-    JSClassDefinition definition = kJSClassDefinitionEmpty;
-    definition.staticValues = externalExtensionStaticValues;
-    definition.staticFunctions = externalExtensionStaticFunctions;
-    definition.initialize = externalExtensionInitialize;
-    definition.finalize = externalExtensionFinalize;
-    JSClassRef clientClass = JSClassCreate(&definition);
-
-    JSObjectRef clientClassObject = JSObjectMake(scriptCtx, clientClass, 0);
-    JSObjectSetPrivate(clientClassObject, reinterpret_cast<void*>(frame));
-
-    String name("external");
-
-    JSC::PutPropertySlot slot;
-    window->put(window, exec, JSC::Identifier(exec, name), toJS(clientClassObject), slot);
-
-    JSClassRelease(clientClass);
-}

Deleted: trunk/Source/WebKit/blackberry/WebCoreSupport/ExternalExtension.h (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ExternalExtension.h	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ExternalExtension.h	2013-04-08 23:18:01 UTC (rev 147960)
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef ExternalExtension_h
-#define ExternalExtension_h
-
-namespace WebCore {
-class Frame;
-}
-
-void attachExternalExtensionObjectToFrame(WebCore::Frame*);
-
-#endif // ExternalExtension_h

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (147959 => 147960)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2013-04-08 23:18:01 UTC (rev 147960)
@@ -24,18 +24,12 @@
 #include "BackForwardController.h"
 #include "BackingStoreClient.h"
 #include "BackingStore_p.h"
-#include "Chrome.h"
-#include "ChromeClientBlackBerry.h"
-#include "ClientExtension.h"
-#include "CookieManager.h"
 #include "CredentialManager.h"
 #include "CredentialTransformData.h"
 #include "DumpRenderTreeClient.h"
-#include "ExternalExtension.h"
 #include "FrameLoadRequest.h"
 #include "FrameNetworkingContextBlackBerry.h"
 #include "FrameView.h"
-#include "HTMLFormElement.h"
 #include "HTMLHeadElement.h"
 #include "HTMLLinkElement.h"
 #include "HTMLMediaElement.h"
@@ -919,12 +913,6 @@
     if (world != mainThreadNormalWorld())
         return;
 
-    // Provide the extension object first in case the client or others want to use it.
-    if (m_webPagePrivate->m_enableQnxJavaScriptObject)
-        attachExtensionObjectToFrame(m_frame, m_webPagePrivate->m_client);
-
-    attachExternalExtensionObjectToFrame(m_frame);
-
     m_webPagePrivate->m_client->notifyWindowObjectCleared();
 
     if (m_webPagePrivate->m_dumpRenderTree) {

Modified: trunk/Source/cmake/OptionsBlackBerry.cmake (147959 => 147960)


--- trunk/Source/cmake/OptionsBlackBerry.cmake	2013-04-08 23:01:59 UTC (rev 147959)
+++ trunk/Source/cmake/OptionsBlackBerry.cmake	2013-04-08 23:18:01 UTC (rev 147960)
@@ -16,11 +16,8 @@
 # TODO: Make this build-time configurable
 set(WTF_USE_OPENTYPE_SANITIZER 1)
 add_definitions(-DWTF_USE_OPENTYPE_SANITIZER=1)
+add_definitions(-DWTF_USE_EXPORT_MACROS=1)
 
-if (SHARED_CORE)
-    add_definitions(-DWTF_USE_EXPORT_MACROS=1)
-endif ()
-
 if (ENABLE_GLES2)
     set(WTF_USE_ACCELERATED_COMPOSITING 1)
     add_definitions(-DWTF_USE_ACCELERATED_COMPOSITING=1)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to