[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
weinig at apple.com
weinig at apple.com
Wed Dec 22 15:45:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 898fc923ad416e9ec9e2568a8b623d413118e32f
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 11 22:07:30 2010 +0000
Move the remaining API client classes to use the APIClient base class.
https://bugs.webkit.org/show_bug.cgi?id=49404
Reviewed by Anders Carlsson.
Also moves InjectedBundleClient into its own class to match other API clients.
* UIProcess/WebContextInjectedBundleClient.cpp:
* UIProcess/WebContextInjectedBundleClient.h:
* UIProcess/WebHistoryClient.cpp:
(WebKit::WebHistoryClient::didNavigateWithNavigationData):
(WebKit::WebHistoryClient::didPerformClientRedirect):
(WebKit::WebHistoryClient::didPerformServerRedirect):
(WebKit::WebHistoryClient::didUpdateHistoryTitle):
(WebKit::WebHistoryClient::populateVisitedLinks):
* UIProcess/WebHistoryClient.h:
(WebKit::WebHistoryClient::shouldTrackVisitedLinks):
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::initializeClient):
(WebKit::InjectedBundle::reportException):
(WebKit::InjectedBundle::didCreatePage):
(WebKit::InjectedBundle::willDestroyPage):
(WebKit::InjectedBundle::didReceiveMessage):
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/InjectedBundleClient.cpp: Added.
(WebKit::InjectedBundleClient::didCreatePage):
(WebKit::InjectedBundleClient::willDestroyPage):
(WebKit::InjectedBundleClient::didReceiveMessage):
* WebProcess/InjectedBundle/InjectedBundleClient.h: Added.
* win/WebKit2.vcproj:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 69e57e0..9a53d89 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,38 @@
+2010-11-11 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Move the remaining API client classes to use the APIClient base class.
+ https://bugs.webkit.org/show_bug.cgi?id=49404
+
+ Also moves InjectedBundleClient into its own class to match other API clients.
+
+ * UIProcess/WebContextInjectedBundleClient.cpp:
+ * UIProcess/WebContextInjectedBundleClient.h:
+ * UIProcess/WebHistoryClient.cpp:
+ (WebKit::WebHistoryClient::didNavigateWithNavigationData):
+ (WebKit::WebHistoryClient::didPerformClientRedirect):
+ (WebKit::WebHistoryClient::didPerformServerRedirect):
+ (WebKit::WebHistoryClient::didUpdateHistoryTitle):
+ (WebKit::WebHistoryClient::populateVisitedLinks):
+ * UIProcess/WebHistoryClient.h:
+ (WebKit::WebHistoryClient::shouldTrackVisitedLinks):
+ * WebKit2.pro:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::initializeClient):
+ (WebKit::InjectedBundle::reportException):
+ (WebKit::InjectedBundle::didCreatePage):
+ (WebKit::InjectedBundle::willDestroyPage):
+ (WebKit::InjectedBundle::didReceiveMessage):
+ * WebProcess/InjectedBundle/InjectedBundle.h:
+ * WebProcess/InjectedBundle/InjectedBundleClient.cpp: Added.
+ (WebKit::InjectedBundleClient::didCreatePage):
+ (WebKit::InjectedBundleClient::willDestroyPage):
+ (WebKit::InjectedBundleClient::didReceiveMessage):
+ * WebProcess/InjectedBundle/InjectedBundleClient.h: Added.
+ * win/WebKit2.vcproj:
+
2010-11-11 Anders Carlsson <andersca at apple.com>
Reviewed by Adam Roben.
diff --git a/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp b/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
index 2fba9d9..97613f8 100644
--- a/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
+++ b/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
@@ -32,19 +32,6 @@ using namespace WebCore;
namespace WebKit {
-WebContextInjectedBundleClient::WebContextInjectedBundleClient()
-{
- initialize(0);
-}
-
-void WebContextInjectedBundleClient::initialize(const WKContextInjectedBundleClient* client)
-{
- if (client && !client->version)
- m_client = *client;
- else
- memset(&m_client, 0, sizeof(m_client));
-}
-
void WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle(WebContext* context, const String& messageName, APIObject* messageBody)
{
if (!m_client.didReceiveMessageFromInjectedBundle)
diff --git a/WebKit2/UIProcess/WebContextInjectedBundleClient.h b/WebKit2/UIProcess/WebContextInjectedBundleClient.h
index 0a93187..d5eafc5 100644
--- a/WebKit2/UIProcess/WebContextInjectedBundleClient.h
+++ b/WebKit2/UIProcess/WebContextInjectedBundleClient.h
@@ -26,6 +26,7 @@
#ifndef WebContextInjectedBundleClient_h
#define WebContextInjectedBundleClient_h
+#include "APIClient.h"
#include "WKContext.h"
#include <wtf/Forward.h>
@@ -34,16 +35,10 @@ namespace WebKit {
class APIObject;
class WebContext;
-class WebContextInjectedBundleClient {
+class WebContextInjectedBundleClient : public APIClient<WKContextInjectedBundleClient> {
public:
- WebContextInjectedBundleClient();
- void initialize(const WKContextInjectedBundleClient*);
-
void didReceiveMessageFromInjectedBundle(WebContext*, const String&, APIObject*);
void didReceiveSynchronousMessageFromInjectedBundle(WebContext*, const String&, APIObject*, RefPtr<APIObject>& returnData);
-
-private:
- WKContextInjectedBundleClient m_client;
};
} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebHistoryClient.cpp b/WebKit2/UIProcess/WebHistoryClient.cpp
index 12056ee..d0ca71b 100644
--- a/WebKit2/UIProcess/WebHistoryClient.cpp
+++ b/WebKit2/UIProcess/WebHistoryClient.cpp
@@ -33,58 +33,45 @@ using namespace WebCore;
namespace WebKit {
-WebHistoryClient::WebHistoryClient()
-{
- initialize(0);
-}
-
-void WebHistoryClient::initialize(const WKContextHistoryClient* client)
-{
- if (client && !client->version)
- m_contextHistoryClient = *client;
- else
- memset(&m_contextHistoryClient, 0, sizeof(m_contextHistoryClient));
-}
-
void WebHistoryClient::didNavigateWithNavigationData(WebContext* context, WebPageProxy* page, const WebNavigationDataStore& navigationDataStore, WebFrameProxy* frame)
{
- if (!m_contextHistoryClient.didNavigateWithNavigationData)
+ if (!m_client.didNavigateWithNavigationData)
return;
RefPtr<WebNavigationData> navigationData = WebNavigationData::create(navigationDataStore);
- m_contextHistoryClient.didNavigateWithNavigationData(toAPI(context), toAPI(page), toAPI(navigationData.get()), toAPI(frame), m_contextHistoryClient.clientInfo);
+ m_client.didNavigateWithNavigationData(toAPI(context), toAPI(page), toAPI(navigationData.get()), toAPI(frame), m_client.clientInfo);
}
void WebHistoryClient::didPerformClientRedirect(WebContext* context, WebPageProxy* page, const String& sourceURL, const String& destinationURL, WebFrameProxy* frame)
{
- if (!m_contextHistoryClient.didPerformClientRedirect)
+ if (!m_client.didPerformClientRedirect)
return;
- m_contextHistoryClient.didPerformClientRedirect(toAPI(context), toAPI(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(frame), m_contextHistoryClient.clientInfo);
+ m_client.didPerformClientRedirect(toAPI(context), toAPI(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(frame), m_client.clientInfo);
}
void WebHistoryClient::didPerformServerRedirect(WebContext* context, WebPageProxy* page, const String& sourceURL, const String& destinationURL, WebFrameProxy* frame)
{
- if (!m_contextHistoryClient.didPerformServerRedirect)
+ if (!m_client.didPerformServerRedirect)
return;
- m_contextHistoryClient.didPerformServerRedirect(toAPI(context), toAPI(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(frame), m_contextHistoryClient.clientInfo);
+ m_client.didPerformServerRedirect(toAPI(context), toAPI(page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(frame), m_client.clientInfo);
}
void WebHistoryClient::didUpdateHistoryTitle(WebContext* context, WebPageProxy* page, const String& title, const String& url, WebFrameProxy* frame)
{
- if (!m_contextHistoryClient.didUpdateHistoryTitle)
+ if (!m_client.didUpdateHistoryTitle)
return;
- m_contextHistoryClient.didUpdateHistoryTitle(toAPI(context), toAPI(page), toAPI(title.impl()), toURLRef(url.impl()), toAPI(frame), m_contextHistoryClient.clientInfo);
+ m_client.didUpdateHistoryTitle(toAPI(context), toAPI(page), toAPI(title.impl()), toURLRef(url.impl()), toAPI(frame), m_client.clientInfo);
}
void WebHistoryClient::populateVisitedLinks(WebContext* context)
{
- if (!m_contextHistoryClient.populateVisitedLinks)
+ if (!m_client.populateVisitedLinks)
return;
- m_contextHistoryClient.populateVisitedLinks(toAPI(context), m_contextHistoryClient.clientInfo);
+ m_client.populateVisitedLinks(toAPI(context), m_client.clientInfo);
}
} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebHistoryClient.h b/WebKit2/UIProcess/WebHistoryClient.h
index 5a189cf..bf50748 100644
--- a/WebKit2/UIProcess/WebHistoryClient.h
+++ b/WebKit2/UIProcess/WebHistoryClient.h
@@ -26,6 +26,7 @@
#ifndef WebHistoryClient_h
#define WebHistoryClient_h
+#include "APIClient.h"
#include "WKContext.h"
#include <wtf/Forward.h>
@@ -33,24 +34,18 @@ namespace WebKit {
class WebContext;
class WebFrameProxy;
-struct WebNavigationDataStore;
class WebPageProxy;
+struct WebNavigationDataStore;
-class WebHistoryClient {
+class WebHistoryClient : public APIClient<WKContextHistoryClient> {
public:
- WebHistoryClient();
- void initialize(const WKContextHistoryClient*);
-
void didNavigateWithNavigationData(WebContext*, WebPageProxy*, const WebNavigationDataStore&, WebFrameProxy*);
void didPerformClientRedirect(WebContext*, WebPageProxy*, const String& sourceURL, const String& destinationURL, WebFrameProxy*);
void didPerformServerRedirect(WebContext*, WebPageProxy*, const String& sourceURL, const String& destinationURL, WebFrameProxy*);
void didUpdateHistoryTitle(WebContext*, WebPageProxy*, const String& title, const String& url, WebFrameProxy*);
void populateVisitedLinks(WebContext*);
- bool shouldTrackVisitedLinks() const { return m_contextHistoryClient.populateVisitedLinks; }
-
-private:
- WKContextHistoryClient m_contextHistoryClient;
+ bool shouldTrackVisitedLinks() const { return m_client.populateVisitedLinks; }
};
} // namespace WebKit
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 58f571c..3f66c92 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -320,6 +320,7 @@ HEADERS += \
WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \
WebProcess/InjectedBundle/InjectedBundle.h \
+ WebProcess/InjectedBundle/InjectedBundleClient.h \
WebProcess/InjectedBundle/InjectedBundleHitTestResult.h \
WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \
WebProcess/InjectedBundle/InjectedBundlePageFormClient.h \
@@ -491,6 +492,7 @@ SOURCES += \
WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \
WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \
WebProcess/InjectedBundle/InjectedBundle.cpp \
+ WebProcess/InjectedBundle/InjectedBundleClient.cpp \
WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp \
WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp \
WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 1beae10..7d8d699 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -479,6 +479,8 @@
BCEE7AD112817988009827DA /* WebProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE7ACD12817988009827DA /* WebProcessProxyMessages.h */; };
BCEE7D0D12846F69009827DA /* WebContextMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE7D0B12846F69009827DA /* WebContextMessageReceiver.cpp */; };
BCEE7D0E12846F69009827DA /* WebContextMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE7D0C12846F69009827DA /* WebContextMessages.h */; };
+ BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE7DC3128B645D009827DA /* InjectedBundleClient.h */; };
+ BCEE7DC6128B645D009827DA /* InjectedBundleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE7DC4128B645D009827DA /* InjectedBundleClient.cpp */; };
BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE966A112FAF57006BCC24 /* Attachment.cpp */; };
BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE966B112FAF57006BCC24 /* Attachment.h */; };
BCEE98C6113314D7006BCC24 /* WebPageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE98C4113314D7006BCC24 /* WebPageNamespace.cpp */; };
@@ -1040,6 +1042,8 @@
BCEE7D0912846AED009827DA /* WebContext.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebContext.messages.in; sourceTree = "<group>"; };
BCEE7D0B12846F69009827DA /* WebContextMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMessageReceiver.cpp; sourceTree = "<group>"; };
BCEE7D0C12846F69009827DA /* WebContextMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMessages.h; sourceTree = "<group>"; };
+ BCEE7DC3128B645D009827DA /* InjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleClient.h; sourceTree = "<group>"; };
+ BCEE7DC4128B645D009827DA /* InjectedBundleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleClient.cpp; sourceTree = "<group>"; };
BCEE966A112FAF57006BCC24 /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Attachment.cpp; sourceTree = "<group>"; };
BCEE966B112FAF57006BCC24 /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attachment.h; sourceTree = "<group>"; };
BCEE98C4113314D7006BCC24 /* WebPageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageNamespace.cpp; sourceTree = "<group>"; };
@@ -1820,6 +1824,8 @@
BC4BEE96120A091700FBA0C7 /* DOM */,
BC204EE011C83E98008F3375 /* InjectedBundle.cpp */,
BC204EE111C83E98008F3375 /* InjectedBundle.h */,
+ BCEE7DC4128B645D009827DA /* InjectedBundleClient.cpp */,
+ BCEE7DC3128B645D009827DA /* InjectedBundleClient.h */,
935EEB8F1277615D003322B8 /* InjectedBundleBackForwardList.cpp */,
935EEB901277615D003322B8 /* InjectedBundleBackForwardList.h */,
935EEB911277615D003322B8 /* InjectedBundleBackForwardListItem.cpp */,
@@ -2382,6 +2388,7 @@
512935E41288D97800A4B695 /* InjectedBundlePageContextMenuClient.h in Headers */,
1AB7D72C1288CAAD00CFD08C /* WebDownloadClient.h in Headers */,
1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */,
+ BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */,
ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -2736,6 +2743,7 @@
512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */,
1AB7D72D1288CAAD00CFD08C /* WebDownloadClient.cpp in Sources */,
1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */,
+ BCEE7DC6128B645D009827DA /* InjectedBundleClient.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index ebd859c..50990f1 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -65,10 +65,7 @@ InjectedBundle::~InjectedBundle()
void InjectedBundle::initializeClient(WKBundleClient* client)
{
- if (client && !client->version)
- m_client = *client;
- else
- memset(&m_client, 0, sizeof(m_client));
+ m_client.initialize(client);
}
void InjectedBundle::postMessage(const String& messageName, APIObject* messageBody)
@@ -182,22 +179,34 @@ size_t InjectedBundle::javaScriptObjectsCount()
return JSDOMWindow::commonJSGlobalData()->heap.objectCount();
}
+void InjectedBundle::reportException(JSContextRef context, JSValueRef exception)
+{
+ if (!context || !exception)
+ return;
+
+ JSLock lock(JSC::SilenceAssertionsOnly);
+ JSC::ExecState* execState = toJS(context);
+
+ // Make sure the context has a DOMWindow global object, otherwise this context didn't originate from a Page.
+ if (!toJSDOMWindow(execState->lexicalGlobalObject()))
+ return;
+
+ WebCore::reportException(execState, toJS(execState, exception));
+}
+
void InjectedBundle::didCreatePage(WebPage* page)
{
- if (m_client.didCreatePage)
- m_client.didCreatePage(toAPI(this), toAPI(page), m_client.clientInfo);
+ m_client.didCreatePage(this, page);
}
void InjectedBundle::willDestroyPage(WebPage* page)
{
- if (m_client.willDestroyPage)
- m_client.willDestroyPage(toAPI(this), toAPI(page), m_client.clientInfo);
+ m_client.willDestroyPage(this, page);
}
void InjectedBundle::didReceiveMessage(const String& messageName, APIObject* messageBody)
{
- if (m_client.didReceiveMessage)
- m_client.didReceiveMessage(toAPI(this), toAPI(messageName.impl()), toAPI(messageBody), m_client.clientInfo);
+ m_client.didReceiveMessage(this, messageName, messageBody);
}
void InjectedBundle::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
@@ -218,19 +227,4 @@ void InjectedBundle::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC:
ASSERT_NOT_REACHED();
}
-void InjectedBundle::reportException(JSContextRef context, JSValueRef exception)
-{
- if (!context || !exception)
- return;
-
- JSLock lock(JSC::SilenceAssertionsOnly);
- JSC::ExecState* execState = toJS(context);
-
- // Make sure the context has a DOMWindow global object, otherwise this context didn't originate from a Page.
- if (!toJSDOMWindow(execState->lexicalGlobalObject()))
- return;
-
- WebCore::reportException(execState, toJS(execState, exception));
-}
-
} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
index 2ec3ce6..4fd7c0d 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
@@ -27,6 +27,7 @@
#define InjectedBundle_h
#include "APIObject.h"
+#include "InjectedBundleClient.h"
#include "WKBundle.h"
#include <WebCore/UserContentTypes.h>
#include <WebCore/UserScriptTypes.h>
@@ -121,7 +122,7 @@ private:
String m_sandboxToken;
#endif
- WKBundleClient m_client;
+ InjectedBundleClient m_client;
};
} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp
new file mode 100644
index 0000000..54f3624
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * 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 INC. 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 INC. 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.
+ */
+
+#include "InjectedBundleClient.h"
+
+#include "WKBundleAPICast.h"
+
+namespace WebKit {
+
+void InjectedBundleClient::didCreatePage(InjectedBundle* bundle, WebPage* page)
+{
+ if (!m_client.didCreatePage)
+ return;
+
+ m_client.didCreatePage(toAPI(bundle), toAPI(page), m_client.clientInfo);
+}
+
+void InjectedBundleClient::willDestroyPage(InjectedBundle* bundle, WebPage* page)
+{
+ if (!m_client.willDestroyPage)
+ return;
+
+ m_client.willDestroyPage(toAPI(bundle), toAPI(page), m_client.clientInfo);
+}
+
+void InjectedBundleClient::didReceiveMessage(InjectedBundle* bundle, const String& messageName, APIObject* messageBody)
+{
+ if (!m_client.didReceiveMessage)
+ return;
+
+ m_client.didReceiveMessage(toAPI(bundle), toAPI(messageName.impl()), toAPI(messageBody), m_client.clientInfo);
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h
new file mode 100644
index 0000000..a195832
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * 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 INC. 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 INC. 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 InjectedBundleClient_h
+#define InjectedBundleClient_h
+
+#include "APIClient.h"
+#include "WKBundle.h"
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class APIObject;
+class InjectedBundle;
+class WebPage;
+
+class InjectedBundleClient : public APIClient<WKBundleClient> {
+public:
+ void didCreatePage(InjectedBundle*, WebPage*);
+ void willDestroyPage(InjectedBundle*, WebPage*);
+ void didReceiveMessage(InjectedBundle*, const String& messageName, APIObject* messageBody);
+};
+
+} // namespace WebKit
+
+
+#endif // InjectedBundleClient_h
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 8e3944a..aaf5b43 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1328,6 +1328,14 @@
>
</File>
<File
+ RelativePath="..\WebProcess\InjectedBundle\InjectedBundleClient.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebProcess\InjectedBundle\InjectedBundleClient.h"
+ >
+ </File>
+ <File
RelativePath="..\WebProcess\InjectedBundle\InjectedBundleBackForwardList.cpp"
>
</File>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list