summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/WebFrame.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebFrame.h')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebFrame.h58
1 files changed, 42 insertions, 16 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.h b/Source/WebKit2/WebProcess/WebPage/WebFrame.h
index e337f1e92..5142a3704 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,6 +27,8 @@
#define WebFrame_h
#include "APIObject.h"
+#include "DownloadID.h"
+#include "ShareableBitmap.h"
#include "WKBase.h"
#include "WebFrameLoaderClient.h"
#include <JavaScriptCore/JSBase.h>
@@ -43,41 +45,48 @@ class Array;
}
namespace WebCore {
+class CertificateInfo;
class Frame;
class HTMLFrameOwnerElement;
class IntPoint;
class IntRect;
+class SessionID;
class URL;
}
namespace WebKit {
+class InjectedBundleFileHandle;
class InjectedBundleHitTestResult;
class InjectedBundleNodeHandle;
class InjectedBundleRangeHandle;
class InjectedBundleScriptWorld;
class WebPage;
+struct FrameInfoData;
class WebFrame : public API::ObjectImpl<API::Object::Type::BundleFrame> {
public:
- static PassRefPtr<WebFrame> createWithCoreMainFrame(WebPage*, WebCore::Frame*);
- static PassRefPtr<WebFrame> createSubframe(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
+ static Ref<WebFrame> createWithCoreMainFrame(WebPage*, WebCore::Frame*);
+ static Ref<WebFrame> createSubframe(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
~WebFrame();
// Called when the FrameLoaderClient (and therefore the WebCore::Frame) is being torn down.
void invalidate();
WebPage* page() const;
+
+ static WebFrame* fromCoreFrame(WebCore::Frame&);
WebCore::Frame* coreFrame() const { return m_coreFrame; }
+ FrameInfoData info() const;
uint64_t frameID() const { return m_frameID; }
uint64_t setUpPolicyListener(WebCore::FramePolicyFunction);
void invalidatePolicyListener();
- void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t downloadID);
+ void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, DownloadID);
- void startDownload(const WebCore::ResourceRequest&);
- void convertMainResourceLoadToDownload(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
+ void startDownload(const WebCore::ResourceRequest&, const String& suggestedName = { });
+ void convertMainResourceLoadToDownload(WebCore::DocumentLoader*, WebCore::SessionID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
String source() const;
String contentsAsString() const;
@@ -89,10 +98,11 @@ public:
bool isMainFrame() const;
String name() const;
String url() const;
+ WebCore::CertificateInfo certificateInfo() const;
String innerText() const;
bool isFrameSet() const;
WebFrame* parentFrame() const;
- PassRefPtr<API::Array> childFrames();
+ Ref<API::Array> childFrames();
JSGlobalContextRef jsContext();
JSGlobalContextRef jsContextForWorld(InjectedBundleScriptWorld*);
WebCore::IntRect contentBounds() const;
@@ -107,11 +117,14 @@ public:
bool containsAnyFormControls() const;
void stopLoading();
bool handlesPageScaleGesture() const;
+ bool requiresUnifiedScaleFactor() const;
+ void setAccessibleName(const String&);
static WebFrame* frameForContext(JSContextRef);
JSValueRef jsWrapperForWorld(InjectedBundleNodeHandle*, InjectedBundleScriptWorld*);
JSValueRef jsWrapperForWorld(InjectedBundleRangeHandle*, InjectedBundleScriptWorld*);
+ JSValueRef jsWrapperForWorld(InjectedBundleFileHandle*, InjectedBundleScriptWorld*);
static String counterValue(JSObjectRef element);
@@ -127,6 +140,8 @@ public:
void setTextDirection(const String&);
+ void documentLoaderDetached(uint64_t navigationID);
+
// Simple listener class used by plug-ins to know when frames finish or fail loading.
class LoadListener {
public:
@@ -138,25 +153,36 @@ public:
void setLoadListener(LoadListener* loadListener) { m_loadListener = loadListener; }
LoadListener* loadListener() const { return m_loadListener; }
-#if PLATFORM(MAC)
+#if PLATFORM(COCOA)
typedef bool (*FrameFilterFunction)(WKBundleFrameRef, WKBundleFrameRef subframe, void* context);
RetainPtr<CFDataRef> webArchiveData(FrameFilterFunction, void* context);
#endif
+ PassRefPtr<ShareableBitmap> createSelectionSnapshot() const;
+
+#if PLATFORM(IOS)
+ uint64_t firstLayerTreeTransactionIDAfterDidCommitLoad() const { return m_firstLayerTreeTransactionIDAfterDidCommitLoad; }
+ void setFirstLayerTreeTransactionIDAfterDidCommitLoad(uint64_t transactionID) { m_firstLayerTreeTransactionIDAfterDidCommitLoad = transactionID; }
+#endif
+
private:
- static PassRefPtr<WebFrame> create(std::unique_ptr<WebFrameLoaderClient>);
- WebFrame(std::unique_ptr<WebFrameLoaderClient>);
+ static Ref<WebFrame> create(std::unique_ptr<WebFrameLoaderClient>);
+ explicit WebFrame(std::unique_ptr<WebFrameLoaderClient>);
- WebCore::Frame* m_coreFrame;
+ WebCore::Frame* m_coreFrame { nullptr };
- uint64_t m_policyListenerID;
- WebCore::FramePolicyFunction m_policyFunction;
- uint64_t m_policyDownloadID;
+ uint64_t m_policyListenerID { 0 };
+ WebCore::FramePolicyFunction m_policyFunction { nullptr };
+ DownloadID m_policyDownloadID { 0 };
std::unique_ptr<WebFrameLoaderClient> m_frameLoaderClient;
- LoadListener* m_loadListener;
+ LoadListener* m_loadListener { nullptr };
- uint64_t m_frameID;
+ uint64_t m_frameID { 0 };
+
+#if PLATFORM(IOS)
+ uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad { 0 };
+#endif
};
} // namespace WebKit