| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebRemoteFrameImpl_h | 5 #ifndef WebRemoteFrameImpl_h |
| 6 #define WebRemoteFrameImpl_h | 6 #define WebRemoteFrameImpl_h |
| 7 | 7 |
| 8 #include "core/frame/FrameOwner.h" | 8 #include "core/frame/FrameOwner.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "public/web/WebRemoteFrame.h" | 10 #include "public/web/WebRemoteFrame.h" |
| 11 #include "public/web/WebRemoteFrameClient.h" | 11 #include "public/web/WebRemoteFrameClient.h" |
| 12 #include "web/RemoteFrameClientImpl.h" | 12 #include "web/RemoteFrameClientImpl.h" |
| 13 #include "wtf/HashMap.h" | 13 #include "wtf/HashMap.h" |
| 14 #include "wtf/OwnPtr.h" | 14 #include "wtf/OwnPtr.h" |
| 15 #include "wtf/RefCounted.h" | 15 #include "wtf/RefCounted.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class FrameHost; | 19 class FrameHost; |
| 20 class FrameOwner; | 20 class FrameOwner; |
| 21 class RemoteFrame; | 21 class RemoteFrame; |
| 22 | 22 |
| 23 class WebRemoteFrameImpl final : public RefCountedWillBeGarbageCollectedFinalize
d<WebRemoteFrameImpl>, public WebRemoteFrame { | 23 class WebRemoteFrameImpl final : public RefCountedWillBeGarbageCollectedFinalize
d<WebRemoteFrameImpl>, public WebRemoteFrame { |
| 24 public: | 24 public: |
| 25 static WebRemoteFrame* create(WebTreeScopeType, WebRemoteFrameClient*); | 25 static WebRemoteFrame* create(WebTreeScopeType, WebRemoteFrameClient*); |
| 26 virtual ~WebRemoteFrameImpl(); | 26 ~WebRemoteFrameImpl() override; |
| 27 | 27 |
| 28 // WebRemoteFrame methods. | 28 // WebRemoteFrame methods. |
| 29 virtual bool isWebLocalFrame() const override; | 29 bool isWebLocalFrame() const override; |
| 30 virtual WebLocalFrame* toWebLocalFrame() override; | 30 WebLocalFrame* toWebLocalFrame() override; |
| 31 virtual bool isWebRemoteFrame() const override; | 31 bool isWebRemoteFrame() const override; |
| 32 virtual WebRemoteFrame* toWebRemoteFrame() override; | 32 WebRemoteFrame* toWebRemoteFrame() override; |
| 33 virtual void close() override; | 33 void close() override; |
| 34 virtual WebString uniqueName() const override; | 34 WebString uniqueName() const override; |
| 35 virtual WebString assignedName() const override; | 35 WebString assignedName() const override; |
| 36 virtual void setName(const WebString&) override; | 36 void setName(const WebString&) override; |
| 37 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const override; | 37 WebVector<WebIconURL> iconURLs(int iconTypesMask) const override; |
| 38 virtual void setRemoteWebLayer(WebLayer*) override; | 38 void setRemoteWebLayer(WebLayer*) override; |
| 39 virtual void setSharedWorkerRepositoryClient(WebSharedWorkerRepositoryClient
*) override; | 39 void setSharedWorkerRepositoryClient(WebSharedWorkerRepositoryClient*) overr
ide; |
| 40 virtual void setCanHaveScrollbars(bool) override; | 40 void setCanHaveScrollbars(bool) override; |
| 41 virtual WebSize scrollOffset() const override; | 41 WebSize scrollOffset() const override; |
| 42 virtual void setScrollOffset(const WebSize&) override; | 42 void setScrollOffset(const WebSize&) override; |
| 43 virtual WebSize minimumScrollOffset() const override; | 43 WebSize minimumScrollOffset() const override; |
| 44 virtual WebSize maximumScrollOffset() const override; | 44 WebSize maximumScrollOffset() const override; |
| 45 virtual WebSize contentsSize() const override; | 45 WebSize contentsSize() const override; |
| 46 virtual bool hasVisibleContent() const override; | 46 bool hasVisibleContent() const override; |
| 47 virtual WebRect visibleContentRect() const override; | 47 WebRect visibleContentRect() const override; |
| 48 virtual bool hasHorizontalScrollbar() const override; | 48 bool hasHorizontalScrollbar() const override; |
| 49 virtual bool hasVerticalScrollbar() const override; | 49 bool hasVerticalScrollbar() const override; |
| 50 virtual WebView* view() const override; | 50 WebView* view() const override; |
| 51 virtual void removeChild(WebFrame*) override; | 51 void removeChild(WebFrame*) override; |
| 52 virtual WebDocument document() const override; | 52 WebDocument document() const override; |
| 53 virtual WebPerformance performance() const override; | 53 WebPerformance performance() const override; |
| 54 virtual bool dispatchBeforeUnloadEvent() override; | 54 bool dispatchBeforeUnloadEvent() override; |
| 55 virtual void dispatchUnloadEvent() override; | 55 void dispatchUnloadEvent() override; |
| 56 virtual NPObject* windowObject() const override; | 56 NPObject* windowObject() const override; |
| 57 virtual void bindToWindowObject(const WebString& name, NPObject*) override; | 57 void bindToWindowObject(const WebString& name, NPObject*) override; |
| 58 virtual void bindToWindowObject(const WebString& name, NPObject*, void*) ove
rride; | 58 void bindToWindowObject(const WebString& name, NPObject*, void*) override; |
| 59 virtual void executeScript(const WebScriptSource&) override; | 59 void executeScript(const WebScriptSource&) override; |
| 60 virtual void executeScriptInIsolatedWorld( | 60 void executeScriptInIsolatedWorld( |
| 61 int worldID, const WebScriptSource* sources, unsigned numSources, | 61 int worldID, const WebScriptSource* sources, unsigned numSources, |
| 62 int extensionGroup) override; | 62 int extensionGroup) override; |
| 63 virtual void setIsolatedWorldSecurityOrigin(int worldID, const WebSecurityOr
igin&) override; | 63 void setIsolatedWorldSecurityOrigin(int worldID, const WebSecurityOrigin&) o
verride; |
| 64 virtual void setIsolatedWorldContentSecurityPolicy(int worldID, const WebStr
ing&) override; | 64 void setIsolatedWorldContentSecurityPolicy(int worldID, const WebString&) ov
erride; |
| 65 virtual void addMessageToConsole(const WebConsoleMessage&) override; | 65 void addMessageToConsole(const WebConsoleMessage&) override; |
| 66 virtual void collectGarbage() override; | 66 void collectGarbage() override; |
| 67 virtual bool checkIfRunInsecureContent(const WebURL&) const override; | 67 bool checkIfRunInsecureContent(const WebURL&) const override; |
| 68 virtual v8::Local<v8::Value> executeScriptAndReturnValue( | 68 v8::Local<v8::Value> executeScriptAndReturnValue( |
| 69 const WebScriptSource&) override; | 69 const WebScriptSource&) override; |
| 70 virtual void executeScriptInIsolatedWorld( | 70 void executeScriptInIsolatedWorld( |
| 71 int worldID, const WebScriptSource* sourcesIn, unsigned numSources, | 71 int worldID, const WebScriptSource* sourcesIn, unsigned numSources, |
| 72 int extensionGroup, WebVector<v8::Local<v8::Value>>* results) override; | 72 int extensionGroup, WebVector<v8::Local<v8::Value>>* results) override; |
| 73 virtual v8::Local<v8::Value> callFunctionEvenIfScriptDisabled( | 73 v8::Local<v8::Value> callFunctionEvenIfScriptDisabled( |
| 74 v8::Local<v8::Function>, | 74 v8::Local<v8::Function>, |
| 75 v8::Local<v8::Value>, | 75 v8::Local<v8::Value>, |
| 76 int argc, | 76 int argc, |
| 77 v8::Local<v8::Value> argv[]) override; | 77 v8::Local<v8::Value> argv[]) override; |
| 78 virtual v8::Local<v8::Context> mainWorldScriptContext() const override; | 78 v8::Local<v8::Context> mainWorldScriptContext() const override; |
| 79 virtual void reload(bool ignoreCache) override; | 79 void reload(bool ignoreCache) override; |
| 80 virtual void reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreCac
he) override; | 80 void reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreCache) over
ride; |
| 81 virtual void loadRequest(const WebURLRequest&) override; | 81 void loadRequest(const WebURLRequest&) override; |
| 82 virtual void loadHistoryItem(const WebHistoryItem&, WebHistoryLoadType, WebU
RLRequest::CachePolicy) override; | 82 void loadHistoryItem(const WebHistoryItem&, WebHistoryLoadType, WebURLReques
t::CachePolicy) override; |
| 83 virtual void loadData( | 83 void loadData( |
| 84 const WebData&, const WebString& mimeType, const WebString& textEncoding
, | 84 const WebData&, const WebString& mimeType, const WebString& textEncoding
, |
| 85 const WebURL& baseURL, const WebURL& unreachableURL, bool replace) overr
ide; | 85 const WebURL& baseURL, const WebURL& unreachableURL, bool replace) overr
ide; |
| 86 virtual void loadHTMLString( | 86 void loadHTMLString( |
| 87 const WebData& html, const WebURL& baseURL, const WebURL& unreachableURL
, | 87 const WebData& html, const WebURL& baseURL, const WebURL& unreachableURL
, |
| 88 bool replace) override; | 88 bool replace) override; |
| 89 virtual void stopLoading() override; | 89 void stopLoading() override; |
| 90 virtual WebDataSource* provisionalDataSource() const override; | 90 WebDataSource* provisionalDataSource() const override; |
| 91 virtual WebDataSource* dataSource() const override; | 91 WebDataSource* dataSource() const override; |
| 92 virtual void enableViewSourceMode(bool enable) override; | 92 void enableViewSourceMode(bool enable) override; |
| 93 virtual bool isViewSourceModeEnabled() const override; | 93 bool isViewSourceModeEnabled() const override; |
| 94 virtual void setReferrerForRequest(WebURLRequest&, const WebURL& referrer) o
verride; | 94 void setReferrerForRequest(WebURLRequest&, const WebURL& referrer) override; |
| 95 virtual void dispatchWillSendRequest(WebURLRequest&) override; | 95 void dispatchWillSendRequest(WebURLRequest&) override; |
| 96 virtual WebURLLoader* createAssociatedURLLoader(const WebURLLoaderOptions&)
override; | 96 WebURLLoader* createAssociatedURLLoader(const WebURLLoaderOptions&) override
; |
| 97 virtual unsigned unloadListenerCount() const override; | 97 unsigned unloadListenerCount() const override; |
| 98 virtual void replaceSelection(const WebString&) override; | 98 void replaceSelection(const WebString&) override; |
| 99 virtual void insertText(const WebString&) override; | 99 void insertText(const WebString&) override; |
| 100 virtual void setMarkedText(const WebString&, unsigned location, unsigned len
gth) override; | 100 void setMarkedText(const WebString&, unsigned location, unsigned length) ove
rride; |
| 101 virtual void unmarkText() override; | 101 void unmarkText() override; |
| 102 virtual bool hasMarkedText() const override; | 102 bool hasMarkedText() const override; |
| 103 virtual WebRange markedRange() const override; | 103 WebRange markedRange() const override; |
| 104 virtual bool firstRectForCharacterRange(unsigned location, unsigned length,
WebRect&) const override; | 104 bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&
) const override; |
| 105 virtual size_t characterIndexForPoint(const WebPoint&) const override; | 105 size_t characterIndexForPoint(const WebPoint&) const override; |
| 106 virtual bool executeCommand(const WebString&, const WebNode& = WebNode()) ov
erride; | 106 bool executeCommand(const WebString&, const WebNode& = WebNode()) override; |
| 107 virtual bool executeCommand(const WebString&, const WebString& value, const
WebNode& = WebNode()) override; | 107 bool executeCommand(const WebString&, const WebString& value, const WebNode&
= WebNode()) override; |
| 108 virtual bool isCommandEnabled(const WebString&) const override; | 108 bool isCommandEnabled(const WebString&) const override; |
| 109 virtual void enableContinuousSpellChecking(bool) override; | 109 void enableContinuousSpellChecking(bool) override; |
| 110 virtual bool isContinuousSpellCheckingEnabled() const override; | 110 bool isContinuousSpellCheckingEnabled() const override; |
| 111 virtual void requestTextChecking(const WebElement&) override; | 111 void requestTextChecking(const WebElement&) override; |
| 112 virtual void replaceMisspelledRange(const WebString&) override; | 112 void replaceMisspelledRange(const WebString&) override; |
| 113 virtual void removeSpellingMarkers() override; | 113 void removeSpellingMarkers() override; |
| 114 virtual bool hasSelection() const override; | 114 bool hasSelection() const override; |
| 115 virtual WebRange selectionRange() const override; | 115 WebRange selectionRange() const override; |
| 116 virtual WebString selectionAsText() const override; | 116 WebString selectionAsText() const override; |
| 117 virtual WebString selectionAsMarkup() const override; | 117 WebString selectionAsMarkup() const override; |
| 118 virtual bool selectWordAroundCaret() override; | 118 bool selectWordAroundCaret() override; |
| 119 virtual void selectRange(const WebPoint& base, const WebPoint& extent) overr
ide; | 119 void selectRange(const WebPoint& base, const WebPoint& extent) override; |
| 120 virtual void selectRange(const WebRange&) override; | 120 void selectRange(const WebRange&) override; |
| 121 virtual void moveRangeSelection(const WebPoint& base, const WebPoint& extent
, WebFrame::TextGranularity = CharacterGranularity) override; | 121 void moveRangeSelection(const WebPoint& base, const WebPoint& extent, WebFra
me::TextGranularity = CharacterGranularity) override; |
| 122 virtual void moveCaretSelection(const WebPoint&) override; | 122 void moveCaretSelection(const WebPoint&) override; |
| 123 virtual bool setEditableSelectionOffsets(int start, int end) override; | 123 bool setEditableSelectionOffsets(int start, int end) override; |
| 124 virtual bool setCompositionFromExistingText(int compositionStart, int compos
itionEnd, const WebVector<WebCompositionUnderline>& underlines) override; | 124 bool setCompositionFromExistingText(int compositionStart, int compositionEnd
, const WebVector<WebCompositionUnderline>& underlines) override; |
| 125 virtual void extendSelectionAndDelete(int before, int after) override; | 125 void extendSelectionAndDelete(int before, int after) override; |
| 126 virtual void setCaretVisible(bool) override; | 126 void setCaretVisible(bool) override; |
| 127 virtual int printBegin(const WebPrintParams&, const WebNode& constrainToNode
) override; | 127 int printBegin(const WebPrintParams&, const WebNode& constrainToNode) overri
de; |
| 128 virtual float printPage(int pageToPrint, WebCanvas*) override; | 128 float printPage(int pageToPrint, WebCanvas*) override; |
| 129 virtual float getPrintPageShrink(int page) override; | 129 float getPrintPageShrink(int page) override; |
| 130 virtual void printEnd() override; | 130 void printEnd() override; |
| 131 virtual bool isPrintScalingDisabledForPlugin(const WebNode&) override; | 131 bool isPrintScalingDisabledForPlugin(const WebNode&) override; |
| 132 virtual bool hasCustomPageSizeStyle(int pageIndex) override; | 132 bool hasCustomPageSizeStyle(int pageIndex) override; |
| 133 virtual bool isPageBoxVisible(int pageIndex) override; | 133 bool isPageBoxVisible(int pageIndex) override; |
| 134 virtual void pageSizeAndMarginsInPixels( | 134 void pageSizeAndMarginsInPixels( |
| 135 int pageIndex, | 135 int pageIndex, |
| 136 WebSize& pageSize, | 136 WebSize& pageSize, |
| 137 int& marginTop, | 137 int& marginTop, |
| 138 int& marginRight, | 138 int& marginRight, |
| 139 int& marginBottom, | 139 int& marginBottom, |
| 140 int& marginLeft) override; | 140 int& marginLeft) override; |
| 141 virtual WebString pageProperty(const WebString& propertyName, int pageIndex)
override; | 141 WebString pageProperty(const WebString& propertyName, int pageIndex) overrid
e; |
| 142 virtual void printPagesWithBoundaries(WebCanvas*, const WebSize&) override; | 142 void printPagesWithBoundaries(WebCanvas*, const WebSize&) override; |
| 143 virtual bool find( | 143 bool find( |
| 144 int identifier, const WebString& searchText, const WebFindOptions&, | 144 int identifier, const WebString& searchText, const WebFindOptions&, |
| 145 bool wrapWithinFrame, WebRect* selectionRect) override; | 145 bool wrapWithinFrame, WebRect* selectionRect) override; |
| 146 virtual void stopFinding(bool clearSelection) override; | 146 void stopFinding(bool clearSelection) override; |
| 147 virtual void scopeStringMatches( | 147 void scopeStringMatches( |
| 148 int identifier, const WebString& searchText, const WebFindOptions&, | 148 int identifier, const WebString& searchText, const WebFindOptions&, |
| 149 bool reset) override; | 149 bool reset) override; |
| 150 virtual void cancelPendingScopingEffort() override; | 150 void cancelPendingScopingEffort() override; |
| 151 virtual void increaseMatchCount(int count, int identifier) override; | 151 void increaseMatchCount(int count, int identifier) override; |
| 152 virtual void resetMatchCount() override; | 152 void resetMatchCount() override; |
| 153 virtual int findMatchMarkersVersion() const override; | 153 int findMatchMarkersVersion() const override; |
| 154 virtual WebFloatRect activeFindMatchRect() override; | 154 WebFloatRect activeFindMatchRect() override; |
| 155 virtual void findMatchRects(WebVector<WebFloatRect>&) override; | 155 void findMatchRects(WebVector<WebFloatRect>&) override; |
| 156 virtual int selectNearestFindMatch(const WebFloatPoint&, WebRect* selectionR
ect) override; | 156 int selectNearestFindMatch(const WebFloatPoint&, WebRect* selectionRect) ove
rride; |
| 157 virtual void setTickmarks(const WebVector<WebRect>&) override; | 157 void setTickmarks(const WebVector<WebRect>&) override; |
| 158 virtual void dispatchMessageEventWithOriginCheck( | 158 void dispatchMessageEventWithOriginCheck( |
| 159 const WebSecurityOrigin& intendedTargetOrigin, | 159 const WebSecurityOrigin& intendedTargetOrigin, |
| 160 const WebDOMEvent&) override; | 160 const WebDOMEvent&) override; |
| 161 | 161 |
| 162 virtual WebString contentAsText(size_t maxChars) const override; | 162 WebString contentAsText(size_t maxChars) const override; |
| 163 virtual WebString contentAsMarkup() const override; | 163 WebString contentAsMarkup() const override; |
| 164 virtual WebString layoutTreeAsText(LayoutAsTextControls toShow = LayoutAsTex
tNormal) const override; | 164 WebString layoutTreeAsText(LayoutAsTextControls toShow = LayoutAsTextNormal)
const override; |
| 165 virtual WebString markerTextForListItem(const WebElement&) const override; | 165 WebString markerTextForListItem(const WebElement&) const override; |
| 166 virtual WebRect selectionBoundsRect() const override; | 166 WebRect selectionBoundsRect() const override; |
| 167 | 167 |
| 168 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const
override; | 168 bool selectionStartHasSpellingMarkerFor(int from, int length) const override
; |
| 169 virtual WebString layerTreeAsText(bool showDebugInfo = false) const override
; | 169 WebString layerTreeAsText(bool showDebugInfo = false) const override; |
| 170 | 170 |
| 171 virtual WebLocalFrame* createLocalChild(WebTreeScopeType, const WebString& n
ame, WebSandboxFlags, WebFrameClient*, WebFrame* previousSibling) override; | 171 WebLocalFrame* createLocalChild(WebTreeScopeType, const WebString& name, Web
SandboxFlags, WebFrameClient*, WebFrame* previousSibling) override; |
| 172 virtual WebRemoteFrame* createRemoteChild(WebTreeScopeType, const WebString&
name, WebSandboxFlags, WebRemoteFrameClient*) override; | 172 WebRemoteFrame* createRemoteChild(WebTreeScopeType, const WebString& name, W
ebSandboxFlags, WebRemoteFrameClient*) override; |
| 173 | 173 |
| 174 void initializeCoreFrame(FrameHost*, FrameOwner*, const AtomicString& name); | 174 void initializeCoreFrame(FrameHost*, FrameOwner*, const AtomicString& name); |
| 175 | 175 |
| 176 void setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame>); | 176 void setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame>); |
| 177 RemoteFrame* frame() const { return m_frame.get(); } | 177 RemoteFrame* frame() const { return m_frame.get(); } |
| 178 | 178 |
| 179 WebRemoteFrameClient* client() const { return m_client; } | 179 WebRemoteFrameClient* client() const { return m_client; } |
| 180 | 180 |
| 181 static WebRemoteFrameImpl* fromFrame(RemoteFrame&); | 181 static WebRemoteFrameImpl* fromFrame(RemoteFrame&); |
| 182 | 182 |
| 183 virtual void initializeFromFrame(WebLocalFrame*) const override; | 183 void initializeFromFrame(WebLocalFrame*) const override; |
| 184 | 184 |
| 185 virtual void setReplicatedOrigin(const WebSecurityOrigin&) const override; | 185 void setReplicatedOrigin(const WebSecurityOrigin&) const override; |
| 186 virtual void setReplicatedSandboxFlags(WebSandboxFlags) const override; | 186 void setReplicatedSandboxFlags(WebSandboxFlags) const override; |
| 187 virtual void setReplicatedName(const WebString&) const override; | 187 void setReplicatedName(const WebString&) const override; |
| 188 virtual void DispatchLoadEventForFrameOwner() const override; | 188 void DispatchLoadEventForFrameOwner() const override; |
| 189 | 189 |
| 190 void didStartLoading() override; | 190 void didStartLoading() override; |
| 191 void didStopLoading() override; | 191 void didStopLoading() override; |
| 192 | 192 |
| 193 #if ENABLE(OILPAN) | 193 #if ENABLE(OILPAN) |
| 194 DECLARE_TRACE(); | 194 DECLARE_TRACE(); |
| 195 #endif | 195 #endif |
| 196 | 196 |
| 197 private: | 197 private: |
| 198 WebRemoteFrameImpl(WebTreeScopeType, WebRemoteFrameClient*); | 198 WebRemoteFrameImpl(WebTreeScopeType, WebRemoteFrameClient*); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 213 GC_PLUGIN_IGNORE("340522") | 213 GC_PLUGIN_IGNORE("340522") |
| 214 Persistent<WebRemoteFrameImpl> m_selfKeepAlive; | 214 Persistent<WebRemoteFrameImpl> m_selfKeepAlive; |
| 215 #endif | 215 #endif |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 DEFINE_TYPE_CASTS(WebRemoteFrameImpl, WebFrame, frame, frame->isWebRemoteFrame()
, frame.isWebRemoteFrame()); | 218 DEFINE_TYPE_CASTS(WebRemoteFrameImpl, WebFrame, frame, frame->isWebRemoteFrame()
, frame.isWebRemoteFrame()); |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| 221 | 221 |
| 222 #endif // WebRemoteFrameImpl_h | 222 #endif // WebRemoteFrameImpl_h |
| OLD | NEW |