webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
FrameLoadDelegate.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2007, 2015 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of Apple Inc. ("Apple") nor the names of
14  * its contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef FrameLoadDelegate_h
30 #define FrameLoadDelegate_h
31 
32 #include <WebKit/WebKit.h>
33 
36 class GCController;
37 
39 public:
41  virtual ~FrameLoadDelegate();
42 
43  void processWork();
44 
46 
47  AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); }
48 
49  // IUnknown
50  virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
51  virtual ULONG STDMETHODCALLTYPE AddRef();
52  virtual ULONG STDMETHODCALLTYPE Release();
53 
54  // IWebFrameLoadDelegate
55  virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
56  virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
57  virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(_In_opt_ IWebView*, _In_opt_ IWebError*, _In_opt_ IWebFrame*);
58  virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
59  virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(_In_opt_ IWebView*, _In_ BSTR title, _In_opt_ IWebFrame*);
60  virtual HRESULT STDMETHODCALLTYPE didChangeIcons(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
61  virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(_In_opt_ IWebView*, _In_ HBITMAP, _In_opt_ IWebFrame*) { return E_NOTIMPL; }
62  virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
63  virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(_In_opt_ IWebView*, _In_opt_ IWebError*, _In_opt_ IWebFrame*);
64  virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
65  virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(_In_opt_ IWebView*, _In_ BSTR url, double delaySeconds, DATE fireDate, _In_opt_ IWebFrame*);
66  virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
67  virtual HRESULT STDMETHODCALLTYPE willCloseFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*);
68  virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(IWebView*, JSContextRef, JSObjectRef windowObject);
69  virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(IWebView*, JSContextRef, JSObjectRef windowObject, IWebFrame*);
70 
71  // IWebFrameLoadDelegatePrivate
72  virtual HRESULT STDMETHODCALLTYPE didFinishDocumentLoadForFrame(_In_opt_ IWebView* sender, _In_opt_ IWebFrame*);
73  virtual HRESULT STDMETHODCALLTYPE didFirstLayoutInFrame(_In_opt_ IWebView* sender, _In_opt_ IWebFrame*) { return E_NOTIMPL; }
74  virtual HRESULT STDMETHODCALLTYPE didHandleOnloadEventsForFrame(_In_opt_ IWebView* sender, _In_opt_ IWebFrame*);
75  virtual HRESULT STDMETHODCALLTYPE didFirstVisuallyNonEmptyLayoutInFrame(_In_opt_ IWebView* sender, _In_opt_ IWebFrame*);
76 
77  // IWebFrameLoadDelegatePrivate2
78  virtual HRESULT STDMETHODCALLTYPE didDisplayInsecureContent(_In_opt_ IWebView*);
79  virtual HRESULT STDMETHODCALLTYPE didRunInsecureContent(_In_opt_ IWebView*, _In_opt_ IWebSecurityOrigin*);
80  virtual HRESULT STDMETHODCALLTYPE didClearWindowObjectForFrameInScriptWorld(_In_opt_ IWebView*, _In_opt_ IWebFrame*, _In_opt_ IWebScriptWorld*);
81  virtual HRESULT STDMETHODCALLTYPE didPushStateWithinPageForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*) { return E_NOTIMPL; }
82  virtual HRESULT STDMETHODCALLTYPE didReplaceStateWithinPageForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*) { return E_NOTIMPL; }
83  virtual HRESULT STDMETHODCALLTYPE didPopStateWithinPageForFrame(_In_opt_ IWebView*, _In_opt_ IWebFrame*) { return E_NOTIMPL; }
84 
85  // IWebNotificationObserver
86  virtual HRESULT STDMETHODCALLTYPE onNotify(_In_opt_ IWebNotification*);
87 
88 private:
89  void didClearWindowObjectForFrameInIsolatedWorld(IWebFrame*, IWebScriptWorld*);
90  void didClearWindowObjectForFrameInStandardWorld(IWebFrame*);
91 
92  void locationChangeDone(IWebError*, IWebFrame*);
93  void webViewProgressFinishedNotification();
94 
95  std::unique_ptr<GCController> m_gcController;
96  std::unique_ptr<AccessibilityController> m_accessibilityController;
97  std::unique_ptr<TextInputController> m_textInputController;
98  ULONG m_refCount { 1 };
99 };
100 
101 #endif // FrameLoadDelegate_h
virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(_In_opt_ IWebView *, _In_ BSTR url, double delaySeconds, DATE fireDate, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:270
virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void **ppvObject)
Definition: FrameLoadDelegate.cpp:87
virtual HRESULT STDMETHODCALLTYPE didRunInsecureContent(_In_opt_ IWebView *, _In_opt_ IWebSecurityOrigin *)
Definition: FrameLoadDelegate.cpp:419
virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(IWebView *, JSContextRef, JSObjectRef windowObject)
Definition: FrameLoadDelegate.cpp:293
virtual HRESULT STDMETHODCALLTYPE didFirstLayoutInFrame(_In_opt_ IWebView *sender, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.h:73
Definition: IWebNotification.idl:37
virtual HRESULT STDMETHODCALLTYPE didHandleOnloadEventsForFrame(_In_opt_ IWebView *sender, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:397
virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:123
Definition: rtpw.c:144
virtual ULONG STDMETHODCALLTYPE AddRef()
Definition: FrameLoadDelegate.cpp:109
unsigned long ULONG
Definition: MD5.h:32
Definition: FrameLoadDelegate.h:35
Definition: IWebError.idl:130
HRESULT
Definition: RenderThemeWin.cpp:150
virtual HRESULT STDMETHODCALLTYPE didFinishDocumentLoadForFrame(_In_opt_ IWebView *sender, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:375
const struct OpaqueJSContext * JSContextRef
Definition: JSBase.h:43
Definition: GCController.h:34
virtual HRESULT STDMETHODCALLTYPE didPushStateWithinPageForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.h:81
void resetToConsistentState()
Definition: FrameLoadDelegate.mm:153
title('Estimate ms')
virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(_In_opt_ IWebView *, _In_ HBITMAP, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.h:61
virtual HRESULT STDMETHODCALLTYPE willCloseFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:288
virtual HRESULT STDMETHODCALLTYPE didPopStateWithinPageForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.h:83
virtual ~FrameLoadDelegate()
Definition: FrameLoadDelegate.cpp:83
wchar_t * BSTR
Definition: BString.h:36
Definition: TextInputController.h:35
AccessibilityController * accessibilityController() const
Definition: FrameLoadDelegate.h:47
virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:279
virtual HRESULT STDMETHODCALLTYPE didChangeIcons(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:185
Definition: IWebNotificationObserver.idl:39
virtual ULONG STDMETHODCALLTYPE Release()
Definition: FrameLoadDelegate.cpp:114
virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(_In_opt_ IWebView *, _In_ BSTR title, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:175
Definition: IWebFrame.idl:66
struct OpaqueJSValue * JSObjectRef
Definition: JSBase.h:69
FrameLoadDelegate()
Definition: FrameLoadDelegate.cpp:76
virtual HRESULT STDMETHODCALLTYPE didReplaceStateWithinPageForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.h:82
virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:161
virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(_In_opt_ IWebView *, _In_opt_ IWebError *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:261
Definition: IWebFrameLoadDelegate.idl:55
url
Definition: setup.py:223
Definition: IWebFrameLoadDelegatePrivate2.idl:44
virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:252
void processWork()
Definition: FrameLoadDelegate.cpp:192
virtual HRESULT STDMETHODCALLTYPE didClearWindowObject(IWebView *, JSContextRef, JSObjectRef windowObject, IWebFrame *)
Definition: FrameLoadDelegate.cpp:303
Definition: IWebView.idl:161
virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:144
virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(_In_opt_ IWebView *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:136
virtual HRESULT STDMETHODCALLTYPE didClearWindowObjectForFrameInScriptWorld(_In_opt_ IWebView *, _In_opt_ IWebFrame *, _In_opt_ IWebScriptWorld *)
Definition: FrameLoadDelegate.cpp:308
Definition: IWebSecurityOrigin.idl:40
Definition: AccessibilityController.h:43
virtual HRESULT STDMETHODCALLTYPE onNotify(_In_opt_ IWebNotification *)
Definition: FrameLoadDelegate.cpp:427
virtual HRESULT STDMETHODCALLTYPE didDisplayInsecureContent(_In_opt_ IWebView *)
Definition: FrameLoadDelegate.cpp:411
Definition: IWebScriptWorld.idl:37
virtual HRESULT STDMETHODCALLTYPE didFirstVisuallyNonEmptyLayoutInFrame(_In_opt_ IWebView *sender, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:406
virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(_In_opt_ IWebView *, _In_opt_ IWebError *, _In_opt_ IWebFrame *)
Definition: FrameLoadDelegate.cpp:152