diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/WebContext.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/WebContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp index 0003387d0..fdd363ac6 100644 --- a/Source/WebKit2/UIProcess/WebContext.cpp +++ b/Source/WebKit2/UIProcess/WebContext.cpp @@ -501,20 +501,21 @@ void WebContext::disconnectProcess(WebProcessProxy* process) m_processes.remove(m_processes.find(process)); } -PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient* pageClient, WebPageGroup* pageGroup) +PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient* pageClient, WebPageGroup* pageGroup, WebPageProxy* relatedPage) { RefPtr<WebProcessProxy> process; if (m_processModel == ProcessModelSharedSecondaryProcess) { ensureSharedWebProcess(); process = m_processes[0]; } else { - // FIXME (Multi-WebProcess): Add logic for sharing a process. - // <rdar://problem/12218164> window.open() should create pages in the same process. - // <rdar://problem/12239661> Consider limiting the number of web processes in per-tab process model if (m_haveInitialEmptyProcess) { process = m_processes.last(); m_haveInitialEmptyProcess = false; + } else if (relatedPage) { + // Sharing processes, e.g. when creating the page via window.open(). + process = relatedPage->process(); } else { + // FIXME (Multi-WebProcess): <rdar://problem/12239661> Consider limiting the number of web processes in per-tab process model. process = createNewWebProcess(); m_processes.append(process); } |