Add API::InjectedBundle::Client
[WebKit-https.git] / Source / WebKit2 / WebProcess / InjectedBundle / InjectedBundleClient.cpp
index 15df16c..9a77c53 100644 (file)
 
 namespace WebKit {
 
-void InjectedBundleClient::didCreatePage(InjectedBundle* bundle, WebPage* page)
+InjectedBundleClient::InjectedBundleClient(const WKBundleClientBase* client)
+{
+    initialize(client);
+}
+
+void InjectedBundleClient::didCreatePage(InjectedBundle& bundle, WebPage& page)
 {
     if (!m_client.didCreatePage)
         return;
 
-    m_client.didCreatePage(toAPI(bundle), toAPI(page), m_client.base.clientInfo);
+    m_client.didCreatePage(toAPI(&bundle), toAPI(&page), m_client.base.clientInfo);
 }
 
-void InjectedBundleClient::willDestroyPage(InjectedBundle* bundle, WebPage* page)
+void InjectedBundleClient::willDestroyPage(InjectedBundle& bundle, WebPage& page)
 {
     if (!m_client.willDestroyPage)
         return;
 
-    m_client.willDestroyPage(toAPI(bundle), toAPI(page), m_client.base.clientInfo);
+    m_client.willDestroyPage(toAPI(&bundle), toAPI(&page), m_client.base.clientInfo);
 }
 
-void InjectedBundleClient::didInitializePageGroup(InjectedBundle* bundle, WebPageGroupProxy* pageGroup)
+void InjectedBundleClient::didInitializePageGroup(InjectedBundle& bundle, WebPageGroupProxy& pageGroup)
 {
     if (!m_client.didInitializePageGroup)
         return;
 
-    m_client.didInitializePageGroup(toAPI(bundle), toAPI(pageGroup), m_client.base.clientInfo);
+    m_client.didInitializePageGroup(toAPI(&bundle), toAPI(&pageGroup), m_client.base.clientInfo);
 }
 
-void InjectedBundleClient::didReceiveMessage(InjectedBundle* bundle, const String& messageName, API::Object* messageBody)
+void InjectedBundleClient::didReceiveMessage(InjectedBundle& bundle, const String& messageName, API::Object* messageBody)
 {
     if (!m_client.didReceiveMessage)
         return;
 
-    m_client.didReceiveMessage(toAPI(bundle), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
+    m_client.didReceiveMessage(toAPI(&bundle), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
 }
 
-void InjectedBundleClient::didReceiveMessageToPage(InjectedBundle* bundle, WebPage* page, const String& messageName, API::Object* messageBody)
+void InjectedBundleClient::didReceiveMessageToPage(InjectedBundle& bundle, WebPage& page, const String& messageName, API::Object* messageBody)
 {
     if (!m_client.didReceiveMessageToPage)
         return;
 
-    m_client.didReceiveMessageToPage(toAPI(bundle), toAPI(page), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
+    m_client.didReceiveMessageToPage(toAPI(&bundle), toAPI(&page), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
 }
 
 } // namespace WebKit