diff options
author | Steve Block <steveblock@google.com> | 2011-05-06 11:45:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-12 13:44:10 +0100 |
commit | cad810f21b803229eb11403f9209855525a25d57 (patch) | |
tree | 29a6fd0279be608e0fe9ffe9841f722f0f4e4269 /WebKit/gtk/WebCoreSupport | |
parent | 121b0cf4517156d0ac5111caf9830c51b69bae8f (diff) | |
download | external_webkit-cad810f21b803229eb11403f9209855525a25d57.zip external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.gz external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.bz2 |
Merge WebKit at r75315: Initial merge by git.
Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
Diffstat (limited to 'WebKit/gtk/WebCoreSupport')
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp | 39 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ChromeClientGtk.h | 1 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp | 1 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp | 8 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DragClientGtk.cpp | 3 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DragClientGtk.h | 2 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp | 39 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h | 1 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp | 53 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/EditorClientGtk.h | 2 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp | 45 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h | 3 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp | 1 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp | 9 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h | 2 |
15 files changed, 123 insertions, 86 deletions
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index 12f4f14..7f39d37 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -48,13 +48,14 @@ #include "SecurityOrigin.h" #include "WindowFeatures.h" #include "webkitgeolocationpolicydecision.h" +#include "webkitgeolocationpolicydecisionprivate.h" #include "webkitnetworkrequest.h" -#include "webkitprivate.h" #include "webkitsecurityoriginprivate.h" #include "webkitviewportattributesprivate.h" #include "webkitwebframeprivate.h" #include "webkitwebview.h" #include "webkitwebviewprivate.h" +#include "webkitwebwindowfeaturesprivate.h" #include <glib.h> #include <glib/gi18n-lib.h> #include <gtk/gtk.h> @@ -70,6 +71,7 @@ namespace WebKit { ChromeClient::ChromeClient(WebKitWebView* webView) : m_webView(webView) + , m_closeSoonTimer(0) { ASSERT(m_webView); } @@ -155,9 +157,8 @@ Page* ChromeClient::createWindow(Frame* frame, const FrameLoadRequest& frameLoad if (!webView) return 0; - WebKitWebWindowFeatures* webWindowFeatures = webkit_web_window_features_new_from_core_features(coreFeatures); - g_object_set(webView, "window-features", webWindowFeatures, NULL); - g_object_unref(webWindowFeatures); + GRefPtr<WebKitWebWindowFeatures> webWindowFeatures(adoptGRef(kitNew(coreFeatures))); + g_object_set(webView, "window-features", webWindowFeatures.get(), NULL); if (!frameLoadRequest.isEmpty()) webkit_web_view_open(webView, frameLoadRequest.resourceRequest().url().string().utf8().data()); @@ -249,19 +250,37 @@ void ChromeClient::setResizable(bool) // Ignored for now } +static gboolean emitCloseWebViewSignalLater(WebKitWebView* view) +{ + gboolean isHandled; + g_signal_emit_by_name(view, "close-web-view", &isHandled); + return FALSE; +} + void ChromeClient::closeWindowSoon() { // We may not have a WebView as create-web-view can return NULL. if (!m_webView) return; + if (m_closeSoonTimer) // Don't call close-web-view more than once. + return; - webkit_web_view_stop_loading(m_webView); + // We need to remove the parent WebView from WebViewSets here, before it actually + // closes, to make sure that JavaScript code that executes before it closes + // can't find it. Otherwise, window.open will select a closed WebView instead of + // opening a new one <rdar://problem/3572585>. + m_webView->priv->corePage->setGroupName(""); - gboolean isHandled = false; - g_signal_emit_by_name(m_webView, "close-web-view", &isHandled); + // We also need to stop the load to prevent further parsing or JavaScript execution + // after the window has torn down <rdar://problem/4161660>. + webkit_web_view_stop_loading(m_webView); - if (isHandled) - return; + // Clients commonly destroy the web view during the close-web-view signal, but our caller + // may need to send more signals to the web view. For instance, if this happened in the + // onload handler, it will need to call FrameLoaderClient::dispatchDidHandleOnloadEvents. + // Instead of firing the close-web-view signal now, fire it after the caller finishes. + // This seems to match the Mac/Windows port behavior. + m_closeSoonTimer = g_timeout_add(0, reinterpret_cast<GSourceFunc>(emitCloseWebViewSignalLater), m_webView); } bool ChromeClient::canTakeFocus(FocusDirection) @@ -638,7 +657,7 @@ void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocatio WebKitWebFrame* webFrame = kit(frame); WebKitWebView* webView = getViewFromFrame(webFrame); - PlatformRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptPlatformRef(webkit_geolocation_policy_decision_new(webFrame, geolocation))); + GRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptGRef(webkit_geolocation_policy_decision_new(webFrame, geolocation))); gboolean isHandled = FALSE; g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision.get(), &isHandled); diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h index e9f1c83..d607c54 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h @@ -154,6 +154,7 @@ namespace WebKit { private: WebKitWebView* m_webView; WebCore::KURL m_hoveredLinkURL; + unsigned int m_closeSoonTimer; }; } diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp index 137f9ab..d9c59d0 100644 --- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp @@ -26,7 +26,6 @@ #include "KURL.h" #include "NotImplemented.h" #include "Page.h" -#include "webkitprivate.h" #include "webkitwebviewprivate.h" #include <glib-object.h> #include <glib/gi18n-lib.h> diff --git a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp index 2b355cb..6031b62 100644 --- a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp @@ -30,8 +30,9 @@ #include "config.h" #include "DocumentLoaderGtk.h" -#include "webkitprivate.h" +#include "GRefPtr.h" #include "webkitwebdatasource.h" +#include "webkitwebdatasourceprivate.h" using namespace WebCore; @@ -68,9 +69,8 @@ void DocumentLoader::attachToFrame() // We may get to here without having a datasource, when the data // is coming from the page cache. - WebKitWebDataSource* dataSource = webkit_web_data_source_new_with_loader(this); - setDataSource(dataSource); - g_object_unref(dataSource); + GRefPtr<WebKitWebDataSource> dataSource(adoptGRef(kitNew(this))); + setDataSource(dataSource.get()); } void DocumentLoader::detachFromFrame() diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp index 5f391ec..c92c083 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp @@ -32,7 +32,6 @@ #include "NotImplemented.h" #include "PasteboardHelper.h" #include "RenderObject.h" -#include "webkitprivate.h" #include "webkitwebframeprivate.h" #include "webkitwebviewprivate.h" #include "webkitwebview.h" @@ -104,7 +103,7 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin, WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame)); RefPtr<DataObjectGtk> dataObject = clipboardGtk->dataObject(); - PlatformRefPtr<GtkTargetList> targetList(clipboardGtk->helper()->targetListForDataObject(dataObject.get())); + GRefPtr<GtkTargetList> targetList(clipboardGtk->helper()->targetListForDataObject(dataObject.get())); GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event()); GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get()); diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h index 086ec69..9c6d948 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h @@ -59,7 +59,7 @@ namespace WebKit { private: WebKitWebView* m_webView; WebCore::IntPoint m_startPos; - PlatformRefPtr<GtkWidget> m_dragIconWindow; + GRefPtr<GtkWidget> m_dragIconWindow; RefPtr<cairo_surface_t> m_dragImage; }; } diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp index a751c77..dabe4b5 100644 --- a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp @@ -21,15 +21,16 @@ #include "config.h" #include "DumpRenderTreeSupportGtk.h" -#include "AccessibilityObjectWrapperAtk.h" -#include "AnimationController.h" #include "APICast.h" #include "AXObjectCache.h" +#include "AccessibilityObjectWrapperAtk.h" +#include "AnimationController.h" +#include "DOMWrapperWorld.h" #include "Document.h" #include "FocusController.h" #include "FrameLoaderClientGtk.h" -#include "FrameView.h" #include "FrameTree.h" +#include "FrameView.h" #include "GCController.h" #include "GraphicsContext.h" #include "JSDOMWindow.h" @@ -43,21 +44,20 @@ #include "PlatformString.h" #include "PrintContext.h" #include "RenderListItem.h" -#include "RenderView.h" #include "RenderTreeAsText.h" +#include "RenderView.h" #include "SecurityOrigin.h" -#if ENABLE(SVG) -#include "SVGSMILElement.h" -#endif #include "WorkerThread.h" -#include "webkitprivate.h" +#include "webkitwebframe.h" #include "webkitwebframeprivate.h" -#include "webkitwebviewprivate.h" #include "webkitwebview.h" -#include "webkitwebframe.h" -#include "DOMWrapperWorld.h" +#include "webkitwebviewprivate.h" #include <JavaScriptCore/APICast.h> +#if ENABLE(SVG) +#include "SVGSMILElement.h" +#endif + using namespace JSC; using namespace WebCore; using namespace WebKit; @@ -413,7 +413,7 @@ void DumpRenderTreeSupportGtk::clearMainFrameName(WebKitWebFrame* frame) core(frame)->tree()->clearName(); } -AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame* frame) +AtkObject* DumpRenderTreeSupportGtk::getRootAccessibleElement(WebKitWebFrame* frame) { g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0); @@ -425,11 +425,20 @@ AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame* if (!priv->coreFrame || !priv->coreFrame->document()) return 0; - RenderView* root = toRenderView(priv->coreFrame->document()->renderer()); - if (!root) + AtkObject* wrapper = priv->coreFrame->document()->axObjectCache()->rootObject()->wrapper(); + if (!wrapper) return 0; - AtkObject* wrapper = priv->coreFrame->document()->axObjectCache()->getOrCreate(root)->wrapper(); + return wrapper; +#else + return 0; +#endif +} + +AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame* frame) +{ +#if HAVE(ACCESSIBILITY) + AtkObject* wrapper = getRootAccessibleElement(frame); if (!wrapper) return 0; diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h index 61764ab..663f13a 100644 --- a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h +++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h @@ -64,6 +64,7 @@ public: static void resumeAnimations(WebKitWebFrame*); static void clearMainFrameName(WebKitWebFrame*); static AtkObject* getFocusedAccessibleElement(WebKitWebFrame*); + static AtkObject* getRootAccessibleElement(WebKitWebFrame*); static void layoutFrame(WebKitWebFrame*); // WebKitWebView diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp index 0522f87..ee9bf9a 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp @@ -44,8 +44,8 @@ #include "WebKitDOMNodePrivate.h" #include "WebKitDOMRangePrivate.h" #include "WindowsKeyboardCodes.h" +#include "webkitglobalsprivate.h" #include "webkitmarshal.h" -#include "webkitprivate.h" #include "webkitwebsettingsprivate.h" #include "webkitwebviewprivate.h" #include <wtf/text/CString.h> @@ -270,7 +270,7 @@ void EditorClient::setInputMethodState(bool active) bool EditorClient::shouldDeleteRange(Range* range) { gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range))); g_signal_emit_by_name(m_webView, "should-delete-range", kitRange.get(), &accept); return accept; } @@ -278,7 +278,7 @@ bool EditorClient::shouldDeleteRange(Range* range) bool EditorClient::shouldShowDeleteInterface(HTMLElement* element) { gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMHTMLElement> kitElement(adoptPlatformRef(kit(element))); + GRefPtr<WebKitDOMHTMLElement> kitElement(adoptGRef(kit(element))); g_signal_emit_by_name(m_webView, "should-show-delete-interface-for-element", kitElement.get(), &accept); return accept; } @@ -310,7 +310,7 @@ bool EditorClient::shouldBeginEditing(WebCore::Range* range) clearPendingComposition(); gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range))); g_signal_emit_by_name(m_webView, "should-begin-editing", kitRange.get(), &accept); return accept; } @@ -320,7 +320,7 @@ bool EditorClient::shouldEndEditing(WebCore::Range* range) clearPendingComposition(); gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range))); g_signal_emit_by_name(m_webView, "should-end-editing", kitRange.get(), &accept); return accept; } @@ -342,7 +342,7 @@ static WebKitInsertAction kit(EditorInsertAction action) bool EditorClient::shouldInsertText(const String& string, Range* range, EditorInsertAction action) { gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range))); g_signal_emit_by_name(m_webView, "should-insert-text", string.utf8().data(), kitRange.get(), kit(action), &accept); return accept; } @@ -362,8 +362,8 @@ static WebKitSelectionAffinity kit(EAffinity affinity) bool EditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting) { gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMRange> kitFromRange(fromRange ? adoptPlatformRef(kit(fromRange)) : 0); - PlatformRefPtr<WebKitDOMRange> kitToRange(toRange ? adoptPlatformRef(kit(toRange)) : 0); + GRefPtr<WebKitDOMRange> kitFromRange(fromRange ? adoptGRef(kit(fromRange)) : 0); + GRefPtr<WebKitDOMRange> kitToRange(toRange ? adoptGRef(kit(toRange)) : 0); g_signal_emit_by_name(m_webView, "should-change-selected-range", kitFromRange.get(), kitToRange.get(), kit(affinity), stillSelecting, &accept); return accept; @@ -372,8 +372,8 @@ bool EditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, E bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration* declaration, WebCore::Range* range) { gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(declaration)); - PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + GRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(declaration)); + GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range))); g_signal_emit_by_name(m_webView, "should-apply-style", kitDeclaration.get(), kitRange.get(), &accept); return accept; } @@ -543,8 +543,8 @@ void EditorClient::redo() bool EditorClient::shouldInsertNode(Node* node, Range* range, EditorInsertAction action) { gboolean accept = TRUE; - PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); - PlatformRefPtr<WebKitDOMNode> kitNode(adoptPlatformRef(kit(node))); + GRefPtr<WebKitDOMRange> kitRange(adoptGRef(kit(range))); + GRefPtr<WebKitDOMNode> kitNode(adoptGRef(kit(node))); g_signal_emit_by_name(m_webView, "should-insert-node", kitNode.get(), kitRange.get(), kit(action), &accept); return accept; } @@ -652,24 +652,23 @@ void EditorClient::generateEditorCommands(const KeyboardEvent* event) if (event->ctrlKey()) modifiers |= CtrlKey; - - if (event->type() == eventNames().keydownEvent) { - int mapKey = modifiers << 16 | event->keyCode(); - if (mapKey) - m_pendingEditorCommands.append(keyDownCommandsMap.get(mapKey)); + // For keypress events, we want charCode(), but keyCode() does that. + int mapKey = modifiers << 16 | event->keyCode(); + if (!mapKey) return; - } - - int mapKey = modifiers << 16 | event->charCode(); - if (mapKey) - m_pendingEditorCommands.append(keyPressCommandsMap.get(mapKey)); + HashMap<int, const char*>* commandMap = event->type() == eventNames().keydownEvent ? + &keyDownCommandsMap : &keyPressCommandsMap; + if (const char* commandString = commandMap->get(mapKey)) + m_pendingEditorCommands.append(commandString); } bool EditorClient::executePendingEditorCommands(Frame* frame, bool allowTextInsertion) { Vector<Editor::Command> commands; for (size_t i = 0; i < m_pendingEditorCommands.size(); i++) { - Editor::Command command = frame->editor()->command(m_pendingEditorCommands.at(i)); + const char* commandString = m_pendingEditorCommands.at(i); + ASSERT(commandString); + Editor::Command command = frame->editor()->command(commandString); if (command.isTextInsertion() && !allowTextInsertion) return false; @@ -890,7 +889,7 @@ void EditorClient::textDidChangeInTextArea(Element*) void EditorClient::ignoreWordInSpellDocument(const String& text) { - GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView); + GSList* dicts = webkitWebViewGetEnchantDicts(m_webView); for (; dicts; dicts = dicts->next) { EnchantDict* dict = static_cast<EnchantDict*>(dicts->data); @@ -901,7 +900,7 @@ void EditorClient::ignoreWordInSpellDocument(const String& text) void EditorClient::learnWord(const String& text) { - GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView); + GSList* dicts = webkitWebViewGetEnchantDicts(m_webView); for (; dicts; dicts = dicts->next) { EnchantDict* dict = static_cast<EnchantDict*>(dicts->data); @@ -912,7 +911,7 @@ void EditorClient::learnWord(const String& text) void EditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength) { - GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView); + GSList* dicts = webkitWebViewGetEnchantDicts(m_webView); if (!dicts) return; @@ -1005,7 +1004,7 @@ bool EditorClient::spellingUIIsShowing() void EditorClient::getGuessesForWord(const String& word, const String& context, WTF::Vector<String>& guesses) { - GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView); + GSList* dicts = webkitWebViewGetEnchantDicts(m_webView); guesses.clear(); for (; dicts; dicts = dicts->next) { diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h index f2db1d9..214dbd6 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h @@ -140,7 +140,7 @@ namespace WebKit { bool m_treatContextCommitAsKeyEvent; GOwnPtr<gchar> m_pendingComposition; Vector<const char*> m_pendingEditorCommands; - PlatformRefPtr<GtkWidget> m_nativeWidget; + GRefPtr<GtkWidget> m_nativeWidget; }; } diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index 9bac2d0..13cbc59 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -58,14 +58,17 @@ #include "ResourceHandle.h" #include "ResourceRequest.h" #include "ScriptController.h" +#include "Settings.h" #include "webkiterror.h" +#include "webkitglobals.h" +#include "webkitglobalsprivate.h" #include "webkitnetworkrequest.h" #include "webkitnetworkrequestprivate.h" #include "webkitnetworkresponse.h" #include "webkitnetworkresponseprivate.h" -#include "webkitprivate.h" #include "webkitviewportattributes.h" #include "webkitviewportattributesprivate.h" +#include "webkitwebdatasourceprivate.h" #include "webkitwebframe.h" #include "webkitwebframeprivate.h" #include "webkitwebnavigationaction.h" @@ -74,6 +77,7 @@ #include "webkitwebpolicydecisionprivate.h" #include "webkitwebresource.h" #include "webkitwebresourceprivate.h" +#include "webkitwebsettingsprivate.h" #include "webkitwebview.h" #include "webkitwebviewprivate.h" #include <JavaScriptCore/APICast.h> @@ -240,9 +244,8 @@ WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClient::createDocumentLoader { RefPtr<WebKit::DocumentLoader> loader = WebKit::DocumentLoader::create(request, substituteData); - WebKitWebDataSource* webDataSource = webkit_web_data_source_new_with_loader(loader.get()); - loader->setDataSource(webDataSource); - g_object_unref(webDataSource); + GRefPtr<WebKitWebDataSource> webDataSource(adoptGRef(kitNew(loader.get()))); + loader->setDataSource(webDataSource.get()); return loader.release(); } @@ -309,19 +312,19 @@ static char* toString(unsigned long identifier) void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) { - PlatformRefPtr<WebKitNetworkResponse> networkResponse(0); + GRefPtr<WebKitNetworkResponse> networkResponse(0); // We are adding one more resource to the load, or maybe we are // just redirecting a load. if (redirectResponse.isNull()) static_cast<WebKit::DocumentLoader*>(loader)->increaseLoadCount(identifier); else - networkResponse = adoptPlatformRef(kitNew(redirectResponse)); + networkResponse = adoptGRef(kitNew(redirectResponse)); WebKitWebView* webView = getViewFromFrame(m_frame); GOwnPtr<gchar> identifierString(toString(identifier)); WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get()); - PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(kitNew(request))); + GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request))); if (!redirectResponse.isNull()) { // This is a redirect, so we need to update the WebResource's knowledge @@ -415,7 +418,7 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli } WebKitWebView* page = getViewFromFrame(m_frame); - PlatformRefPtr<WebKitNetworkRequest> request(adoptPlatformRef(kitNew(resourceRequest))); + GRefPtr<WebKitNetworkRequest> request(adoptGRef(kitNew(resourceRequest))); WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction); if (m_policyDecision) @@ -428,7 +431,7 @@ void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction poli if (isHandled) return; - PlatformRefPtr<WebKitNetworkResponse> networkResponse(adoptPlatformRef(webkit_web_frame_get_network_response(m_frame))); + GRefPtr<WebKitNetworkResponse> networkResponse(adoptGRef(webkit_web_frame_get_network_response(m_frame))); if (networkResponse) { ResourceResponse response = core(networkResponse.get()); if (response.isAttachment()) { @@ -495,8 +498,8 @@ void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFuncti m_policyDecision = policyDecision; WebKitWebView* webView = getViewFromFrame(m_frame); - PlatformRefPtr<WebKitNetworkRequest> request(adoptPlatformRef(webkit_network_request_new(resourceRequest.url().string().utf8().data()))); - PlatformRefPtr<WebKitWebNavigationAction> navigationAction(adoptPlatformRef(getNavigationAction(action, frameName.utf8().data()))); + GRefPtr<WebKitNetworkRequest> request(adoptGRef(webkit_network_request_new(resourceRequest.url().string().utf8().data()))); + GRefPtr<WebKitWebNavigationAction> navigationAction(adoptGRef(getNavigationAction(action, frameName.utf8().data()))); gboolean isHandled = false; g_signal_emit_by_name(webView, "new-window-policy-decision-requested", m_frame, request.get(), navigationAction.get(), policyDecision, &isHandled); @@ -519,7 +522,7 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct } WebKitWebView* webView = getViewFromFrame(m_frame); - PlatformRefPtr<WebKitNetworkRequest> request(adoptPlatformRef(kitNew(resourceRequest))); + GRefPtr<WebKitNetworkRequest> request(adoptGRef(kitNew(resourceRequest))); WebKitNavigationResponse response; /* * We still support the deprecated navigation-requested signal, if the @@ -540,7 +543,7 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct g_object_unref(m_policyDecision); m_policyDecision = policyDecision; - PlatformRefPtr<WebKitWebNavigationAction> navigationAction(adoptPlatformRef(getNavigationAction(action, 0))); + GRefPtr<WebKitWebNavigationAction> navigationAction(adoptGRef(getNavigationAction(action, 0))); gboolean isHandled = false; g_signal_emit_by_name(webView, "navigation-policy-decision-requested", m_frame, request.get(), navigationAction.get(), policyDecision, &isHandled); @@ -556,7 +559,7 @@ PassRefPtr<Widget> FrameLoaderClient::createPlugin(const IntSize& pluginSize, HT CString mimeTypeString = mimeType.utf8(); ASSERT(paramNames.size() == paramValues.size()); - PlatformRefPtr<GHashTable> hash = adoptPlatformRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free)); + GRefPtr<GHashTable> hash = adoptGRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free)); for (unsigned i = 0; i < paramNames.size(); ++i) { g_hash_table_insert(hash.get(), g_strdup(paramNames[i].utf8().data()), @@ -1168,7 +1171,7 @@ void FrameLoaderClient::dispatchDidFailLoad(const ResourceError& error) void FrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest&, const ResourceResponse& response) { - PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(kitNew(request))); + GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request))); WebKitWebView* view = getViewFromFrame(m_frame); webkit_web_view_request_download(view, networkRequest.get(), response, handle); @@ -1256,7 +1259,7 @@ void FrameLoaderClient::setMainDocumentError(WebCore::DocumentLoader*, const Res void FrameLoaderClient::startDownload(const ResourceRequest& request) { - PlatformRefPtr<WebKitNetworkRequest> networkRequest(adoptPlatformRef(kitNew(request))); + GRefPtr<WebKitNetworkRequest> networkRequest(adoptGRef(kitNew(request))); WebKitWebView* view = getViewFromFrame(m_frame); webkit_web_view_request_download(view, networkRequest.get()); @@ -1297,7 +1300,7 @@ static void postCommitFrameViewSetup(WebKitWebFrame *frame, FrameView *view, boo g_object_notify(G_OBJECT(containingWindow->priv->viewportAttributes.get()), "valid"); if (priv->currentMenu) { - PlatformRefPtr<GtkMenu> menu(priv->currentMenu); + GRefPtr<GtkMenu> menu(priv->currentMenu); priv->currentMenu.clear(); gtk_menu_popdown(menu.get()); } @@ -1341,6 +1344,14 @@ void FrameLoaderClient::transitionToCommittedForNewPage() postCommitFrameViewSetup(m_frame, frame->view(), true); } +void FrameLoaderClient::didSaveToPageCache() +{ +} + +void FrameLoaderClient::didRestoreFromPageCache() +{ +} + void FrameLoaderClient::dispatchDidBecomeFrameset(bool) { } diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h index ffb3c56..d8d3684 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h @@ -181,6 +181,9 @@ namespace WebKit { virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); + virtual void didSaveToPageCache(); + virtual void didRestoreFromPageCache(); + virtual void dispatchDidBecomeFrameset(bool); virtual bool canCachePage() const; diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp index 158a3b8..c042b5e 100644 --- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp +++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp @@ -545,7 +545,6 @@ void FullscreenVideoController::createHud() m_timeHScale = gtk_hscale_new(adjustment); gtk_scale_set_draw_value(GTK_SCALE(m_timeHScale), FALSE); gtk_range_set_show_fill_level(GTK_RANGE(m_timeHScale), TRUE); - gtk_range_set_update_policy(GTK_RANGE(m_timeHScale), GTK_UPDATE_CONTINUOUS); g_signal_connect(m_timeHScale, "button-press-event", G_CALLBACK(timeScaleButtonPressed), this); g_signal_connect(m_timeHScale, "button-release-event", G_CALLBACK(timeScaleButtonReleased), this); m_hscaleUpdateId = g_signal_connect(m_timeHScale, "value-changed", G_CALLBACK(timeScaleValueChanged), this); diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp index c269078..31af243 100644 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp @@ -24,7 +24,6 @@ #include "InspectorController.h" #include "NotImplemented.h" #include "PlatformString.h" -#include "webkitprivate.h" #include "webkitversion.h" #include "webkitwebinspector.h" #include "webkitwebinspectorprivate.h" @@ -180,7 +179,7 @@ void InspectorClient::populateSetting(const String& key, String* value) if (!settings) return; - PlatformRefPtr<GVariant> variant = adoptPlatformRef(g_settings_get_value(settings, toGSettingName(key).utf8().data())); + GRefPtr<GVariant> variant = adoptGRef(g_settings_get_value(settings, toGSettingName(key).utf8().data())); if (key == "resourceTrackingEnabled" || key == "xhrMonitor" || key == "debuggerEnabled" || key == "profilerEnabled") @@ -198,15 +197,15 @@ void InspectorClient::storeSetting(const String& key, const String& value) if (!settings) return; - PlatformRefPtr<GVariant> variant(0); + GRefPtr<GVariant> variant(0); // Set the key with the appropriate type, and also avoid setting // unknown keys to avoid aborting the execution. if (key == "resourceTrackingEnabled" || key == "xhrMonitor" || key == "debuggerEnabled" || key == "profilerEnabled") - variant = adoptPlatformRef(variantFromTruthString(value)); + variant = adoptGRef(variantFromTruthString(value)); else if (key == "frontendSettings") - variant = adoptPlatformRef(g_variant_new_string(value.utf8().data())); + variant = adoptGRef(g_variant_new_string(value.utf8().data())); if (!variant) return; diff --git a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h index 64fcdba..d00333c 100644 --- a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h +++ b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h @@ -32,8 +32,6 @@ #include "Frame.h" #include "PasteboardHelper.h" -#include <gtk/gtk.h> - using namespace WebCore; namespace WebKit { |