Changeset 128989 in webkit


Ignore:
Timestamp:
Sep 19, 2012 4:32:29 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Add API to get/set the security policy of a given URI scheme to WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=96497

Reviewed by Martin Robinson.

Source/WebCore:

  • WebCore.exp.in: Add new exported symbols.

Source/WebKit2:

Add WebKitSecurityManager object associated to a WebKitWebContext
to get/set the security policy of a URI scheme.

  • GNUmakefile.list.am: Add new files to compilation.
  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::encode): Encode the list of
schemes to be reigstered as Local, NoAccess, DisplayIsolated and
CORSEnabled.
(WebKit::WebProcessCreationParameters::decode): Decode the list of
schemes to be reigstered as Local, NoAccess, DisplayIsolated and
CORSEnabled.

  • Shared/WebProcessCreationParameters.h:

(WebProcessCreationParameters): Add new parameters to be able to
register schemes as Local, NoAccess, DisplayIsolated and
CORSEnabled.

  • UIProcess/API/gtk/WebKitSecurityManager.cpp: Added.

(webkit_security_manager_init):
(webkitSecurityManagerFinalize):
(webkit_security_manager_class_init):
(webkitSecurityManagerCreate): Private function to create the
WebKitSecurityManager object associated to the given
WebKitWebContext.
(registerSecurityPolicyForURIScheme):
(checkSecurityPolicyForURIScheme):
(webkit_security_manager_register_uri_scheme_as_local):
(webkit_security_manager_uri_scheme_is_local):
(webkit_security_manager_register_uri_scheme_as_no_access):
(webkit_security_manager_uri_scheme_is_no_access):
(webkit_security_manager_register_uri_scheme_as_display_isolated):
(webkit_security_manager_uri_scheme_is_display_isolated):
(webkit_security_manager_register_uri_scheme_as_secure):
(webkit_security_manager_uri_scheme_is_secure):
(webkit_security_manager_register_uri_scheme_as_cors_enabled):
(webkit_security_manager_uri_scheme_is_cors_enabled):
(webkit_security_manager_register_uri_scheme_as_empty_document):
(webkit_security_manager_uri_scheme_is_empty_document):

  • UIProcess/API/gtk/WebKitSecurityManager.h: Added.
  • UIProcess/API/gtk/WebKitSecurityManagerPrivate.h: Added.
  • UIProcess/API/gtk/WebKitWebContext.cpp:

(webkit_web_context_get_security_manager): Return the
WebKitSecurityManager object, creating it before if it doesn't exist.

  • UIProcess/API/gtk/WebKitWebContext.h:
  • UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for

WebKitSecurityManager.

  • UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
  • UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:

(testWebContextSecurityPolicy):
(beforeAll):

  • UIProcess/API/gtk/webkit2.h: Add WebKitSecurityManager.h.
  • UIProcess/WebContext.cpp:

(WebKit::WebContext::createNewWebProcess): Copy new vector
schemes.
(WebKit::WebContext::registerURLSchemeAsLocal): Send a message to
WebProcess to register the given URL scheme as Local.
(WebKit::WebContext::registerURLSchemeAsNoAccess): Send a message
to WebProcess to register the given URL scheme as NoAccess.
(WebKit::WebContext::registerURLSchemeAsDisplayIsolated): Send a
message to WebProcess to register the given URL scheme as
DisplayIsolated.
(WebKit::WebContext::registerURLSchemeAsCORSEnabled): Send a
message to WebProcess to register the given URL scheme as
CORSEnabled.

  • UIProcess/WebContext.h:

(WebContext):

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::registerURLSchemeAsLocal): Register the
given URL scheme as Local in the SchemeRegistry.
(WebKit::WebProcess::registerURLSchemeAsNoAccess): Register the
given URL scheme as NoAccess in the SchemeRegistry.
(WebKit::WebProcess::registerURLSchemeAsDisplayIsolated): Register
the given URL scheme as DisplayIsolated in the SchemeRegistry.
(WebKit::WebProcess::registerURLSchemeAsCORSEnabled): Register the
given URL scheme as CORSEnabled in the SchemeRegistry.

  • WebProcess/WebProcess.h:
  • WebProcess/WebProcess.messages.in: Add new messages.
