2010-12-13 Carlos Garcia Campos <cgarcia@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] Do not use GET_PRIVATE macros
        https://bugs.webkit.org/show_bug.cgi?id=50915

        GET_PRIVATE macros are slow and should only be used in the object
        init() method.

        * WebCoreSupport/ContextMenuClientGtk.cpp:
        (WebKit::inputMethodsMenuItem):
        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::postProgressFinishedNotification):
        (WebKit::FrameLoaderClient::setTitle):
        (WebKit::FrameLoaderClient::dispatchCreatePage):
        (WebKit::postCommitFrameViewSetup):
        * webkit/webkitdownload.cpp:
        (webkit_download_init):
        * webkit/webkitgeolocationpolicydecision.cpp:
        (webkit_geolocation_policy_decision_init):
        * webkit/webkithittestresult.cpp:
        (webkit_hit_test_result_init):
        * webkit/webkitnetworkrequest.cpp:
        (webkit_network_request_init):
        * webkit/webkitsecurityorigin.cpp:
        (webkit_security_origin_init):
        * webkit/webkitsecurityoriginprivate.h:
        * webkit/webkitviewportattributes.cpp:
        (webkit_viewport_attributes_init):
        * webkit/webkitwebbackforwardlist.cpp:
        (webkit_web_back_forward_list_init):
        * webkit/webkitwebdatabase.cpp:
        (webkit_web_database_init):
        * webkit/webkitwebdatasource.cpp:
        (webkit_web_data_source_init):
        * webkit/webkitwebframe.cpp:
        (webkit_web_frame_init):
        (webkit_web_frame_new):
        * webkit/webkitwebframeprivate.h:
        * webkit/webkitwebhistoryitem.cpp:
        (webkit_web_history_item_init):
        * webkit/webkitwebinspector.cpp:
        (webkit_web_inspector_init):
        * webkit/webkitwebnavigationaction.cpp:
        (webkit_web_navigation_action_init):
        * webkit/webkitwebplugin.cpp:
        (webkit_web_plugin_init):
        * webkit/webkitwebplugindatabase.cpp:
        (webkit_web_plugin_database_init):
        * webkit/webkitwebplugindatabaseprivate.h:
        * webkit/webkitwebpluginprivate.h:
        * webkit/webkitwebpolicydecision.cpp:
        (webkit_web_policy_decision_init):
        * webkit/webkitwebresource.cpp:
        (webkit_web_resource_init):
        * webkit/webkitwebresourceprivate.h:
        * webkit/webkitwebsettings.cpp:
        (webkit_web_settings_init):
        * webkit/webkitwebview.cpp:
        (PopupMenuPositionFunc):
        (webkit_web_view_forward_context_menu_event):
        (webkit_web_view_drag_end):
        (webkit_web_view_drag_data_get):
        (webkit_web_view_query_tooltip):
        (webkit_web_view_init):
        * webkit/webkitwebwindowfeatures.cpp:
        (webkit_web_window_features_init):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7ae981c9
