Changeset 64070 in webkit


Ignore:
Timestamp:
Jul 26, 2010 1:37:56 PM (14 years ago)
Author:
beidson@apple.com
Message:

2010-07-26 Brady Eidson <beidson@apple.com>

Reviewed by Sam Weinig.

Add ability for WK2 to register a scheme to always be displayed as an empty document
https://bugs.webkit.org/show_bug.cgi?id=42995

No new tests. (Currently not possible to test in WebKit1 DRT, can be testing in future WK2 tester)

  • WebCore.exp.in:


  • loader/MainResourceLoader.cpp: (WebCore::shouldLoadAsEmptyDocument):


  • platform/SchemeRegistry.cpp: (WebCore::emptyDocumentSchemes): (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
  • platform/SchemeRegistry.h:

2010-07-26 Brady Eidson <beidson@apple.com>

Reviewed by Sam Weinig.

Add ability for WK2 to register a scheme to always be displayed as an empty document
https://bugs.webkit.org/show_bug.cgi?id=42995

  • Shared/CoreIPCSupport/WebProcessMessageKinds.h: (WebProcessMessage::):


  • UIProcess/API/C/WKContext.cpp: (_WKContextRegisterURLSchemeAsEmptyDocument):
  • UIProcess/API/C/WKContextPrivate.h:


  • UIProcess/WebContext.cpp: (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
  • UIProcess/WebContext.h:


  • WebProcess/WebProcess.cpp: (WebKit::WebProcess::registerURLSchemeAsEmptyDocument): (WebKit::WebProcess::didReceiveMessage):
  • WebProcess/WebProcess.h:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64062 r64070  
     12010-07-26  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Add ability for WK2 to register a scheme to always be displayed as an empty document
     6        https://bugs.webkit.org/show_bug.cgi?id=42995
     7
     8        No new tests. (Currently not possible to test in WebKit1 DRT, can be testing in future WK2 tester)
     9
     10        * WebCore.exp.in:
     11       
     12        * loader/MainResourceLoader.cpp:
     13        (WebCore::shouldLoadAsEmptyDocument):
     14       
     15        * platform/SchemeRegistry.cpp:
     16        (WebCore::emptyDocumentSchemes):
     17        (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument):
     18        (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
     19        * platform/SchemeRegistry.h:
     20
    1212010-07-26  Patrick Gansterer  <paroga@paroga.com>
    222
  • trunk/WebCore/WebCore.exp.in

    r64049 r64070  
    313313__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKNS_6StringE
    314314__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKNS_6StringE
     315__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKNS_6StringE
    315316__ZN7WebCore14SecurityOrigin16createFromStringERKNS_6StringE
    316317__ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
  • trunk/WebCore/loader/MainResourceLoader.cpp

    r64051 r64070  
    4545#include "ResourceError.h"
    4646#include "ResourceHandle.h"
     47#include "SchemeRegistry.h"
    4748#include "Settings.h"
    4849#include <wtf/CurrentTime.h>
     
    207208    return url.isEmpty() || (url.protocolIs("about") && equalIgnoringRef(url, blankURL()));
    208209#else
    209     return url.isEmpty() || url.protocolIs("about");
     210    return url.isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(url.protocol());
    210211#endif
    211212}
  • trunk/WebCore/platform/SchemeRegistry.cpp

    r63863 r64070  
    6969
    7070    return schemesWithUniqueOrigins;
     71}
     72
     73static URLSchemesMap& emptyDocumentSchemes()
     74{
     75    DEFINE_STATIC_LOCAL(URLSchemesMap, emptyDocumentSchemes, ());
     76
     77    if (emptyDocumentSchemes.isEmpty())
     78        emptyDocumentSchemes.add("about");
     79
     80    return emptyDocumentSchemes;
    7181}
    7282
     
    150160}
    151161
     162void SchemeRegistry::registerURLSchemeAsEmptyDocument(const String& scheme)
     163{
     164    emptyDocumentSchemes().add(scheme);
     165}
     166
     167bool SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(const String& scheme)
     168{
     169    return emptyDocumentSchemes().contains(scheme);
     170}
     171
    152172} // namespace WebCore
  • trunk/WebCore/platform/SchemeRegistry.h

    r63863 r64070  
    5252    static void registerURLSchemeAsNoAccess(const String&);
    5353    static bool shouldTreatURLSchemeAsNoAccess(const String&);
     54   
     55    static void registerURLSchemeAsEmptyDocument(const String&);
     56    static bool shouldLoadURLSchemeAsEmptyDocument(const String&);
    5457};
    5558
  • trunk/WebKit2/ChangeLog

    r64068 r64070  
     12010-07-26  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Add ability for WK2 to register a scheme to always be displayed as an empty document
     6        https://bugs.webkit.org/show_bug.cgi?id=42995
     7
     8        * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
     9        (WebProcessMessage::):
     10       
     11        * UIProcess/API/C/WKContext.cpp:
     12        (_WKContextRegisterURLSchemeAsEmptyDocument):
     13        * UIProcess/API/C/WKContextPrivate.h:
     14       
     15        * UIProcess/WebContext.cpp:
     16        (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
     17        * UIProcess/WebContext.h:
     18       
     19        * WebProcess/WebProcess.cpp:
     20        (WebKit::WebProcess::registerURLSchemeAsEmptyDocument):
     21        (WebKit::WebProcess::didReceiveMessage):
     22        * WebProcess/WebProcess.h:
     23
    1242010-07-26  Anders Carlsson  <andersca@apple.com>
    225
  • trunk/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h

    r63664 r64070  
    3838    Create,
    3939    PostMessage,
     40    RegisterURLSchemeAsEmptyDocument,
    4041#if PLATFORM(MAC)
    4142    SetupAcceleratedCompositingPort
  • trunk/WebKit2/UIProcess/API/C/WKContext.cpp

    r63621 r64070  
    9999    toWK(contextRef)->setAdditionalPluginPath(toWK(pluginPath));
    100100}
     101
     102void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme)
     103{
     104    toWK(contextRef)->registerURLSchemeAsEmptyDocument(toWK(urlScheme));
     105}
  • trunk/WebKit2/UIProcess/API/C/WKContextPrivate.h

    r63621 r64070  
    4747WK_EXPORT void _WKContextSetAdditionalPluginPath(WKContextRef context, WKStringRef pluginPath);
    4848
     49WK_EXPORT void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef context, WKStringRef urlScheme);
     50
    4951#ifdef __cplusplus
    5052}
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r64029 r64070  
    181181}
    182182
     183void WebContext::registerURLSchemeAsEmptyDocument(WebCore::StringImpl* urlScheme)
     184{
     185    ensureWebProcess();
     186
     187    m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(String(urlScheme)));
     188}
     189
    183190} // namespace WebKit
  • trunk/WebKit2/UIProcess/WebContext.h

    r64029 r64070  
    8686    PluginInfoStore* pluginInfoStore() { return &m_pluginInfoStore; }
    8787    WebCore::String applicationCacheDirectory();
     88   
     89    void registerURLSchemeAsEmptyDocument(WebCore::StringImpl*);
    8890
    8991private:
  • trunk/WebKit2/WebProcess/WebProcess.cpp

    r64029 r64070  
    3838#include "WebProcessMessageKinds.h"
    3939#include <WebCore/ApplicationCacheStorage.h>
     40#include <WebCore/SchemeRegistry.h>
    4041#include <wtf/PassRefPtr.h>
    4142
     
    108109
    109110    m_injectedBundle->didReceiveMessage(message);
     111}
     112
     113void WebProcess::registerURLSchemeAsEmptyDocument(const WebCore::String& urlScheme)
     114{
     115    SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
    110116}
    111117
     
    211217                return;
    212218            }
     219            case WebProcessMessage::RegisterURLSchemeAsEmptyDocument: {
     220                String message;
     221                if (!arguments->decode(CoreIPC::Out(message)))
     222                    return;
     223
     224                registerURLSchemeAsEmptyDocument(message);
     225                return;
     226            }
    213227#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
    214228            case WebProcessMessage::SetupAcceleratedCompositingPort: {
  • trunk/WebKit2/WebProcess/WebProcess.h

    r63825 r64070  
    7474    void setApplicationCacheDirectory(const WebCore::String&);
    7575    void forwardMessageToInjectedBundle(const WebCore::String&);
     76    void registerURLSchemeAsEmptyDocument(const WebCore::String&);
    7677
    7778    // CoreIPC::Connection::Client
Note: See TracChangeset for help on using the changeset viewer.