Location:
trunk/Source
Files:
3 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128988 r128989  
     12012-09-19  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add API to get/set the security policy of a given URI scheme to WebKit2 GTK+
     4        https://bugs.webkit.org/show_bug.cgi?id=96497
     5
     6        Reviewed by Martin Robinson.
     7
     8        * WebCore.exp.in: Add new exported symbols.
     9
    1102012-09-19  Patrick Gansterer  <paroga@webkit.org>
    211
  • trunk/Source/WebCore/WebCore.exp.in

    r128963 r128989  
    272272__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKN3WTF6StringE
    273273__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKN3WTF6StringE
     274__ZN7WebCore14SchemeRegistry27registerURLSchemeAsNoAccessERKN3WTF6StringE
     275__ZN7WebCore14SchemeRegistry30registerURLSchemeAsCORSEnabledERKN3WTF6StringE
    274276__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKN3WTF6StringE
     277__ZN7WebCore14SchemeRegistry34registerURLSchemeAsDisplayIsolatedERKN3WTF6StringE
    275278__ZN7WebCore14SchemeRegistry34shouldLoadURLSchemeAsEmptyDocumentERKN3WTF6StringE
    276279__ZN7WebCore14SchemeRegistry40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE
  • trunk/Source/WebKit2/ChangeLog

    r128980 r128989  
     12012-09-19  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add API to get/set the security policy of a given URI scheme to WebKit2 GTK+
     4        https://bugs.webkit.org/show_bug.cgi?id=96497
     5
     6        Reviewed by Martin Robinson.
     7
     8        Add WebKitSecurityManager object associated to a WebKitWebContext
     9        to get/set the security policy of a URI scheme.
     10
     11        * GNUmakefile.list.am: Add new files to compilation.
     12        * Shared/WebProcessCreationParameters.cpp:
     13        (WebKit::WebProcessCreationParameters::encode): Encode the list of
     14        schemes to be reigstered as Local, NoAccess, DisplayIsolated and
     15        CORSEnabled.
     16        (WebKit::WebProcessCreationParameters::decode): Decode the list of
     17        schemes to be reigstered as Local, NoAccess, DisplayIsolated and
     18        CORSEnabled.
     19        * Shared/WebProcessCreationParameters.h:
     20        (WebProcessCreationParameters): Add new parameters to be able to
     21        register schemes as Local, NoAccess, DisplayIsolated and
     22        CORSEnabled.
     23        * UIProcess/API/gtk/WebKitSecurityManager.cpp: Added.
     24        (webkit_security_manager_init):
     25        (webkitSecurityManagerFinalize):
     26        (webkit_security_manager_class_init):
     27        (webkitSecurityManagerCreate): Private function to create the
     28        WebKitSecurityManager object associated to the given
     29        WebKitWebContext.
     30        (registerSecurityPolicyForURIScheme):
     31        (checkSecurityPolicyForURIScheme):
     32        (webkit_security_manager_register_uri_scheme_as_local):
     33        (webkit_security_manager_uri_scheme_is_local):
     34        (webkit_security_manager_register_uri_scheme_as_no_access):
     35        (webkit_security_manager_uri_scheme_is_no_access):
     36        (webkit_security_manager_register_uri_scheme_as_display_isolated):
     37        (webkit_security_manager_uri_scheme_is_display_isolated):
     38        (webkit_security_manager_register_uri_scheme_as_secure):
     39        (webkit_security_manager_uri_scheme_is_secure):
     40        (webkit_security_manager_register_uri_scheme_as_cors_enabled):
     41        (webkit_security_manager_uri_scheme_is_cors_enabled):
     42        (webkit_security_manager_register_uri_scheme_as_empty_document):
     43        (webkit_security_manager_uri_scheme_is_empty_document):
     44        * UIProcess/API/gtk/WebKitSecurityManager.h: Added.
     45        * UIProcess/API/gtk/WebKitSecurityManagerPrivate.h: Added.
     46        * UIProcess/API/gtk/WebKitWebContext.cpp:
     47        (webkit_web_context_get_security_manager): Return the
     48        WebKitSecurityManager object, creating it before if it doesn't exist.
     49        * UIProcess/API/gtk/WebKitWebContext.h:
     50        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for
     51        WebKitSecurityManager.
     52        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
     53        * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
     54        (testWebContextSecurityPolicy):
     55        (beforeAll):
     56        * UIProcess/API/gtk/webkit2.h: Add WebKitSecurityManager.h.
     57        * UIProcess/WebContext.cpp:
     58        (WebKit::WebContext::createNewWebProcess): Copy new vector
     59        schemes.
     60        (WebKit::WebContext::registerURLSchemeAsLocal): Send a message to
     61        WebProcess to register the given URL scheme as Local.
     62        (WebKit::WebContext::registerURLSchemeAsNoAccess): Send a message
     63        to WebProcess to register the given URL scheme as NoAccess.
     64        (WebKit::WebContext::registerURLSchemeAsDisplayIsolated): Send a
     65        message to WebProcess to register the given URL scheme as
     66        DisplayIsolated.
     67        (WebKit::WebContext::registerURLSchemeAsCORSEnabled): Send a
     68        message to WebProcess to register the given URL scheme as
     69        CORSEnabled.
     70        * UIProcess/WebContext.h:
     71        (WebContext):
     72        * WebProcess/WebProcess.cpp:
     73        (WebKit::WebProcess::registerURLSchemeAsLocal): Register the
     74        given URL scheme as Local in the SchemeRegistry.
     75        (WebKit::WebProcess::registerURLSchemeAsNoAccess): Register the
     76        given URL scheme as NoAccess in the SchemeRegistry.
     77        (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated): Register
     78        the given URL scheme as DisplayIsolated in the SchemeRegistry.
     79        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled): Register the
     80        given URL scheme as CORSEnabled in the SchemeRegistry.
     81        * WebProcess/WebProcess.h:
     82        * WebProcess/WebProcess.messages.in: Add new messages.
     83
    1842012-09-19  Balazs Kelemen  <kbalazs@webkit.org>
    285
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r128553 r128989  
    119119        $(WebKit2)/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
    120120        $(WebKit2)/UIProcess/API/gtk/WebKitScriptDialog.h \
     121        $(WebKit2)/UIProcess/API/gtk/WebKitSecurityManager.h \
    121122        $(WebKit2)/UIProcess/API/gtk/WebKitSettings.h \
    122123        $(WebKit2)/UIProcess/API/gtk/WebKitURIRequest.h \
     
    698699        Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.h \
    699700        Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h \
     701        Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp \
     702        Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.h \
     703        Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h \
    700704        Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp \
    701705        Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h \
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp

    r127384 r128989  
    6161    encoder->encode(urlSchemesRegisteredAsSecure);
    6262    encoder->encode(urlSchemesForWhichDomainRelaxationIsForbidden);
     63    encoder->encode(urlSchemesRegisteredAsLocal);
     64    encoder->encode(urlSchemesRegisteredAsNoAccess);
     65    encoder->encode(urlSchemesRegisteredAsDisplayIsolated);
     66    encoder->encode(urlSchemesRegisteredAsCORSEnabled);
    6367    encoder->encode(mimeTypesWithCustomRepresentation);
    6468    encoder->encodeEnum(cacheModel);
     
    135139    if (!decoder->decode(parameters.urlSchemesForWhichDomainRelaxationIsForbidden))
    136140        return false;
     141    if (!decoder->decode(parameters.urlSchemesRegisteredAsLocal))
     142        return false;
     143    if (!decoder->decode(parameters.urlSchemesRegisteredAsNoAccess))
     144        return false;
     145    if (!decoder->decode(parameters.urlSchemesRegisteredAsDisplayIsolated))
     146        return false;
     147    if (!decoder->decode(parameters.urlSchemesRegisteredAsCORSEnabled))
     148        return false;
    137149    if (!decoder->decode(parameters.mimeTypesWithCustomRepresentation))
    138150        return false;
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h

    r127384 r128989  
    6565    Vector<String> urlSchemesRegisteredAsSecure;
    6666    Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
     67    Vector<String> urlSchemesRegisteredAsLocal;
     68    Vector<String> urlSchemesRegisteredAsNoAccess;
     69    Vector<String> urlSchemesRegisteredAsDisplayIsolated;
     70    Vector<String> urlSchemesRegisteredAsCORSEnabled;
    6771
    6872    // MIME types for which the UI process will handle showing the data.
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp

    r126298 r128989  
    2929#include "WebKitPrivate.h"
    3030#include "WebKitRequestManagerClient.h"
     31#include "WebKitSecurityManagerPrivate.h"
    3132#include "WebKitTextChecker.h"
    3233#include "WebKitURISchemeRequestPrivate.h"
     
    9697
    9798    GRefPtr<WebKitCookieManager> cookieManager;
     99    GRefPtr<WebKitSecurityManager> securityManager;
    98100    WKRetainPtr<WKSoupRequestManagerRef> requestManager;
    99101    URISchemeHandlerMap uriSchemeHandlers;
     
    323325
    324326/**
     327 * webkit_web_context_get_security_manager:
     328 * @context: a #WebKitWebContext
     329 *
     330 * Get the #WebKitSecurityManager of @context.
     331 *
     332 * Returns: (transfer none): the #WebKitSecurityManager of @context.
     333 */
     334WebKitSecurityManager* webkit_web_context_get_security_manager(WebKitWebContext* context)
     335{
     336    g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), 0);
     337
     338    WebKitWebContextPrivate* priv = context->priv;
     339    if (!priv->securityManager)
     340        priv->securityManager = adoptGRef(webkitSecurityManagerCreate(context));
     341
     342    return priv->securityManager.get();
     343}
     344
     345/**
    325346 * webkit_web_context_set_additional_plugins_directory:
    326347 * @context: a #WebKitWebContext
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h

    r126298 r128989  
    2929#include <webkit2/WebKitDefines.h>
    3030#include <webkit2/WebKitDownload.h>
     31#include <webkit2/WebKitSecurityManager.h>
    3132#include <webkit2/WebKitURISchemeRequest.h>
    3233
     
    114115webkit_web_context_get_cookie_manager               (WebKitWebContext              *context);
    115116
     117WEBKIT_API WebKitSecurityManager *
     118webkit_web_context_get_security_manager             (WebKitWebContext              *context);
     119
    116120WEBKIT_API void
    117121webkit_web_context_set_additional_plugins_directory (WebKitWebContext              *context,
  • trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml

    r122961 r128989  
    4141    <xi:include href="xml/WebKitContextMenuItem.xml"/>
    4242    <xi:include href="xml/WebKitFormSubmissionRequest.xml"/>
     43    <xi:include href="xml/WebKitSecurityManager.xml"/>
    4344  </chapter>
    4445
  • trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt

    r128960 r128989  
    3131webkit_web_context_download_uri
    3232webkit_web_context_get_cookie_manager
     33webkit_web_context_get_security_manager
    3334webkit_web_context_set_additional_plugins_directory
    3435webkit_web_context_get_plugins
     
    849850webkit_form_submission_request_get_type
    850851</SECTION>
     852
     853<SECTION>
     854<FILE>WebKitSecurityManager</FILE>
     855WebKitSecurityManager
     856webkit_security_manager_register_uri_scheme_as_local
     857webkit_security_manager_uri_scheme_is_local
     858webkit_security_manager_register_uri_scheme_as_no_access
     859webkit_security_manager_uri_scheme_is_no_access
     860webkit_security_manager_register_uri_scheme_as_display_isolated
     861webkit_security_manager_uri_scheme_is_display_isolated
     862webkit_security_manager_register_uri_scheme_as_secure
     863webkit_security_manager_uri_scheme_is_secure
     864webkit_security_manager_register_uri_scheme_as_cors_enabled
     865webkit_security_manager_uri_scheme_is_cors_enabled
     866webkit_security_manager_register_uri_scheme_as_empty_document
     867webkit_security_manager_uri_scheme_is_empty_document
     868
     869<SUBSECTION Standard>
     870WebKitSecurityManagerClass
     871WEBKIT_TYPE_SECURITY_MANAGER
     872WEBKIT_SECURITY_MANAGER
     873WEBKIT_IS_SECURITY_MANAGER
     874WEBKIT_SECURITY_MANAGER_CLASS
     875WEBKIT_IS_SECURITY_MANAGER_CLASS
     876WEBKIT_SECURITY_MANAGER_GET_CLASS
     877
     878<SUBSECTION Private>
     879WebKitSecurityManagerPrivate
     880webkit_security_manager_get_type
     881</SECTION>
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp

    r126298 r128989  
    298298}
    299299
     300class SecurityPolicyTest: public Test {
     301public:
     302    MAKE_GLIB_TEST_FIXTURE(SecurityPolicyTest);
     303
     304    enum SecurityPolicy {
     305        Local = 1 << 1,
     306        NoAccess = 1 << 2,
     307        DisplayIsolated = 1 << 3,
     308        Secure = 1 << 4,
     309        CORSEnabled = 1 << 5,
     310        EmptyDocument = 1 << 6
     311    };
     312
     313    SecurityPolicyTest()
     314        : m_manager(webkit_web_context_get_security_manager(webkit_web_context_get_default()))
     315    {
     316    }
     317
     318    void verifyThatSchemeMatchesPolicy(const char* scheme, unsigned policy)
     319    {
     320        if (policy & Local)
     321            g_assert(webkit_security_manager_uri_scheme_is_local(m_manager, scheme));
     322        else
     323            g_assert(!webkit_security_manager_uri_scheme_is_local(m_manager, scheme));
     324        if (policy & NoAccess)
     325            g_assert(webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme));
     326        else
     327            g_assert(!webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme));
     328        if (policy & DisplayIsolated)
     329            g_assert(webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme));
     330        else
     331            g_assert(!webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme));
     332        if (policy & Secure)
     333            g_assert(webkit_security_manager_uri_scheme_is_secure(m_manager, scheme));
     334        else
     335            g_assert(!webkit_security_manager_uri_scheme_is_secure(m_manager, scheme));
     336        if (policy & CORSEnabled)
     337            g_assert(webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme));
     338        else
     339            g_assert(!webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme));
     340        if (policy & EmptyDocument)
     341            g_assert(webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme));
     342        else
     343            g_assert(!webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme));
     344    }
     345
     346    WebKitSecurityManager* m_manager;
     347};
     348
     349static void testWebContextSecurityPolicy(SecurityPolicyTest* test, gconstpointer)
     350{
     351    // VerifyThatSchemeMatchesPolicy default policy for well known schemes.
     352    test->verifyThatSchemeMatchesPolicy("http", SecurityPolicyTest::CORSEnabled);
     353    test->verifyThatSchemeMatchesPolicy("https", SecurityPolicyTest::CORSEnabled | SecurityPolicyTest::Secure);
     354    test->verifyThatSchemeMatchesPolicy("file", SecurityPolicyTest::Local);
     355    test->verifyThatSchemeMatchesPolicy("data", SecurityPolicyTest::NoAccess | SecurityPolicyTest::Secure);
     356    test->verifyThatSchemeMatchesPolicy("about", SecurityPolicyTest::NoAccess | SecurityPolicyTest::Secure | SecurityPolicyTest::EmptyDocument);
     357
     358    // Custom scheme.
     359    test->verifyThatSchemeMatchesPolicy("foo", 0);
     360
     361    webkit_security_manager_register_uri_scheme_as_local(test->m_manager, "foo");
     362    test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local);
     363    webkit_security_manager_register_uri_scheme_as_no_access(test->m_manager, "foo");
     364    test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess);
     365    webkit_security_manager_register_uri_scheme_as_display_isolated(test->m_manager, "foo");
     366    test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated);
     367    webkit_security_manager_register_uri_scheme_as_secure(test->m_manager, "foo");
     368    test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated | SecurityPolicyTest::Secure);
     369    webkit_security_manager_register_uri_scheme_as_cors_enabled(test->m_manager, "foo");
     370    test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated | SecurityPolicyTest::Secure
     371                | SecurityPolicyTest::CORSEnabled);
     372    webkit_security_manager_register_uri_scheme_as_empty_document(test->m_manager, "foo");
     373    test->verifyThatSchemeMatchesPolicy("foo", SecurityPolicyTest::Local | SecurityPolicyTest::NoAccess | SecurityPolicyTest::DisplayIsolated | SecurityPolicyTest::Secure
     374                | SecurityPolicyTest::CORSEnabled | SecurityPolicyTest::EmptyDocument);
     375}
     376
    300377void beforeAll()
    301378{
     
    308385    Test::add("WebKitWebContext", "spell-checker", testWebContextSpellChecker);
    309386    WebViewTest::add("WebKitWebContext", "languages", testWebContextLanguages);
     387    SecurityPolicyTest::add("WebKitSecurityManager", "security-policy", testWebContextSecurityPolicy);
    310388}
    311389
  • trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h

    r122961 r128989  
    4848#include <webkit2/WebKitResponsePolicyDecision.h>
    4949#include <webkit2/WebKitScriptDialog.h>
     50#include <webkit2/WebKitSecurityManager.h>
    5051#include <webkit2/WebKitSettings.h>
    5152#include <webkit2/WebKitURIRequest.h>
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r128352 r128989  
    337337    copyToVector(m_schemesToRegisterAsSecure, parameters.urlSchemesRegisteredAsSecure);
    338338    copyToVector(m_schemesToSetDomainRelaxationForbiddenFor, parameters.urlSchemesForWhichDomainRelaxationIsForbidden);
     339    copyToVector(m_schemesToRegisterAsLocal, parameters.urlSchemesRegisteredAsLocal);
     340    copyToVector(m_schemesToRegisterAsNoAccess, parameters.urlSchemesRegisteredAsNoAccess);
     341    copyToVector(m_schemesToRegisterAsDisplayIsolated, parameters.urlSchemesRegisteredAsDisplayIsolated);
     342    copyToVector(m_schemesToRegisterAsCORSEnabled, parameters.urlSchemesRegisteredAsCORSEnabled);
    339343
    340344    parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
     
    641645}
    642646
     647void WebContext::registerURLSchemeAsLocal(const String& urlScheme)
     648{
     649    m_schemesToRegisterAsLocal.add(urlScheme);
     650    sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsLocal(urlScheme));
     651}
     652
     653void WebContext::registerURLSchemeAsNoAccess(const String& urlScheme)
     654{
     655    m_schemesToRegisterAsNoAccess.add(urlScheme);
     656    sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsNoAccess(urlScheme));
     657}
     658
     659void WebContext::registerURLSchemeAsDisplayIsolated(const String& urlScheme)
     660{
     661    m_schemesToRegisterAsDisplayIsolated.add(urlScheme);
     662    sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsDisplayIsolated(urlScheme));
     663}
     664
     665void WebContext::registerURLSchemeAsCORSEnabled(const String& urlScheme)
     666{
     667    m_schemesToRegisterAsCORSEnabled.add(urlScheme);
     668    sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCORSEnabled(urlScheme));
     669}
     670
    643671void WebContext::setCacheModel(CacheModel cacheModel)
    644672{
  • trunk/Source/WebKit2/UIProcess/WebContext.h

    r128103 r128989  
    133133    void registerURLSchemeAsSecure(const String&);
    134134    void setDomainRelaxationForbiddenForURLScheme(const String&);
     135    void registerURLSchemeAsLocal(const String&);
     136    void registerURLSchemeAsNoAccess(const String&);
     137    void registerURLSchemeAsDisplayIsolated(const String&);
     138    void registerURLSchemeAsCORSEnabled(const String&);
    135139
    136140    void addVisitedLink(const String&);
     
    296300    HashSet<String> m_schemesToRegisterAsSecure;
    297301    HashSet<String> m_schemesToSetDomainRelaxationForbiddenFor;
     302    HashSet<String> m_schemesToRegisterAsLocal;
     303    HashSet<String> m_schemesToRegisterAsNoAccess;
     304    HashSet<String> m_schemesToRegisterAsDisplayIsolated;
     305    HashSet<String> m_schemesToRegisterAsCORSEnabled;
    298306
    299307    bool m_alwaysUsesComplexTextCodePath;
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r127384 r128989  
    293293}
    294294
     295void WebProcess::registerURLSchemeAsLocal(const String& urlScheme) const
     296{
     297    SchemeRegistry::registerURLSchemeAsLocal(urlScheme);
     298}
     299
     300void WebProcess::registerURLSchemeAsNoAccess(const String& urlScheme) const
     301{
     302    SchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
     303}
     304
     305void WebProcess::registerURLSchemeAsDisplayIsolated(const String& urlScheme) const
     306{
     307    SchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
     308}
     309
     310void WebProcess::registerURLSchemeAsCORSEnabled(const String& urlScheme) const
     311{
     312    SchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
     313}
     314
    295315void WebProcess::setDefaultRequestTimeoutInterval(double timeoutInterval)
    296316{
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r128003 r128989  
    200200    void registerURLSchemeAsSecure(const String&) const;
    201201    void setDomainRelaxationForbiddenForURLScheme(const String&) const;
     202    void registerURLSchemeAsLocal(const String&) const;
     203    void registerURLSchemeAsNoAccess(const String&) const;
     204    void registerURLSchemeAsDisplayIsolated(const String&) const;
     205    void registerURLSchemeAsCORSEnabled(const String&) const;
    202206    void setDefaultRequestTimeoutInterval(double);
    203207    void setAlwaysUsesComplexTextCodePath(bool);
  • trunk/Source/WebKit2/WebProcess/WebProcess.messages.in

    r125670 r128989  
    4343    RegisterURLSchemeAsSecure(WTF::String scheme)
    4444    SetDomainRelaxationForbiddenForURLScheme(WTF::String scheme)
     45    RegisterURLSchemeAsLocal(WTF::String scheme)
     46    RegisterURLSchemeAsNoAccess(WTF::String scheme)
     47    RegisterURLSchemeAsDisplayIsolated(WTF::String scheme)
     48    RegisterURLSchemeAsCORSEnabled(WTF::String scheme)
    4549    SetDefaultRequestTimeoutInterval(double timeoutInterval)
    4650    SetAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
Note: See TracChangeset for help on using the changeset viewer.