Changeset 73965 in webkit
- Timestamp:
- Dec 13, 2010 2:38:27 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 54 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r73963 r73965 1 2010-12-13 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Change the WebKit2 public API so there is no explicit WKPageNamespace object 6 https://bugs.webkit.org/show_bug.cgi?id=50898 7 8 * Shared/API/c/WKBase.h: Remove definition of WKPageNamespaceRef. 9 * UIProcess/API/C/WKAPICast.h: Remove toAPI/toImpl for WKPageNamespaceRef. 10 11 * UIProcess/API/C/WKPage.cpp: 12 * UIProcess/API/C/WKPage.h: 13 Replace WKPageGetPageNamespace with WKPageGetContext. 14 15 * UIProcess/API/C/WKPageNamespace.cpp: Removed. 16 * UIProcess/API/C/WKPageNamespace.h: Removed. 17 18 * UIProcess/API/C/WebKit2.h: Remove #include of WKPageNamespace.h. 19 20 * UIProcess/API/C/win/WKView.cpp: 21 (WKViewCreate): Changed to take a WKContextRef instead of a WKPageNamespaceRef. 22 (WKViewCreateUsingSharedProcess): Added. Similar to WKViewCreate except that 23 all callers of it will have their views end up in the same shared process, whereas 24 with WKViewCreate, a new internal page namespace will be created and could place 25 the view's WebPage into a new process. 26 (WKViewCreateForAssociatedPage): Added. Creates a view that is forced to use the 27 same process as the passed in page. 28 29 * UIProcess/win/WebView.cpp: 30 (WebKit::WebView::WebView): 31 (WebKit::WebView::initialize): 32 * UIProcess/win/WebView.h: 33 (WebKit::WebView::create): 34 (WebKit::WebView::createUsingSharedProcess): 35 (WebKit::WebView::createForAssociatedPage): 36 Implementation of the WKView create functions. 37 38 * UIProcess/API/C/win/WKView.h: 39 * UIProcess/API/mac/WKView.h: 40 * UIProcess/API/mac/WKView.mm: 41 (-[WKView initWithFrame:]): 42 (-[WKView initWithFrame:contextRef:]): 43 (-[WKView initWithFrame:contextRef:pageGroupRef:]): 44 (-[WKView initWithFrame:contextRef:usingSharedProcess:]): 45 (-[WKView initWithFrame:contextRef:pageGroupRef:usingSharedProcess:]): 46 (-[WKView initWithFrame:forAssociatedPageRef:]): 47 (-[WKView initWithFrame:forAssociatedPageRef:pageGroupRef:]): 48 (-[WKView initWithFrame:pageNamespace:pageGroup:]): 49 Add new initializers for the objective-c WKView. It follows the same 50 pattern as WKViewRef. 51 52 * UIProcess/API/qt/qwkcontext.cpp: 53 (QWKContext::QWKContext): 54 * UIProcess/API/qt/qwkcontext.h: 55 Remove uses of WKPageNamespaceRef. 56 57 * UIProcess/WebContext.cpp: 58 (WebKit::WebContext::sharedPageNamespace): Returns a shared 59 page namespace used by the view's createUsingSharedProcess constructions. 60 (WebKit::WebContext::createPageNamespace): Change to return 61 a PassRefPtr to make things clearer. 62 (WebKit::WebContext::pageNamespaceWasDestroyed): Clear the shared 63 namespace if it is cleared. 64 * UIProcess/WebContext.h: 65 66 * UIProcess/WebPageNamespace.h: Remove unused "struct WKContextStatistics". 67 68 * UIProcess/WebPageProxy.cpp: 69 (WebKit::WebPageProxy::context): 70 * UIProcess/WebPageProxy.h: 71 Add context getter. 72 73 * UIProcess/mac/WebInspectorProxyMac.mm: 74 (WebKit::WebInspectorProxy::platformCreateInspectorPage): 75 * UIProcess/win/WebInspectorProxyWin.cpp: 76 (WebKit::WebInspectorProxy::platformCreateInspectorPage): 77 Use forAssociatedPageRef constructor for the WebInspector view. 78 79 * WebKit2.pro: 80 * WebKit2.xcodeproj/project.pbxproj: 81 * win/WebKit2.vcproj: 82 * win/WebKit2Generated.make: 83 Remove WKPageNamespace.h/cpp. 84 1 85 2010-12-13 Brent Fulgham <bfulgham@webkit.org> 2 86 -
trunk/WebKit2/Shared/API/c/WKBase.h
r73808 r73965 76 76 typedef const struct OpaqueWKPage* WKPageRef; 77 77 typedef const struct OpaqueWKPageGroup* WKPageGroupRef; 78 typedef const struct OpaqueWKPageNamespace* WKPageNamespaceRef;79 78 typedef const struct OpaqueWKPreferences* WKPreferencesRef; 80 79 typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef; -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r73808 r73965 55 55 class WebNavigationData; 56 56 class WebPageGroup; 57 class WebPageNamespace;58 57 class WebPageProxy; 59 58 class WebPreferences; … … 71 70 WK_ADD_API_MAPPING(WKFramePolicyListenerRef, WebFramePolicyListenerProxy) 72 71 WK_ADD_API_MAPPING(WKFrameRef, WebFrameProxy) 73 #if ENABLE(INSPECTOR)74 WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy)75 #endif76 72 WK_ADD_API_MAPPING(WKNavigationDataRef, WebNavigationData) 77 73 WK_ADD_API_MAPPING(WKPageGroupRef, WebPageGroup) 78 WK_ADD_API_MAPPING(WKPageNamespaceRef, WebPageNamespace)79 74 WK_ADD_API_MAPPING(WKPageRef, WebPageProxy) 80 75 WK_ADD_API_MAPPING(WKPreferencesRef, WebPreferences) 81 76 WK_ADD_API_MAPPING(WKProtectionSpaceRef, WebProtectionSpace) 77 78 #if ENABLE(INSPECTOR) 79 WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy) 80 #endif 82 81 83 82 /* Enum conversions */ -
trunk/WebKit2/UIProcess/API/C/WKPage.cpp
r73565 r73965 43 43 } 44 44 45 WK PageNamespaceRef WKPageGetPageNamespace(WKPageRef pageRef)46 { 47 return toAPI(toImpl(pageRef)-> pageNamespace());45 WKContextRef WKPageGetContext(WKPageRef pageRef) 46 { 47 return toAPI(toImpl(pageRef)->context()); 48 48 } 49 49 -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r73614 r73965 218 218 WK_EXPORT WKTypeID WKPageGetTypeID(); 219 219 220 WK_EXPORT WK PageNamespaceRef WKPageGetPageNamespace(WKPageRef page);220 WK_EXPORT WKContextRef WKPageGetContext(WKPageRef page); 221 221 WK_EXPORT WKPageGroupRef WKPageGetPageGroup(WKPageRef page); 222 222 -
trunk/WebKit2/UIProcess/API/C/WebKit2.h
r73066 r73965 46 46 #include <WebKit2/WKPage.h> 47 47 #include <WebKit2/WKPageGroup.h> 48 #include <WebKit2/WKPageNamespace.h>49 48 #include <WebKit2/WKPreferences.h> 50 49 #include <WebKit2/WKString.h> -
trunk/WebKit2/UIProcess/API/C/win/WKView.cpp
r73068 r73965 36 36 } 37 37 38 WKViewRef WKViewCreate(RECT rect, WK PageNamespaceRef pageNamespaceRef, WKPageGroupRef pageGroupRef, HWND parentWindow)38 WKViewRef WKViewCreate(RECT rect, WKContextRef contextRef, WKPageGroupRef pageGroupRef, HWND parentWindow) 39 39 { 40 RefPtr<WebView> view = WebView::create(rect, toImpl(pageNamespaceRef), toImpl(pageGroupRef), parentWindow); 40 RefPtr<WebView> view = WebView::create(rect, toImpl(contextRef), toImpl(pageGroupRef), parentWindow); 41 return toAPI(view.release().releaseRef()); 42 } 43 44 WKViewRef WKViewCreateUsingSharedProcess(RECT rect, WKContextRef contextRef, WKPageGroupRef pageGroupRef, HWND parentWindow) 45 { 46 RefPtr<WebView> view = WebView::createUsingSharedProcess(rect, toImpl(contextRef), toImpl(pageGroupRef), parentWindow); 47 return toAPI(view.release().releaseRef()); 48 } 49 50 WKViewRef WKViewCreateForAssociatedPage(RECT rect, WKPageRef pageRef, WKPageGroupRef pageGroupRef, HWND parentWindow) 51 { 52 RefPtr<WebView> view = WebView::createForAssociatedPage(rect, toImpl(pageRef), toImpl(pageGroupRef), parentWindow); 41 53 return toAPI(view.release().releaseRef()); 42 54 } -
trunk/WebKit2/UIProcess/API/C/win/WKView.h
r73066 r73965 36 36 WK_EXPORT WKTypeID WKViewGetTypeID(); 37 37 38 WK_EXPORT WKViewRef WKViewCreate(RECT rect, WKPageNamespaceRef pageNamespace, WKPageGroupRef pageGroup, HWND parentWindow); 38 WK_EXPORT WKViewRef WKViewCreate(RECT rect, WKContextRef context, WKPageGroupRef pageGroup, HWND parentWindow); 39 WK_EXPORT WKViewRef WKViewCreateUsingSharedProcess(RECT rect, WKContextRef context, WKPageGroupRef pageGroup, HWND parentWindow); 40 WK_EXPORT WKViewRef WKViewCreateForAssociatedPage(RECT rect, WKPageRef page, WKPageGroupRef pageGroup, HWND parentWindow); 39 41 40 42 WK_EXPORT HWND WKViewGetWindow(WKViewRef view); -
trunk/WebKit2/UIProcess/API/mac/WKView.h
r73666 r73965 34 34 } 35 35 36 - (id)initWithFrame:(NSRect)frame pageNamespaceRef:(WKPageNamespaceRef)pageNamespaceRef;37 - (id)initWithFrame:(NSRect)frame pageNamespaceRef:(WKPageNamespaceRef)pageNamespaceRef pageGroupRef:(WKPageGroupRef)pageGroupRef;36 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef; 37 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef; 38 38 39 - (WKPageRef)pageRef; 39 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef usingSharedProcess:(BOOL)usingSharedProcess; 40 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef usingSharedProcess:(BOOL)usingSharedProcess;; 40 41 41 - ( void)setDrawsBackground:(BOOL)flag;42 - ( BOOL)drawsBackground;42 - (id)initWithFrame:(NSRect)frame forAssociatedPageRef:(WKPageRef)pageRef; 43 - (id)initWithFrame:(NSRect)frame forAssociatedPageRef:(WKPageRef)pageRef pageGroupRef:(WKPageGroupRef)pageGroupRef; 43 44 44 - (void)setDrawsTransparentBackground:(BOOL)flag; 45 - (BOOL)drawsTransparentBackground; 45 @property(readonly) WKPageRef pageRef; 46 47 @property BOOL drawsBackground; 48 @property BOOL drawsTransparentBackground; 46 49 47 50 @end -
trunk/WebKit2/UIProcess/API/mac/WKView.mm
r73816 r73965 128 128 @end 129 129 130 @interface WKView () 131 - (id)initWithFrame:(NSRect)frame pageNamespace:(WebPageNamespace*)pageNamespace pageGroup:(WebPageGroup*)pageGroup; 132 @end 133 130 134 @implementation WKView 131 135 132 - (id)initWithFrame:(NSRect)frame pageNamespaceRef:(WKPageNamespaceRef)pageNamespaceRef pageGroupRef:(WKPageGroupRef)pageGroupRef 136 - (id)initWithFrame:(NSRect)frame 137 { 138 return [self initWithFrame:frame contextRef:toAPI(WebContext::sharedProcessContext())]; 139 } 140 141 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef 142 { 143 return [self initWithFrame:frame contextRef:contextRef pageGroupRef:nil]; 144 } 145 146 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef 147 { 148 return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef usingSharedProcess:NO]; 149 } 150 151 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef usingSharedProcess:(BOOL)usingSharedProcess 152 { 153 return [self initWithFrame:frame contextRef:contextRef pageGroupRef:nil usingSharedProcess:usingSharedProcess]; 154 } 155 156 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef usingSharedProcess:(BOOL)usingSharedProcess 157 { 158 RefPtr<WebPageNamespace> pageNamespace; 159 if (usingSharedProcess) 160 pageNamespace = toImpl(contextRef)->sharedPageNamespace(); 161 else 162 pageNamespace = toImpl(contextRef)->createPageNamespace(); 163 164 return [self initWithFrame:frame pageNamespace:pageNamespace.get() pageGroup:toImpl(pageGroupRef)]; 165 } 166 167 - (id)initWithFrame:(NSRect)frame forAssociatedPageRef:(WKPageRef)pageRef 168 { 169 return [self initWithFrame:frame forAssociatedPageRef:pageRef pageGroupRef:nil]; 170 } 171 172 - (id)initWithFrame:(NSRect)frame forAssociatedPageRef:(WKPageRef)pageRef pageGroupRef:(WKPageGroupRef)pageGroupRef 173 { 174 return [self initWithFrame:frame pageNamespace:toImpl(pageRef)->pageNamespace() pageGroup:toImpl(pageGroupRef)]; 175 } 176 177 - (id)initWithFrame:(NSRect)frame pageNamespace:(WebPageNamespace*)pageNamespace pageGroup:(WebPageGroup*)pageGroup 133 178 { 134 179 self = [super initWithFrame:frame]; … … 149 194 150 195 _data->_pageClient = PageClientImpl::create(self); 151 _data->_page = toImpl(pageNamespaceRef)->createWebPage(toImpl(pageGroupRef));196 _data->_page = pageNamespace->createWebPage(pageGroup); 152 197 _data->_page->setPageClient(_data->_pageClient.get()); 153 198 _data->_page->setDrawingArea(ChunkedUpdateDrawingAreaProxy::create(self)); … … 167 212 168 213 return self; 169 }170 171 - (id)initWithFrame:(NSRect)frame pageNamespaceRef:(WKPageNamespaceRef)pageNamespaceRef172 {173 return [self initWithFrame:frame pageNamespaceRef:pageNamespaceRef pageGroupRef:nil];174 }175 176 - (id)initWithFrame:(NSRect)frame177 {178 WebContext* context = WebContext::sharedProcessContext();179 return [self initWithFrame:frame pageNamespaceRef:toAPI(context->createPageNamespace())];180 214 } 181 215 -
trunk/WebKit2/UIProcess/API/qt/qwkcontext.cpp
r73716 r73965 51 51 { 52 52 d->context = WebContext::create(String()); 53 d->pageNamespace = d->context-> createPageNamespace();53 d->pageNamespace = d->context->sharedPageNamespace(); 54 54 } 55 55 56 QWKContext::QWKContext(WK PageNamespaceRef pageNamespaceRef, QObject* parent)56 QWKContext::QWKContext(WKContextRef contextRef, QObject* parent) 57 57 : QObject(parent) 58 58 , d(new QWKContextPrivate(this)) 59 59 { 60 d->pageNamespace = toImpl(pageNamespaceRef); 61 d->context = d->pageNamespace->context(); 60 d->context = toImpl(contextRef); 61 d->pageNamespace = d->context->sharedPageNamespace(); 62 } 63 64 QWKContext::QWKContext(WKPageRef pageRef, QObject* parent) 65 : QObject(parent) 66 , d(new QWKContextPrivate(this)) 67 { 68 d->context = toImpl(pageRef)->context(); 69 d->pageNamespace = d->context->sharedPageNamespace(); 62 70 } 63 71 -
trunk/WebKit2/UIProcess/API/qt/qwkcontext.h
r73716 r73965 23 23 #include "qwebkitglobal.h" 24 24 #include <QObject> 25 #include <WebKit2/WKPageNamespace.h> 25 #include <WebKit2/WKContext.h> 26 #include <WebKit2/WKPage.h> 26 27 27 28 class QWKContextPrivate; … … 34 35 35 36 // Bridge from the C API 36 QWKContext(WKPageNamespaceRef pageNamespaceRef, QObject* parent = 0); 37 QWKContext(WKContextRef contextRef, QObject* parent = 0); 38 QWKContext(WKPageRef pageRef, QObject* parent = 0); 37 39 38 40 private: -
trunk/WebKit2/UIProcess/WebContext.cpp
r73816 r73965 80 80 WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePath) 81 81 : m_processModel(processModel) 82 , m_sharedNamespace(0) 82 83 , m_defaultPageGroup(WebPageGroup::create()) 83 84 , m_injectedBundlePath(injectedBundlePath) … … 229 230 } 230 231 231 WebPageNamespace* WebContext::createPageNamespace() 232 WebPageNamespace* WebContext::sharedPageNamespace() 233 { 234 if (!m_sharedNamespace) 235 m_sharedNamespace = createPageNamespace(); 236 return m_sharedNamespace.get(); 237 } 238 239 PassRefPtr<WebPageNamespace> WebContext::createPageNamespace() 232 240 { 233 241 RefPtr<WebPageNamespace> pageNamespace = WebPageNamespace::create(this); 234 242 m_pageNamespaces.add(pageNamespace.get()); 235 return pageNamespace.release() .releaseRef();243 return pageNamespace.release(); 236 244 } 237 245 238 246 void WebContext::pageNamespaceWasDestroyed(WebPageNamespace* pageNamespace) 239 247 { 248 if (pageNamespace == m_sharedNamespace) 249 m_sharedNamespace = 0; 250 240 251 ASSERT(m_pageNamespaces.contains(pageNamespace)); 241 252 m_pageNamespaces.remove(pageNamespace); -
trunk/WebKit2/UIProcess/WebContext.h
r73816 r73965 43 43 #include <wtf/text/WTFString.h> 44 44 45 struct WKContextStatistics;46 47 45 namespace WebKit { 48 46 … … 78 76 void relaunchProcessIfNecessary(); 79 77 80 WebPageNamespace* createPageNamespace(); 78 WebPageNamespace* sharedPageNamespace(); 79 PassRefPtr<WebPageNamespace> createPageNamespace(); 81 80 void pageNamespaceWasDestroyed(WebPageNamespace*); 82 81 … … 165 164 RefPtr<WebProcessProxy> m_process; 166 165 166 RefPtr<WebPageNamespace> m_sharedNamespace; 167 167 HashSet<WebPageNamespace*> m_pageNamespaces; 168 168 -
trunk/WebKit2/UIProcess/WebPageNamespace.h
r73816 r73965 32 32 #include <wtf/RefPtr.h> 33 33 34 struct WKContextStatistics;35 36 34 namespace WebKit { 37 35 -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r73828 r73965 134 134 } 135 135 136 WebContext* WebPageProxy::context() const 137 { 138 return m_pageNamespace->context(); 139 } 140 136 141 bool WebPageProxy::isValid() 137 142 { -
trunk/WebKit2/UIProcess/WebPageProxy.h
r73828 r73965 72 72 } 73 73 74 struct WKContextStatistics;75 76 74 namespace WebKit { 77 75 … … 253 251 WebProcessProxy* process() const; 254 252 WebPageNamespace* pageNamespace() const { return m_pageNamespace.get(); } 253 WebContext* context() const; 255 254 256 255 WebPageGroup* pageGroup() const { return m_pageGroup.get(); } -
trunk/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
r73671 r73965 79 79 ASSERT(!m_inspectorView); 80 80 81 m_inspectorView.adoptNS([[WKView alloc] initWithFrame:NSZeroRect pageNamespaceRef:toAPI(m_page->pageNamespace()) pageGroupRef:toAPI(inspectorPageGroup())]);81 m_inspectorView.adoptNS([[WKView alloc] initWithFrame:NSZeroRect forAssociatedPageRef:toAPI(page()) pageGroupRef:toAPI(inspectorPageGroup())]); 82 82 ASSERT(m_inspectorView); 83 83 84 return toImpl( [m_inspectorView.get() pageRef]);84 return toImpl(m_inspectorView.get().pageRef); 85 85 } 86 86 -
trunk/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp
r73963 r73965 153 153 154 154 RECT emptyRect = {0}; 155 m_inspectorView = WebView::create (emptyRect, m_page->pageNamespace(), inspectorPageGroup(), 0).leakRef();156 155 m_inspectorView = WebView::createForAssociatedPage(emptyRect, m_page, inspectorPageGroup(), 0).leakRef(); 156 157 157 return m_inspectorView->page(); 158 158 } -
trunk/WebKit2/UIProcess/win/WebView.cpp
r73815 r73965 183 183 } 184 184 185 WebView::WebView(RECT rect, Web PageNamespace* pageNamespace, WebPageGroup* pageGroup, HWND parentWindow)185 WebView::WebView(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND parentWindow, bool usingSharedProcess) 186 186 : m_rect(rect) 187 187 , m_topLevelParentWindow(0) … … 193 193 , m_isBeingDestroyed(false) 194 194 { 195 RefPtr<WebPageNamespace> pageNamespace; 196 if (usingSharedProcess) 197 pageNamespace = context->sharedPageNamespace(); 198 else 199 pageNamespace = context->createPageNamespace(); 200 201 initialize(pageNamespace.get(), pageGroup, parentWindow); 202 } 203 204 WebView::WebView(RECT rect, WebPageProxy* page, WebPageGroup* pageGroup, HWND parentWindow) 205 : m_rect(rect) 206 , m_topLevelParentWindow(0) 207 , m_toolTipWindow(0) 208 , m_lastCursorSet(0) 209 , m_webCoreCursor(0) 210 , m_overrideCursor(0) 211 , m_trackingMouseLeave(false) 212 , m_isBeingDestroyed(false) 213 { 214 initialize(page->pageNamespace(), pageGroup, parentWindow); 215 } 216 217 void WebView::initialize(WebPageNamespace* pageNamespace, WebPageGroup* pageGroup, HWND parentWindow) 218 { 195 219 registerWebViewWindowClass(); 196 220 … … 200 224 201 225 m_window = ::CreateWindowEx(0, kWebKit2WebViewWindowClassName, 0, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 202 rect.top, rect.left, rect.right - rect.left, rect.bottom -rect.top, parentWindow ? parentWindow : HWND_MESSAGE, 0, instanceHandle(), this);226 m_rect.top, m_rect.left, m_rect.right - m_rect.left, m_rect.bottom - m_rect.top, parentWindow ? parentWindow : HWND_MESSAGE, 0, instanceHandle(), this); 203 227 ASSERT(::IsWindow(m_window)); 204 228 205 m_page->initializeWebPage(IntRect( rect).size());229 m_page->initializeWebPage(IntRect(m_rect).size()); 206 230 207 231 ::ShowWindow(m_window, SW_SHOW); -
trunk/WebKit2/UIProcess/win/WebView.h
r73625 r73965 42 42 class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener { 43 43 public: 44 static PassRefPtr<WebView> create(RECT rect, Web PageNamespace* pageNamespace, WebPageGroup* pageGroup, HWND parentWindow)44 static PassRefPtr<WebView> create(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND parentWindow) 45 45 { 46 return adoptRef(new WebView(rect, pageNamespace, pageGroup, parentWindow)); 46 return adoptRef(new WebView(rect, context, pageGroup, parentWindow, false)); 47 } 48 static PassRefPtr<WebView> createUsingSharedProcess(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND parentWindow) 49 { 50 return adoptRef(new WebView(rect, context, pageGroup, parentWindow, true)); 51 } 52 static PassRefPtr<WebView> createForAssociatedPage(RECT rect, WebPageProxy* page, WebPageGroup* pageGroup, HWND parentWindow) 53 { 54 return adoptRef(new WebView(rect, page, pageGroup, parentWindow)); 47 55 } 48 56 ~WebView(); … … 59 67 60 68 private: 61 WebView(RECT, WebPageNamespace*, WebPageGroup*, HWND parentWindow); 69 WebView(RECT, WebContext*, WebPageGroup*, HWND parentWindow, bool usingSharedProcess); 70 WebView(RECT, WebPageProxy*, WebPageGroup*, HWND parentWindow); 71 72 void initialize(WebPageNamespace*, WebPageGroup*, HWND parentWindow); 62 73 63 74 virtual Type type() const { return TypeView; } -
trunk/WebKit2/WebKit2.pro
r73892 r73965 289 289 UIProcess/API/C/WKPage.h \ 290 290 UIProcess/API/C/WKPageGroup.h \ 291 UIProcess/API/C/WKPageNamespace.h \292 291 UIProcess/API/C/WKPagePrivate.h \ 293 292 UIProcess/API/C/WKPreferences.h \ … … 489 488 UIProcess/API/C/WKPage.cpp \ 490 489 UIProcess/API/C/WKPageGroup.cpp \ 491 UIProcess/API/C/WKPageNamespace.cpp \492 490 UIProcess/API/C/WKPreferences.cpp \ 493 491 UIProcess/API/C/WKProtectionSpace.cpp \ -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r73808 r73965 542 542 BCEE98C6113314D7006BCC24 /* WebPageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE98C4113314D7006BCC24 /* WebPageNamespace.cpp */; }; 543 543 BCEE98C7113314D7006BCC24 /* WebPageNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE98C5113314D7006BCC24 /* WebPageNamespace.h */; }; 544 BCEE98CC1133174C006BCC24 /* WKPageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE98CA1133174C006BCC24 /* WKPageNamespace.cpp */; };545 BCEE98CD1133174C006BCC24 /* WKPageNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE98CB1133174C006BCC24 /* WKPageNamespace.h */; settings = {ATTRIBUTES = (Public, ); }; };546 544 BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF049E411FE20F600F86A58 /* WKBundleFramePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 547 545 BCF049E711FE20F600F86A58 /* WKBundlePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF049E511FE20F600F86A58 /* WKBundlePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1197 1195 BCEE98C4113314D7006BCC24 /* WebPageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageNamespace.cpp; sourceTree = "<group>"; }; 1198 1196 BCEE98C5113314D7006BCC24 /* WebPageNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageNamespace.h; sourceTree = "<group>"; }; 1199 BCEE98CA1133174C006BCC24 /* WKPageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPageNamespace.cpp; sourceTree = "<group>"; };1200 BCEE98CB1133174C006BCC24 /* WKPageNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageNamespace.h; sourceTree = "<group>"; };1201 1197 BCF049E411FE20F600F86A58 /* WKBundleFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleFramePrivate.h; sourceTree = "<group>"; }; 1202 1198 BCF049E511FE20F600F86A58 /* WKBundlePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePrivate.h; sourceTree = "<group>"; }; … … 1971 1967 BC7B633612A45ABA00D174A4 /* WKPageGroup.cpp */, 1972 1968 BC7B633512A45ABA00D174A4 /* WKPageGroup.h */, 1973 BCEE98CA1133174C006BCC24 /* WKPageNamespace.cpp */,1974 BCEE98CB1133174C006BCC24 /* WKPageNamespace.h */,1975 1969 BC177464118B9FF4007D9E9A /* WKPagePrivate.h */, 1976 1970 BCD597CF112B56AC00EC8C23 /* WKPreferences.cpp */, … … 2511 2505 BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */, 2512 2506 BCD597D7112B56DC00EC8C23 /* WKPage.h in Headers */, 2513 BCEE98CD1133174C006BCC24 /* WKPageNamespace.h in Headers */,2514 2507 BC177465118B9FF4007D9E9A /* WKPagePrivate.h in Headers */, 2515 2508 BCD597D0112B56AC00EC8C23 /* WKPreferences.h in Headers */, … … 2936 2929 BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */, 2937 2930 BCD597D6112B56DC00EC8C23 /* WKPage.cpp in Sources */, 2938 BCEE98CC1133174C006BCC24 /* WKPageNamespace.cpp in Sources */,2939 2931 BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */, 2940 2932 BC8699B6116AADAA002A925B /* WKView.mm in Sources */, -
trunk/WebKit2/win/WebKit2.vcproj
r73958 r73965 2282 2282 </File> 2283 2283 <File 2284 RelativePath="..\UIProcess\API\C\WKPageNamespace.cpp"2285 >2286 </File>2287 <File2288 RelativePath="..\UIProcess\API\C\WKPageNamespace.h"2289 >2290 </File>2291 <File2292 2284 RelativePath="..\UIProcess\API\C\WKPagePrivate.h" 2293 2285 > -
trunk/WebKit2/win/WebKit2Generated.make
r73808 r73965 52 52 xcopy /y /d "..\UIProcess\API\C\WKPage.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 53 53 xcopy /y /d "..\UIProcess\API\C\WKPageGroup.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 54 xcopy /y /d "..\UIProcess\API\C\WKPageNamespace.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"55 54 xcopy /y /d "..\UIProcess\API\C\WKPreferences.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 56 55 xcopy /y /d "..\UIProcess\API\C\WKPreferencesPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" -
trunk/WebKitTools/ChangeLog
r73951 r73965 1 2010-12-13 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Change the WebKit2 public API so there is no explicit WKPageNamespace object 6 https://bugs.webkit.org/show_bug.cgi?id=50898 7 8 * MiniBrowser/mac/AppDelegate.h: 9 * MiniBrowser/mac/AppDelegate.m: 10 * MiniBrowser/mac/BrowserWindowController.h: 11 * MiniBrowser/mac/BrowserWindowController.m: 12 * MiniBrowser/win/BrowserView.cpp: 13 Convert MiniBrowser to not use PageNamespaces. 14 15 * TestWebKitAPI/PlatformWebView.h: 16 * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: 17 * TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp: 18 * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: 19 * TestWebKitAPI/Tests/WebKit2/Find.cpp: 20 * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp: 21 * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp: 22 * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp: 23 * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: 24 * TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp: 25 * TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp: 26 * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp: 27 * TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp: 28 * TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: 29 * TestWebKitAPI/mac/PlatformWebViewMac.mm: 30 * TestWebKitAPI/win/PlatformWebViewWin.cpp: 31 Convert TestWebKitAPI to not use PageNamespaces. 32 33 * WebKitTestRunner/PlatformWebView.h: 34 * WebKitTestRunner/TestController.cpp: 35 * WebKitTestRunner/TestController.h: 36 * WebKitTestRunner/mac/PlatformWebViewMac.mm: 37 * WebKitTestRunner/qt/PlatformWebViewQt.cpp: 38 * WebKitTestRunner/win/PlatformWebViewWin.cpp: 39 Convert WebKitTestRunner to not use PageNamespaces. 40 1 41 2010-12-13 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu> 2 42 -
trunk/WebKitTools/MiniBrowser/mac/AppDelegate.h
r61500 r73965 31 31 32 32 @interface BrowserAppDelegate : NSObject <NSApplicationDelegate> { 33 ProcessModel currentProcessModel;34 WK PageNamespaceRef threadPageNamespace;35 WK PageNamespaceRef processPageNamespace;33 ProcessModel _currentProcessModel; 34 WKContextRef _threadContext; 35 WKContextRef _processContext; 36 36 } 37 37 38 - (WK PageNamespaceRef)getCurrentPageNamespace;38 - (WKContextRef)getCurrentContext; 39 39 40 40 - (IBAction)setSharedProcessProcessModel:(id)sender; -
trunk/WebKitTools/MiniBrowser/mac/AppDelegate.m
r69020 r73965 115 115 if (self) { 116 116 if ([NSEvent modifierFlags] & NSShiftKeyMask) 117 currentProcessModel = kProcessModelSharedSecondaryThread;117 _currentProcessModel = kProcessModelSharedSecondaryThread; 118 118 else 119 currentProcessModel = kProcessModelSharedSecondaryProcess;119 _currentProcessModel = kProcessModelSharedSecondaryProcess; 120 120 121 121 WKContextHistoryClient historyClient = { … … 129 129 }; 130 130 131 WKContextRef threadContext = WKContextGetSharedThreadContext(); 132 WKContextSetHistoryClient(threadContext, &historyClient); 133 WKContextSetCacheModel(threadContext, kWKCacheModelPrimaryWebBrowser); 134 135 threadPageNamespace = WKPageNamespaceCreate(threadContext); 136 WKRelease(threadContext); 131 _threadContext = WKContextGetSharedThreadContext(); 132 WKContextSetHistoryClient(_threadContext, &historyClient); 133 WKContextSetCacheModel(_threadContext, kWKCacheModelPrimaryWebBrowser); 137 134 138 135 CFStringRef bundlePathCF = (CFStringRef)[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"WebBundle.bundle"]; 139 136 WKStringRef bundlePath = WKStringCreateWithCFString(bundlePathCF); 140 137 141 WKContextRefprocessContext = WKContextCreateWithInjectedBundlePath(bundlePath);138 _processContext = WKContextCreateWithInjectedBundlePath(bundlePath); 142 139 143 140 WKContextInjectedBundleClient bundleClient = { … … 147 144 0 148 145 }; 149 WKContextSetInjectedBundleClient(processContext, &bundleClient); 150 WKContextSetHistoryClient(processContext, &historyClient); 151 WKContextSetCacheModel(processContext, kWKCacheModelPrimaryWebBrowser); 152 153 processPageNamespace = WKPageNamespaceCreate(processContext); 154 WKRelease(processContext); 146 WKContextSetInjectedBundleClient(_processContext, &bundleClient); 147 WKContextSetHistoryClient(_processContext, &historyClient); 148 WKContextSetCacheModel(_processContext, kWKCacheModelPrimaryWebBrowser); 155 149 156 150 WKRelease(bundlePath); … … 162 156 - (IBAction)newWindow:(id)sender 163 157 { 164 BrowserWindowController *controller = [[BrowserWindowController alloc] initWith PageNamespace:[self getCurrentPageNamespace]];158 BrowserWindowController *controller = [[BrowserWindowController alloc] initWithContext:[self getCurrentContext]]; 165 159 [[controller window] makeKeyAndOrderFront:sender]; 166 160 … … 168 162 } 169 163 170 - (WK PageNamespaceRef)getCurrentPageNamespace171 { 172 return ( currentProcessModel == kProcessModelSharedSecondaryThread) ? threadPageNamespace : processPageNamespace;164 - (WKContextRef)getCurrentContext 165 { 166 return (_currentProcessModel == kProcessModelSharedSecondaryThread) ? _threadContext : _processContext; 173 167 } 174 168 … … 176 170 { 177 171 if ([menuItem action] == @selector(setSharedProcessProcessModel:)) 178 [menuItem setState: currentProcessModel == kProcessModelSharedSecondaryProcess ? NSOnState : NSOffState];172 [menuItem setState:_currentProcessModel == kProcessModelSharedSecondaryProcess ? NSOnState : NSOffState]; 179 173 else if ([menuItem action] == @selector(setSharedThreadProcessModel:)) 180 [menuItem setState: currentProcessModel == kProcessModelSharedSecondaryThread ? NSOnState : NSOffState];174 [menuItem setState:_currentProcessModel == kProcessModelSharedSecondaryThread ? NSOnState : NSOffState]; 181 175 return YES; 182 176 } … … 184 178 - (void)_setProcessModel:(ProcessModel)processModel 185 179 { 186 if (processModel == currentProcessModel)180 if (processModel == _currentProcessModel) 187 181 return; 188 182 189 currentProcessModel = processModel;183 _currentProcessModel = processModel; 190 184 } 191 185 … … 204 198 static BrowserStatisticsWindowController* windowController; 205 199 if (!windowController) 206 windowController = [[BrowserStatisticsWindowController alloc] initWithThreadedWKContextRef: WKPageNamespaceGetContext(threadPageNamespace)207 processWKContextRef: WKPageNamespaceGetContext(processPageNamespace)];200 windowController = [[BrowserStatisticsWindowController alloc] initWithThreadedWKContextRef:_threadContext 201 processWKContextRef:_processContext]; 208 202 209 203 [[windowController window] makeKeyAndOrderFront:self]; … … 225 219 } 226 220 } 227 228 WKRelease(threadPageNamespace); 229 threadPageNamespace = 0; 230 231 WKRelease(processPageNamespace); 232 processPageNamespace = 0; 221 222 WKRelease(_processContext); 223 _processContext = 0; 233 224 } 234 225 … … 266 257 BrowserWindowController *controller = [self frontmostBrowserWindowController]; 267 258 if (!controller) { 268 controller = [[BrowserWindowController alloc] initWith PageNamespace:[self getCurrentPageNamespace]];259 controller = [[BrowserWindowController alloc] initWithContext:[self getCurrentContext]]; 269 260 [[controller window] makeKeyAndOrderFront:self]; 270 261 } -
trunk/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
r69595 r73965 35 35 IBOutlet NSWindow *findPanelWindow; 36 36 37 WK PageNamespaceRef _pageNamespace;37 WKContextRef _context; 38 38 WKView *_webView; 39 39 BOOL _zoomTextOnly; … … 48 48 - (IBAction)removeReinsertWebView:(id)sender; 49 49 50 - (id)initWith PageNamespace:(WKPageNamespaceRef)pageNamespace;50 - (id)initWithContext:(WKContextRef)context; 51 51 - (void)loadURLString:(NSString *)urlString; 52 52 - (void)applicationTerminating; -
trunk/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
r73533 r73965 44 44 @implementation BrowserWindowController 45 45 46 - (id)initWith PageNamespace:(WKPageNamespaceRef)pageNamespace46 - (id)initWithContext:(WKContextRef)context 47 47 { 48 48 if ((self = [super initWithWindowNibName:@"BrowserWindow"])) { 49 _ pageNamespace = WKRetain(pageNamespace);49 _context = WKRetain(context); 50 50 _zoomTextOnly = NO; 51 51 } … … 56 56 - (void)dealloc 57 57 { 58 assert(!_ pageNamespace);58 assert(!_context); 59 59 [super dealloc]; 60 60 } … … 158 158 - (void)windowWillClose:(NSNotification *)notification 159 159 { 160 WKRelease(_ pageNamespace);161 _ pageNamespace= 0;160 WKRelease(_context); 161 _context = 0; 162 162 } 163 163 … … 381 381 { 382 382 LOG(@"createNewPage"); 383 BrowserWindowController *controller = [[BrowserWindowController alloc] initWith PageNamespace:WKPageGetPageNamespace(page)];383 BrowserWindowController *controller = [[BrowserWindowController alloc] initWithContext:WKPageGetContext(page)]; 384 384 [controller loadWindow]; 385 385 … … 538 538 - (void)awakeFromNib 539 539 { 540 _webView = [[WKView alloc] initWithFrame:[containerView frame] pageNamespaceRef:_pageNamespace];540 _webView = [[WKView alloc] initWithFrame:[containerView frame] contextRef:_context]; 541 541 542 542 [containerView addSubview:_webView]; -
trunk/WebKitTools/MiniBrowser/qt/BrowserWindow.cpp
r72295 r73965 28 28 29 29 #include "BrowserWindow.h" 30 31 #include "WKPageNamespace.h"32 30 33 31 BrowserWindow::BrowserWindow(QGraphicsWKView::BackingStoreType type) -
trunk/WebKitTools/MiniBrowser/win/BrowserView.cpp
r73533 r73965 91 91 context = WKContextGetSharedProcessContext(); 92 92 93 WKPageNamespaceRef pageNamespace = WKPageNamespaceCreate(context); 94 95 m_webView = WKViewCreate(webViewRect, pageNamespace, 0, parentWindow->window()); 93 m_webView = WKViewCreate(webViewRect, context, 0, parentWindow->window()); 96 94 97 95 WKPageUIClient uiClient = { -
trunk/WebKitTools/TestWebKitAPI/PlatformWebView.h
r73066 r73965 52 52 class PlatformWebView { 53 53 public: 54 PlatformWebView(WKPageNamespaceRef, WKPageGroupRef = 0); 54 PlatformWebView(WKContextRef, WKPageGroupRef = 0); 55 PlatformWebView(WKPageRef, WKPageGroupRef = 0); 55 56 ~PlatformWebView(); 56 57 -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
r73066 r73965 49 49 50 50 WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest", pageGroup.get())); 51 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 52 PlatformWebView webView(pageNamespace.get(), pageGroup.get()); 51 PlatformWebView webView(context.get(), pageGroup.get()); 53 52 54 53 WKPageUIClient uiClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp
r70267 r73965 50 50 { 51 51 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 52 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 53 PlatformWebView webView(pageNamespace.get()); 52 PlatformWebView webView(context.get()); 54 53 55 54 WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("throw 'Hello'")); -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp
r71044 r73965 50 50 { 51 51 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 52 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 53 PlatformWebView webView(pageNamespace.get()); 52 PlatformWebView webView(context.get()); 54 53 55 54 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/Find.cpp
r69343 r73965 52 52 { 53 53 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 54 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 55 56 PlatformWebView webView(pageNamespace.get()); 54 PlatformWebView webView(context.get()); 57 55 58 56 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp
r69317 r73965 58 58 { 59 59 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 60 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 61 PlatformWebView webView(pageNamespace.get()); 60 PlatformWebView webView(context.get()); 62 61 63 62 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp
r69317 r73965 58 58 { 59 59 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 60 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 61 PlatformWebView webView(pageNamespace.get()); 60 PlatformWebView webView(context.get()); 62 61 63 62 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp
r70194 r73965 54 54 { 55 55 WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleBasicTest")); 56 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));57 56 58 57 WKContextInjectedBundleClient injectedBundleClient; … … 63 62 WKContextSetInjectedBundleClient(context.get(), &injectedBundleClient); 64 63 65 PlatformWebView webView( pageNamespace.get());64 PlatformWebView webView(context.get()); 66 65 67 66 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
r70795 r73965 114 114 115 115 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 116 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 117 118 PlatformWebView webView(pageNamespace.get()); 116 PlatformWebView webView(context.get()); 119 117 120 118 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
r73880 r73965 61 61 { 62 62 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 63 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 64 65 PlatformWebView webView(pageNamespace.get()); 63 PlatformWebView webView(context.get()); 66 64 67 65 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp
r70658 r73965 49 49 { 50 50 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 51 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 52 PlatformWebView webView(pageNamespace.get()); 51 PlatformWebView webView(context.get()); 53 52 54 53 WKPageSetCustomUserAgent(webView.page(), WKStringCreateWithUTF8CString("")); -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp
r69671 r73965 80 80 { 81 81 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 82 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 83 84 PlatformWebView webView(pageNamespace.get()); 82 PlatformWebView webView(context.get()); 85 83 86 84 WKPageLoaderClient loaderClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp
r69788 r73965 62 62 { 63 63 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 64 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 65 66 PlatformWebView webView(pageNamespace.get()); 64 PlatformWebView webView(context.get()); 67 65 68 66 WKPageUIClient uiClient; -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
r70247 r73965 42 42 { 43 43 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 44 WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); 45 46 PlatformWebView webView(pageNamespace.get()); 44 PlatformWebView webView(context.get()); 47 45 48 46 WKPageUIClient uiClient; -
trunk/WebKitTools/TestWebKitAPI/mac/PlatformWebViewMac.mm
r73066 r73965 30 30 namespace TestWebKitAPI { 31 31 32 PlatformWebView::PlatformWebView(WK PageNamespaceRef pageNamespaceRef, WKPageGroupRef pageGroupRef)32 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) 33 33 { 34 34 NSRect rect = NSMakeRect(0, 0, 800, 600); 35 m_view = [[WKView alloc] initWithFrame:rect pageNamespaceRef:pageNamespaceRef pageGroupRef:pageGroupRef]; 35 m_view = [[WKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef]; 36 37 NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000); 38 m_window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; 39 [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]]; 40 [[m_window contentView] addSubview:m_view]; 41 [m_window orderBack:nil]; 42 [m_window setAutodisplay:NO]; 43 [m_window setReleasedWhenClosed:NO]; 44 } 45 46 PlatformWebView::PlatformWebView(WKPageRef pageRef, WKPageGroupRef pageGroupRef) 47 { 48 NSRect rect = NSMakeRect(0, 0, 800, 600); 49 m_view = [[WKView alloc] initWithFrame:rect forAssociatedPageRef:pageRef pageGroupRef:pageGroupRef]; 36 50 37 51 NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000); -
trunk/WebKitTools/TestWebKitAPI/win/PlatformWebViewWin.cpp
r73066 r73965 57 57 } 58 58 59 PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef, WKPageGroupRef pageGroupRef) 59 60 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) 60 61 : m_parentWindowMessageObserver(0) 61 62 { … … 64 65 RECT viewRect = {0, 0, 800, 600}; 65 66 m_window = CreateWindowExW(0, hostWindowClassName, L"TestWebKitAPI", WS_OVERLAPPEDWINDOW, viewRect.left, viewRect.top, viewRect.right, viewRect.bottom, 0, 0, 0, this); 66 m_view = WKViewCreate(viewRect, namespaceRef, pageGroupRef, m_window); 67 m_view = WKViewCreate(viewRect, contextRef, pageGroupRef, m_window); 68 } 69 70 PlatformWebView::PlatformWebView(WKPageRef pageRef, WKPageGroupRef pageGroupRef) 71 : m_parentWindowMessageObserver(0) 72 { 73 registerWindowClass(); 74 75 RECT viewRect = {0, 0, 800, 600}; 76 m_window = CreateWindowExW(0, hostWindowClassName, L"TestWebKitAPI", WS_OVERLAPPEDWINDOW, viewRect.left, viewRect.top, viewRect.right, viewRect.bottom, 0, 0, 0, this); 77 m_view = WKViewCreateForAssociatedPage(viewRect, pageRef, pageGroupRef, m_window); 67 78 } 68 79 -
trunk/WebKitTools/WebKitTestRunner/PlatformWebView.h
r73215 r73965 53 53 class PlatformWebView { 54 54 public: 55 PlatformWebView(WKPageNamespaceRef, WKPageGroupRef); 55 PlatformWebView(WKContextRef, WKPageGroupRef); 56 PlatformWebView(WKPageRef, WKPageGroupRef); 56 57 ~PlatformWebView(); 57 58 -
trunk/WebKitTools/WebKitTestRunner/TestController.cpp
r73533 r73965 107 107 static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*) 108 108 { 109 PlatformWebView* view = new PlatformWebView( WKPageGetPageNamespace(oldPage), WKPageGetPageGroup(oldPage));109 PlatformWebView* view = new PlatformWebView(oldPage, WKPageGetPageGroup(oldPage)); 110 110 WKPageRef newPage = view->page(); 111 111 … … 212 212 _WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory()); 213 213 214 m_pageNamespace.adopt(WKPageNamespaceCreate(m_context.get())); 215 m_mainWebView = adoptPtr(new PlatformWebView(m_pageNamespace.get(), m_pageGroup.get())); 214 m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get())); 216 215 217 216 WKPageUIClient pageUIClient = { -
trunk/WebKitTools/WebKitTestRunner/TestController.h
r73215 r73965 51 51 52 52 PlatformWebView* mainWebView() { return m_mainWebView.get(); } 53 WKPageNamespaceRef pageNamespace() { return m_pageNamespace.get(); }54 53 WKContextRef context() { return m_context.get(); } 55 54 … … 97 96 OwnPtr<PlatformWebView> m_mainWebView; 98 97 WKRetainPtr<WKContextRef> m_context; 99 WKRetainPtr<WKPageNamespaceRef> m_pageNamespace;100 98 WKRetainPtr<WKPageGroupRef> m_pageGroup; 101 99 102 100 enum State { 103 101 Initial, -
trunk/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r73215 r73965 28 28 namespace WTR { 29 29 30 PlatformWebView::PlatformWebView(WK PageNamespaceRef namespaceRef, WKPageGroupRef pageGroupRef)30 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) 31 31 { 32 32 NSRect rect = NSMakeRect(0, 0, 800, 600); 33 m_view = [[WKView alloc] initWithFrame:rect pageNamespaceRef:namespaceRef pageGroupRef:pageGroupRef]; 33 m_view = [[WKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef]; 34 35 NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000); 36 m_window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; 37 [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]]; 38 [[m_window contentView] addSubview:m_view]; 39 [m_window orderBack:nil]; 40 [m_window setAutodisplay:NO]; 41 [m_window setReleasedWhenClosed:NO]; 42 } 43 44 PlatformWebView::PlatformWebView(WKPageRef pageRef, WKPageGroupRef pageGroupRef) 45 { 46 NSRect rect = NSMakeRect(0, 0, 800, 600); 47 m_view = [[WKView alloc] initWithFrame:rect forAssociatedPageRef:pageRef pageGroupRef:pageGroupRef]; 34 48 35 49 NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000); -
trunk/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
r73716 r73965 34 34 class WebView : public QGraphicsView { 35 35 public: 36 WebView(WKPageNamespaceRef); 36 WebView(WKContextRef); 37 WebView(WKPageRef); 37 38 38 39 QGraphicsWKView* wkView() const { return m_item; } … … 44 45 }; 45 46 46 WebView::WebView(WK PageNamespaceRef namespaceRef)47 WebView::WebView(WKContextRef contextRef) 47 48 : QGraphicsView() 48 , m_item(new QGraphicsWKView(new QWKContext( namespaceRef, this)))49 , m_item(new QGraphicsWKView(new QWKContext(contextRef, this))) 49 50 { 50 51 setScene(new QGraphicsScene(this)); … … 52 53 } 53 54 54 PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef, WKPageGroupRef) 55 : m_view(new WebView(namespaceRef)) 55 WebView::WebView(WKPageRef pageRef) 56 : QGraphicsView() 57 , m_item(new QGraphicsWKView(new QWKContext(pageRef, this))) 58 { 59 setScene(new QGraphicsScene(this)); 60 scene()->addItem(m_item); 61 } 62 63 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef) 64 : m_view(new WebView(contextRef)) 65 , m_window(new QMainWindow()) 66 { 67 m_view->setParent(m_window); 68 m_window->setCentralWidget(m_view); 69 m_window->setGeometry(0, 0, 800, 600); 70 } 71 72 PlatformWebView::PlatformWebView(WKPageRef pageRef, WKPageGroupRef) 73 : m_view(new WebView(pageRef)) 56 74 , m_window(new QMainWindow()) 57 75 { -
trunk/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp
r73215 r73965 48 48 } 49 49 50 PlatformWebView::PlatformWebView(WK PageNamespaceRef namespaceRef, WKPageGroupRef pageGroupRef)50 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) 51 51 { 52 52 registerWindowClass(); … … 54 54 RECT viewRect = {0, 0, 800, 600}; 55 55 m_window = CreateWindowExW(0, hostWindowClassName, L"WebKitTestRunner", WS_OVERLAPPEDWINDOW, 0 /*XOFFSET*/, 0 /*YOFFSET*/, viewRect.right, viewRect.bottom, 0, 0, GetModuleHandle(0), 0); 56 m_view = WKViewCreate(viewRect, namespaceRef, pageGroupRef, m_window); 56 m_view = WKViewCreate(viewRect, contextRef, pageGroupRef, m_window); 57 } 58 59 PlatformWebView::PlatformWebView(WKPageRef pageRef, WKPageGroupRef pageGroupRef) 60 { 61 registerWindowClass(); 62 63 RECT viewRect = {0, 0, 800, 600}; 64 m_window = CreateWindowExW(0, hostWindowClassName, L"WebKitTestRunner", WS_OVERLAPPEDWINDOW, 0 /*XOFFSET*/, 0 /*YOFFSET*/, viewRect.right, viewRect.bottom, 0, 0, GetModuleHandle(0), 0); 65 m_view = WKViewCreateForAssociatedPage(viewRect, pageRef, pageGroupRef, m_window); 57 66 } 58 67
Note: See TracChangeset
for help on using the changeset viewer.