Changeset 130214 in webkit


Ignore:
Timestamp:
Oct 2, 2012, 2:49:33 PM (13 years ago)
Author:
ap@apple.com
Message:

<rdar://problem/12407139> WebKit2 should provide API that returns all pages in the same process as a given page
https://bugs.webkit.org/show_bug.cgi?id=98193

Reviewed by Sam Weinig.

  • UIProcess/API/C/WKPage.cpp: (WKPageCopyRelatedPages):
  • UIProcess/API/C/WKPagePrivate.h:
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::relatedPages):
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::pages):
  • UIProcess/WebProcessProxy.h: Added. This should work once a process has crashed, too.
Location:
trunk/Source/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r130208 r130214  
     12012-10-02  Alexey Proskuryakov  <ap@apple.com>
     2
     3        <rdar://problem/12407139> WebKit2 should provide API that returns all pages in the same process as a given page
     4        https://bugs.webkit.org/show_bug.cgi?id=98193
     5
     6        Reviewed by Sam Weinig.
     7
     8        * UIProcess/API/C/WKPage.cpp:
     9        (WKPageCopyRelatedPages):
     10        * UIProcess/API/C/WKPagePrivate.h:
     11        * UIProcess/WebPageProxy.cpp:
     12        (WebKit::WebPageProxy::relatedPages):
     13        * UIProcess/WebPageProxy.h:
     14        * UIProcess/WebProcessProxy.cpp:
     15        (WebKit::WebProcessProxy::pages):
     16        * UIProcess/WebProcessProxy.h:
     17        Added. This should work once a process has crashed, too.
     18
    1192012-10-02  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r129545 r130214  
    739739}
    740740
     741WKArrayRef WKPageCopyRelatedPages(WKPageRef pageRef)
     742{
     743    return toAPI(toImpl(pageRef)->relatedPages().leakRef());
     744}
  • trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h

    r122393 r130214  
    9595WK_EXPORT void WKPageSetMediaVolume(WKPageRef page, float volume);
    9696
     97WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page);
     98
    9799#ifdef __cplusplus
    98100}
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r130033 r130214  
    278278}
    279279
     280PassRefPtr<ImmutableArray> WebPageProxy::relatedPages() const
     281{
     282    Vector<WebPageProxy*> pages = m_process->pages();
     283    ASSERT(pages.contains(this));
     284
     285    Vector<RefPtr<APIObject> > result;
     286    result.reserveCapacity(pages.size() - 1);
     287    for (size_t i = 0; i < pages.size(); ++i) {
     288        if (pages[i] != this)
     289            result.append(pages[i]);
     290    }
     291
     292    return ImmutableArray::adopt(result);
     293}
     294
    280295void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
    281296{
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r130031 r130214  
    623623
    624624    bool isValid();
     625
     626    PassRefPtr<ImmutableArray> relatedPages() const;
    625627
    626628    const String& urlAtProcessExit() const { return m_urlAtProcessExit; }
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r129451 r130214  
    187187}
    188188
     189Vector<WebPageProxy*> WebProcessProxy::pages() const
     190{
     191    Vector<WebPageProxy*> result;
     192    copyValuesToVector(m_pageMap, result);
     193    return result;
     194}
     195
    189196#if ENABLE(WEB_INTENTS)
    190197void WebProcessProxy::removeMessagePortChannel(uint64_t channelID)
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.h

    r129451 r130214  
    8585    void addExistingWebPage(WebPageProxy*, uint64_t pageID);
    8686    void removeWebPage(uint64_t pageID);
     87    Vector<WebPageProxy*> pages() const;
    8788
    8889#if ENABLE(WEB_INTENTS)
Note: See TracChangeset for help on using the changeset viewer.