summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebFrameImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/WebFrameImpl.h')
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h
index a2fe797e3..2686aad1d 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.h
+++ b/Source/WebKit/chromium/src/WebFrameImpl.h
@@ -35,6 +35,7 @@
#include "WebFrame.h"
#include "Frame.h"
+#include "FrameDestructionObserver.h"
#include "FrameLoaderClientImpl.h"
#include <wtf/Compiler.h>
#include <wtf/OwnPtr.h>
@@ -69,10 +70,12 @@ struct WebPrintParams;
template <typename T> class WebVector;
// Implementation of WebFrame, note that this is a reference counted object.
-class WebFrameImpl : public WebFrame, public RefCounted<WebFrameImpl> {
+class WebFrameImpl
+ : public WebFrame
+ , public RefCounted<WebFrameImpl>
+ , public WebCore::FrameDestructionObserver {
public:
// WebFrame methods:
- virtual WebString name() const;
virtual WebString uniqueName() const;
virtual WebString assignedName() const;
virtual void setName(const WebString&);
@@ -240,6 +243,9 @@ public:
virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const;
virtual WebString layerTreeAsText(bool showDebugInfo = false) const;
+ // WebCore::FrameDestructionObserver methods.
+ virtual void willDetachPage();
+
static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
virtual ~WebFrameImpl();
@@ -262,8 +268,7 @@ public:
WebViewImpl* viewImpl() const;
- WebCore::Frame* frame() const { return m_frame; }
- WebCore::FrameView* frameView() const { return m_frame ? m_frame->view() : 0; }
+ WebCore::FrameView* frameView() const { return frame() ? frame()->view() : 0; }
// Getters for the impls corresponding to Get(Provisional)DataSource. They
// may return 0 if there is no corresponding data source.
@@ -325,11 +330,10 @@ private:
InvalidateAll // Both content area and the scrollbar.
};
- WebFrameImpl(WebFrameClient*);
+ explicit WebFrameImpl(WebFrameClient*);
- // Informs the WebFrame that the Frame is being closed, called by the
- // WebFrameLoaderClient
- void closing();
+ // Sets the local WebCore frame and registers destruction observers.
+ void setWebCoreFrame(WebCore::Frame*);
// Notifies the delegate about a new selection rect.
void reportFindInPageSelection(
@@ -382,6 +386,11 @@ private:
// was searched.
bool shouldScopeMatches(const WTF::String& searchText);
+ // Removes the current frame from the global scoping effort and triggers any
+ // updates if appropriate. This method does not mark the scoping operation
+ // as finished.
+ void flushCurrentScopingEffort(int identifier);
+
// Finishes the current scoping effort and triggers any updates if appropriate.
void finishCurrentScopingEffort(int identifier);
@@ -407,10 +416,6 @@ private:
WebFrameClient* m_client;
- // This is a weak pointer to our corresponding WebCore frame. A reference to
- // ourselves is held while frame_ is valid. See our Closing method.
- WebCore::Frame* m_frame;
-
// A way for the main frame to keep track of which frame has an active
// match. Should be 0 for all other frames.
WebFrameImpl* m_currentActiveMatchFrame;
@@ -438,8 +443,7 @@ private:
// Keeps track of how many matches this frame has found so far, so that we
// don't loose count between scoping efforts, and is also used (in conjunction
- // with m_lastSearchString and m_scopingComplete) to figure out if we need to
- // search the frame again.
+ // with m_lastSearchString) to figure out if we need to search the frame again.
int m_lastMatchCount;
// This variable keeps a cumulative total of matches found so far for ALL the
@@ -452,9 +456,12 @@ private:
// It should be -1 for all other frames.
int m_framesScopingCount;
- // Keeps track of whether the scoping effort was completed (the user may
- // interrupt it before it completes by submitting a new search).
- bool m_scopingComplete;
+ // Identifier of the latest find-in-page request. Required to be stored in
+ // the frame in order to reply if required in case the frame is detached.
+ int m_findRequestIdentifier;
+
+ // Keeps track of whether there is an scoping effort ongoing in the frame.
+ bool m_scopingInProgress;
// Keeps track of whether the last find request completed its scoping effort
// without finding any matches in this frame.