2010-12-13 Carlos Garcia Campos <cgarcia@igalia.com>
Reviewed by Xan Lopez.
[GTK] Do not use GET_PRIVATE macros
https://bugs.webkit.org/show_bug.cgi?id=50915
GET_PRIVATE macros are slow and should only be used in the object
init() method.
* WebCoreSupport/ContextMenuClientGtk.cpp:
(WebKit::inputMethodsMenuItem):
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::postProgressFinishedNotification):
(WebKit::FrameLoaderClient::setTitle):
(WebKit::FrameLoaderClient::dispatchCreatePage):
(WebKit::postCommitFrameViewSetup):
* webkit/webkitdownload.cpp:
(webkit_download_init):
* webkit/webkitgeolocationpolicydecision.cpp:
(webkit_geolocation_policy_decision_init):
* webkit/webkithittestresult.cpp:
(webkit_hit_test_result_init):
* webkit/webkitnetworkrequest.cpp:
(webkit_network_request_init):
* webkit/webkitsecurityorigin.cpp:
(webkit_security_origin_init):
* webkit/webkitsecurityoriginprivate.h:
* webkit/webkitviewportattributes.cpp:
(webkit_viewport_attributes_init):
* webkit/webkitwebbackforwardlist.cpp:
(webkit_web_back_forward_list_init):
* webkit/webkitwebdatabase.cpp:
(webkit_web_database_init):
* webkit/webkitwebdatasource.cpp:
(webkit_web_data_source_init):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_init):
(webkit_web_frame_new):
* webkit/webkitwebframeprivate.h:
* webkit/webkitwebhistoryitem.cpp:
(webkit_web_history_item_init):
* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_init):
* webkit/webkitwebnavigationaction.cpp:
(webkit_web_navigation_action_init):
* webkit/webkitwebplugin.cpp:
(webkit_web_plugin_init):
* webkit/webkitwebplugindatabase.cpp:
(webkit_web_plugin_database_init):
* webkit/webkitwebplugindatabaseprivate.h:
* webkit/webkitwebpluginprivate.h:
* webkit/webkitwebpolicydecision.cpp:
(webkit_web_policy_decision_init):
* webkit/webkitwebresource.cpp:
(webkit_web_resource_init):
* webkit/webkitwebresourceprivate.h:
* webkit/webkitwebsettings.cpp:
(webkit_web_settings_init):
* webkit/webkitwebview.cpp:
(PopupMenuPositionFunc):
(webkit_web_view_forward_context_menu_event):
(webkit_web_view_drag_end):
(webkit_web_view_drag_data_get):
(webkit_web_view_query_tooltip):
(webkit_web_view_init):
* webkit/webkitwebwindowfeatures.cpp:
(webkit_web_window_features_init):
2010-10-28 MORITA Hajime <morrita@google.com>
Reviewed by Ojan Vafai.
......
......@@ -62,7 +62,7 @@ static GtkWidget* inputMethodsMenuItem (WebKitWebView* webView)
GtkWidget* menuitem = gtk_image_menu_item_new_with_mnemonic(
_("Input _Methods"));
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebViewPrivate* priv = webView->priv;
GtkWidget* imContextMenu = gtk_menu_new();
gtk_im_multicontext_append_menuitems(GTK_IM_MULTICONTEXT(priv->imContext.get()), GTK_MENU_SHELL(imContextMenu));
......
......@@ -378,7 +378,7 @@ void FrameLoaderClient::postProgressEstimateChangedNotification()
void FrameLoaderClient::postProgressFinishedNotification()
{
WebKitWebView* webView = getViewFromFrame(m_frame);
WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebViewPrivate* privateData = webView->priv;
// We can get a stopLoad() from dispose when the object is being
// destroyed, don't emit the signal in that case.
......@@ -1051,7 +1051,7 @@ void FrameLoaderClient::prepareForDataSourceReplacement()
void FrameLoaderClient::setTitle(const String& title, const KURL& url)
{
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame);
WebKitWebFramePrivate* frameData = m_frame->priv;
g_free(frameData->title);
frameData->title = g_strdup(title.utf8().data());
}
......@@ -1236,7 +1236,7 @@ Frame* FrameLoaderClient::dispatchCreatePage(const NavigationAction&)
if (!newWebView)
return 0;
WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(newWebView);
WebKitWebViewPrivate* privateData = newWebView->priv;
return core(privateData->mainFrame);
}
......@@ -1287,7 +1287,7 @@ static void postCommitFrameViewSetup(WebKitWebFrame *frame, FrameView *view, boo
WebKitWebView* containingWindow = getViewFromFrame(frame);
webkit_web_view_clear_resources(containingWindow);
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow);
WebKitWebViewPrivate* priv = containingWindow->priv;
view->setGtkAdjustments(priv->horizontalAdjustment.get(), priv->verticalAdjustment.get(), resetValues);
// Invalidate the viewport attributes - they will only be valid
......
......@@ -72,8 +72,6 @@ class DownloadClient : public Noncopyable, public ResourceHandleClient {
WebKitDownload* m_download;
};
#define WEBKIT_DOWNLOAD_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_DOWNLOAD, WebKitDownloadPrivate))
struct _WebKitDownloadPrivate {
gchar* destinationURI;
gchar* suggestedFilename;
......@@ -390,7 +388,7 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass)
static void webkit_download_init(WebKitDownload* download)
{
WebKitDownloadPrivate* priv = WEBKIT_DOWNLOAD_GET_PRIVATE(download);
WebKitDownloadPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(download, WEBKIT_TYPE_DOWNLOAD, WebKitDownloadPrivate);
download->priv = priv;
priv->downloadClient = new DownloadClient(download);
......
......@@ -43,8 +43,6 @@ struct _WebKitGeolocationPolicyDecisionPrivate {
Geolocation* geolocation;
};
#define WEBKIT_GEOLOCATION_POLICY_DECISION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionPrivate))
static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolicyDecisionClass* decisionClass)
{
g_type_class_add_private(decisionClass, sizeof(WebKitGeolocationPolicyDecisionPrivate));
......@@ -52,7 +50,7 @@ static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolic
static void webkit_geolocation_policy_decision_init(WebKitGeolocationPolicyDecision* decision)
{
decision->priv = WEBKIT_GEOLOCATION_POLICY_DECISION_GET_PRIVATE(decision);
decision->priv = G_TYPE_INSTANCE_GET_PRIVATE(decision, WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionPrivate);
}
WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, Geolocation* geolocation)
......
......@@ -49,8 +49,6 @@ struct _WebKitHitTestResultPrivate {
WebKitDOMNode* innerNode;
};
#define WEBKIT_HIT_TEST_RESULT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultPrivate))
enum {
PROP_0,
......@@ -230,7 +228,7 @@ static void webkit_hit_test_result_class_init(WebKitHitTestResultClass* webHitTe
static void webkit_hit_test_result_init(WebKitHitTestResult* web_hit_test_result)
{
web_hit_test_result->priv = WEBKIT_HIT_TEST_RESULT_GET_PRIVATE(web_hit_test_result);
web_hit_test_result->priv = G_TYPE_INSTANCE_GET_PRIVATE(web_hit_test_result, WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultPrivate);
}
namespace WebKit {
......
......@@ -48,8 +48,6 @@ struct _WebKitNetworkRequestPrivate {
SoupMessage* message;
};
#define WEBKIT_NETWORK_REQUEST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_NETWORK_REQUEST, WebKitNetworkRequestPrivate))
enum {
PROP_0,
......@@ -157,7 +155,7 @@ static void webkit_network_request_class_init(WebKitNetworkRequestClass* request
static void webkit_network_request_init(WebKitNetworkRequest* request)
{
WebKitNetworkRequestPrivate* priv = WEBKIT_NETWORK_REQUEST_GET_PRIVATE(request);
WebKitNetworkRequestPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(request, WEBKIT_TYPE_NETWORK_REQUEST, WebKitNetworkRequestPrivate);
request->priv = priv;
}
......
......@@ -212,7 +212,7 @@ static void webkit_security_origin_class_init(WebKitSecurityOriginClass* klass)
static void webkit_security_origin_init(WebKitSecurityOrigin* securityOrigin)
{
WebKitSecurityOriginPrivate* priv = WEBKIT_SECURITY_ORIGIN_GET_PRIVATE(securityOrigin);
WebKitSecurityOriginPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(securityOrigin, WEBKIT_TYPE_SECURITY_ORIGIN, WebKitSecurityOriginPrivate);
priv->webDatabases = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref);
securityOrigin->priv = priv;
}
......
......@@ -35,7 +35,6 @@ WebCore::SecurityOrigin* core(WebKitSecurityOrigin*);
extern "C" {
#define WEBKIT_SECURITY_ORIGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_SECURITY_ORIGIN, WebKitSecurityOriginPrivate))
struct _WebKitSecurityOriginPrivate {
RefPtr<WebCore::SecurityOrigin> coreOrigin;
gchar* protocol;
......
......@@ -110,8 +110,6 @@ enum {
G_DEFINE_TYPE(WebKitViewportAttributes, webkit_viewport_attributes, G_TYPE_OBJECT);
#define WEBKIT_VIEWPORT_ATTRIBUTES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_VIEWPORT_ATTRIBUTES, WebKitViewportAttributesPrivate))
static void webkit_viewport_attributes_get_property(GObject* object, guint propertyID, GValue* value, GParamSpec* paramSpec);
static void webkit_viewport_attributes_set_property(GObject* object, guint propertyID, const GValue* value, GParamSpec* paramSpec);
......@@ -414,7 +412,7 @@ static void webkit_viewport_attributes_class_init(WebKitViewportAttributesClass*
static void webkit_viewport_attributes_init(WebKitViewportAttributes* viewport)
{
viewport->priv = WEBKIT_VIEWPORT_ATTRIBUTES_GET_PRIVATE(viewport);
viewport->priv = G_TYPE_INSTANCE_GET_PRIVATE(viewport, WEBKIT_TYPE_VIEWPORT_ATTRIBUTES, WebKitViewportAttributesPrivate);
viewport->priv->deviceWidth = 0;
viewport->priv->deviceHeight = 0;
......
......@@ -58,8 +58,6 @@ struct _WebKitWebBackForwardListPrivate {
gboolean disposed;
};
#define WEBKIT_WEB_BACK_FORWARD_LIST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, WebKitWebBackForwardListPrivate))
G_DEFINE_TYPE(WebKitWebBackForwardList, webkit_web_back_forward_list, G_TYPE_OBJECT);
static void webkit_web_back_forward_list_dispose(GObject* object)
......@@ -93,7 +91,7 @@ static void webkit_web_back_forward_list_class_init(WebKitWebBackForwardListClas
static void webkit_web_back_forward_list_init(WebKitWebBackForwardList* webBackForwardList)
{
webBackForwardList->priv = WEBKIT_WEB_BACK_FORWARD_LIST_GET_PRIVATE(webBackForwardList);
webBackForwardList->priv = G_TYPE_INSTANCE_GET_PRIVATE(webBackForwardList, WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, WebKitWebBackForwardListPrivate);
}
/**
......
......@@ -77,8 +77,6 @@ struct _WebKitWebDatabasePrivate {
static gchar* webkit_database_directory_path = NULL;
static guint64 webkit_default_database_quota = 5 * 1024 * 1024;
#define WEBKIT_WEB_DATABASE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_DATABASE, WebKitWebDatabasePrivate))
static void webkit_web_database_set_security_origin(WebKitWebDatabase* webDatabase, WebKitSecurityOrigin* security_origin);
static void webkit_web_database_set_name(WebKitWebDatabase* webDatabase, const gchar* name);
......@@ -250,7 +248,7 @@ static void webkit_web_database_class_init(WebKitWebDatabaseClass* klass)
static void webkit_web_database_init(WebKitWebDatabase* webDatabase)
{
webDatabase->priv = WEBKIT_WEB_DATABASE_GET_PRIVATE(webDatabase);
webDatabase->priv = G_TYPE_INSTANCE_GET_PRIVATE(webDatabase, WEBKIT_TYPE_WEB_DATABASE, WebKitWebDatabasePrivate);
}
// Internal use only
......
......@@ -74,8 +74,6 @@ struct _WebKitWebDataSourcePrivate {
gchar* unreachableURL;
};
#define WEBKIT_WEB_DATA_SOURCE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_DATA_SOURCE, WebKitWebDataSourcePrivate))
G_DEFINE_TYPE(WebKitWebDataSource, webkit_web_data_source, G_TYPE_OBJECT);
static void webkit_web_data_source_dispose(GObject* object)
......@@ -135,7 +133,7 @@ static void webkit_web_data_source_class_init(WebKitWebDataSourceClass* klass)
static void webkit_web_data_source_init(WebKitWebDataSource* webDataSource)
{
webDataSource->priv = WEBKIT_WEB_DATA_SOURCE_GET_PRIVATE(webDataSource);
webDataSource->priv = G_TYPE_INSTANCE_GET_PRIVATE(webDataSource, WEBKIT_TYPE_WEB_DATA_SOURCE, WebKitWebDataSourcePrivate);
}
WebKitWebDataSource* webkit_web_data_source_new_with_loader(PassRefPtr<WebKit::DocumentLoader> loader)
......
......@@ -381,7 +381,7 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
static void webkit_web_frame_init(WebKitWebFrame* frame)
{
WebKitWebFramePrivate* priv = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
WebKitWebFramePrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(frame, WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate);
// TODO: Move constructor code here.
frame->priv = priv;
......@@ -404,7 +404,7 @@ WebKitWebFrame* webkit_web_frame_new(WebKitWebView* webView)
WebKitWebFrame* frame = WEBKIT_WEB_FRAME(g_object_new(WEBKIT_TYPE_WEB_FRAME, NULL));
WebKitWebFramePrivate* priv = frame->priv;
WebKitWebViewPrivate* viewPriv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebViewPrivate* viewPriv = webView->priv;
priv->webView = webView;
WebKit::FrameLoaderClient* client = new WebKit::FrameLoaderClient(frame);
......
......@@ -34,7 +34,6 @@ WebKitWebFrame* kit(WebCore::Frame*);
extern "C" {
#define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
struct _WebKitWebFramePrivate {
WebCore::Frame* coreFrame;
......
......@@ -62,8 +62,6 @@ struct _WebKitWebHistoryItemPrivate {
gboolean disposed;
};
#define WEBKIT_WEB_HISTORY_ITEM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_HISTORY_ITEM, WebKitWebHistoryItemPrivate))
enum {
PROP_0,
......@@ -217,7 +215,7 @@ static void webkit_web_history_item_class_init(WebKitWebHistoryItemClass* klass)
static void webkit_web_history_item_init(WebKitWebHistoryItem* webHistoryItem)
{
webHistoryItem->priv = WEBKIT_WEB_HISTORY_ITEM_GET_PRIVATE(webHistoryItem);
webHistoryItem->priv = G_TYPE_INSTANCE_GET_PRIVATE(webHistoryItem, WEBKIT_TYPE_WEB_HISTORY_ITEM, WebKitWebHistoryItemPrivate);
}
static void webkit_web_history_item_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
......
......@@ -98,8 +98,6 @@ struct _WebKitWebInspectorPrivate {
gchar* inspected_uri;
};
#define WEBKIT_WEB_INSPECTOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_INSPECTOR, WebKitWebInspectorPrivate))
static void webkit_web_inspector_finalize(GObject* object);
static void webkit_web_inspector_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec);
......@@ -326,7 +324,7 @@ static void webkit_web_inspector_class_init(WebKitWebInspectorClass* klass)
static void webkit_web_inspector_init(WebKitWebInspector* web_inspector)
{
web_inspector->priv = WEBKIT_WEB_INSPECTOR_GET_PRIVATE(web_inspector);
web_inspector->priv = G_TYPE_INSTANCE_GET_PRIVATE(web_inspector, WEBKIT_TYPE_WEB_INSPECTOR, WebKitWebInspectorPrivate);
}
static void webkit_web_inspector_finalize(GObject* object)
......
......@@ -48,8 +48,6 @@ struct _WebKitWebNavigationActionPrivate {
gchar* targetFrame;
};
#define WEBKIT_WEB_NAVIGATION_ACTION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionPrivate))
enum {
PROP_0,
......@@ -118,7 +116,7 @@ static void webkit_web_navigation_action_set_property(GObject* object, guint pro
static void webkit_web_navigation_action_init(WebKitWebNavigationAction* navigationAction)
{
navigationAction->priv = WEBKIT_WEB_NAVIGATION_ACTION_GET_PRIVATE(navigationAction);
navigationAction->priv = G_TYPE_INSTANCE_GET_PRIVATE(navigationAction, WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionPrivate);
}
static void webkit_web_navigation_action_finalize(GObject* obj)
......
......@@ -70,7 +70,7 @@ static void webkit_web_plugin_class_init(WebKitWebPluginClass* klass)
static void webkit_web_plugin_init(WebKitWebPlugin *plugin)
{
WebKitWebPluginPrivate* priv = WEBKIT_WEB_PLUGIN_GET_PRIVATE(plugin);
WebKitWebPluginPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(plugin, WEBKIT_TYPE_WEB_PLUGIN, WebKitWebPluginPrivate);
plugin->priv = priv = new WebKitWebPluginPrivate();
}
......
......@@ -47,7 +47,7 @@ static void webkit_web_plugin_database_class_init(WebKitWebPluginDatabaseClass*
static void webkit_web_plugin_database_init(WebKitWebPluginDatabase* database)
{
WebKitWebPluginDatabasePrivate* priv = WEBKIT_WEB_PLUGIN_DATABASE_GET_PRIVATE(database);
WebKitWebPluginDatabasePrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(database, WEBKIT_TYPE_WEB_PLUGIN_DATABASE, WebKitWebPluginDatabasePrivate);
database->priv = priv;
priv->coreDatabase = PluginDatabase::installedPlugins();
......
......@@ -28,7 +28,6 @@ class PluginDatabase;
extern "C" {
#define WEBKIT_WEB_PLUGIN_DATABASE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_PLUGIN_DATABASE, WebKitWebPluginDatabasePrivate))
typedef struct _WebKitWebPluginDatabasePrivate WebKitWebPluginDatabasePrivate;
struct _WebKitWebPluginDatabasePrivate {
WebCore::PluginDatabase* coreDatabase;
......
......@@ -32,7 +32,6 @@ WebKitWebPlugin* kitNew(WebCore::PluginPackage* package);
extern "C" {
#define WEBKIT_WEB_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_PLUGIN, WebKitWebPluginPrivate))
typedef struct _WebKitWebPluginPrivate WebKitWebPluginPrivate;
struct _WebKitWebPluginPrivate {
RefPtr<WebCore::PluginPackage> corePlugin;
......
......@@ -46,8 +46,6 @@ struct _WebKitWebPolicyDecisionPrivate {
gboolean isCancelled;
};
#define WEBKIT_WEB_POLICY_DECISION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionPrivate))
static void webkit_web_policy_decision_class_init(WebKitWebPolicyDecisionClass* decisionClass)
{
g_type_class_add_private(decisionClass, sizeof(WebKitWebPolicyDecisionPrivate));
......@@ -55,7 +53,7 @@ static void webkit_web_policy_decision_class_init(WebKitWebPolicyDecisionClass*
static void webkit_web_policy_decision_init(WebKitWebPolicyDecision* decision)
{
decision->priv = WEBKIT_WEB_POLICY_DECISION_GET_PRIVATE(decision);
decision->priv = G_TYPE_INSTANCE_GET_PRIVATE(decision, WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionPrivate);
}
WebKitWebPolicyDecision* webkit_web_policy_decision_new(WebKitWebFrame* frame, WebCore::FramePolicyFunction function)
......
......@@ -217,7 +217,7 @@ static void webkit_web_resource_set_property(GObject* object, guint prop_id, con
static void webkit_web_resource_init(WebKitWebResource* webResource)
{
webResource->priv = WEBKIT_WEB_RESOURCE_GET_PRIVATE(webResource);
webResource->priv = G_TYPE_INSTANCE_GET_PRIVATE(webResource, WEBKIT_TYPE_WEB_RESOURCE, WebKitWebResourcePrivate);
}
// internal use only
......
......@@ -28,7 +28,6 @@
extern "C" {
#define WEBKIT_WEB_RESOURCE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_RESOURCE, WebKitWebResourcePrivate))
struct _WebKitWebResourcePrivate {
WebCore::ArchiveResource* resource;
......
......@@ -917,7 +917,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
static void webkit_web_settings_init(WebKitWebSettings* web_settings)
{
web_settings->priv = WEBKIT_WEB_SETTINGS_GET_PRIVATE(web_settings);
web_settings->priv = G_TYPE_INSTANCE_GET_PRIVATE(web_settings, WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate);
}
static EnchantBroker* get_enchant_broker()
......
......@@ -251,7 +251,7 @@ static GtkIMContext* webkit_web_view_get_im_context(WebKitWebView*);
static void PopupMenuPositionFunc(GtkMenu* menu, gint *x, gint *y, gboolean *pushIn, gpointer userData)
{
WebKitWebView* view = WEBKIT_WEB_VIEW(userData);
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(view);
WebKitWebViewPrivate* priv = view->priv;
GdkScreen* screen = gtk_widget_get_screen(GTK_WIDGET(view));
GtkRequisition menuSize;
......@@ -363,7 +363,7 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
if (!items)
return FALSE;
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebViewPrivate* priv = webView->priv;
priv->currentMenu = menu;
priv->lastPopupXPosition = event.globalX();
priv->lastPopupYPosition = event.globalY();
......@@ -1511,7 +1511,7 @@ static IntPoint globalPointForClientPoint(GdkWindow* window, const IntPoint& cli
static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
{
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebViewPrivate* priv = webView->priv;
// This might happen if a drag is still in progress after a WebKitWebView
// is disposed and before it is finalized.
......@@ -1549,7 +1549,7 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
static void webkit_web_view_drag_data_get(GtkWidget* widget, GdkDragContext* context, GtkSelectionData* selectionData, guint info, guint)
{
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(WEBKIT_WEB_VIEW(widget));
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW(widget)->priv;
// This might happen if a drag is still in progress after a WebKitWebView
// is diposed and before it is finalized.
......@@ -1686,7 +1686,7 @@ static gboolean webkit_web_view_drag_drop(GtkWidget* widget, GdkDragContext* con
#if GTK_CHECK_VERSION(2, 12, 0)
static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip)
{
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(widget);
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW(widget)->priv;
if (keyboard_mode) {
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
......@@ -3457,7 +3457,7 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
static void webkit_web_view_init(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebViewPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(webView, WEBKIT_TYPE_WEB_VIEW, WebKitWebViewPrivate);
webView->priv = priv;
// This is the placement new syntax: http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.10
// It allows us to call a constructor on manually allocated locations in memory. We must use it
......
......@@ -276,7 +276,7 @@ static void webkit_web_window_features_class_init(WebKitWebWindowFeaturesClass*
static void webkit_web_window_features_init(WebKitWebWindowFeatures* web_window_features)
{
web_window_features->priv = WEBKIT_WEB_WINDOW_FEATURES_GET_PRIVATE(web_window_features);
web_window_features->priv = G_TYPE_INSTANCE_GET_PRIVATE(web_window_features, WEBKIT_TYPE_WEB_WINDOW_FEATURES, WebKitWebWindowFeaturesPrivate);
}
static void webkit_web_window_features_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment