Changeset 69614 in webkit


Ignore:
Timestamp:
Oct 12, 2010 3:37:49 PM (14 years ago)
Author:
jberlin@webkit.org
Message:

Add ability for WK2 to register a scheme as secure.
https://bugs.webkit.org/show_bug.cgi?id=47557

Reviewed by Jon Honeycutt.

Add the schemes that need to be registered as secure to the WebProcessCreationParameters.

  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):

  • Shared/WebProcessCreationParameters.h:
  • UIProcess/API/C/WKContext.cpp:

(WKContextRegisterURLSchemeAsSecure):

  • UIProcess/API/C/WKContextPrivate.h:
  • UIProcess/WebContext.cpp:

(WebKit::WebContext::ensureWebProcess):
Copy over the schemes that are to be registered as secure to the
WebProcessCreationParameters.
(WebKit::WebContext::registerURLSchemeAsSecure):
Only send a message to the WebProcess if it is valid.

  • UIProcess/WebContext.h:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeWebProcess):
Register the schemes that need to be registered as secure from the
WebProcessCreationParameters.
(WebKit::WebProcess::registerURLSchemeAsSecure):

  • WebProcess/WebProcess.h:
  • WebProcess/WebProcess.messages.in:

Add the RegisterURLSchemeAsSecure message.

Location:
trunk/WebKit2
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r69604 r69614  
     12010-10-12  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Jon Honeycutt.
     4
     5        Add ability for WK2 to register a scheme as secure.
     6        https://bugs.webkit.org/show_bug.cgi?id=47557
     7
     8        Add the schemes that need to be registered as secure to the WebProcessCreationParameters.
     9        * Shared/WebProcessCreationParameters.cpp:
     10        (WebKit::WebProcessCreationParameters::encode):
     11        (WebKit::WebProcessCreationParameters::decode):
     12        * Shared/WebProcessCreationParameters.h:
     13
     14        * UIProcess/API/C/WKContext.cpp:
     15        (WKContextRegisterURLSchemeAsSecure):
     16        * UIProcess/API/C/WKContextPrivate.h:
     17
     18        * UIProcess/WebContext.cpp:
     19        (WebKit::WebContext::ensureWebProcess):
     20        Copy over the schemes that are to be registered as secure to the
     21        WebProcessCreationParameters.
     22        (WebKit::WebContext::registerURLSchemeAsSecure):
     23        Only send a message to the WebProcess if it is valid.
     24        * UIProcess/WebContext.h:
     25
     26        * WebProcess/WebProcess.cpp:
     27        (WebKit::WebProcess::initializeWebProcess):
     28        Register the schemes that need to be registered as secure from the
     29        WebProcessCreationParameters.
     30        (WebKit::WebProcess::registerURLSchemeAsSecure):
     31        * WebProcess/WebProcess.h:
     32
     33        * WebProcess/WebProcess.messages.in:
     34        Add the RegisterURLSchemeAsSecure message.
     35
    1362010-10-12  John Sullivan  <sullivan@apple.com>
    237
  • trunk/WebKit2/Shared/WebProcessCreationParameters.cpp

    r69037 r69614  
    4747    encoder->encode(applicationCacheDirectory);
    4848    encoder->encode(urlSchemesRegistererdAsEmptyDocument);
     49    encoder->encode(urlSchemesRegisteredAsSecure);
    4950    encoder->encode(static_cast<uint32_t>(cacheModel));
    5051    encoder->encode(shouldTrackVisitedLinks);
     
    7071    if (!decoder->decode(parameters.urlSchemesRegistererdAsEmptyDocument))
    7172        return false;
     73    if (!decoder->decode(parameters.urlSchemesRegisteredAsSecure))
     74        return false;
    7275
    7376    uint32_t cacheModel;
  • trunk/WebKit2/Shared/WebProcessCreationParameters.h

    r69037 r69614  
    5555    String applicationCacheDirectory;
    5656    Vector<String> urlSchemesRegistererdAsEmptyDocument;
     57    Vector<String> urlSchemesRegisteredAsSecure;
    5758
    5859    CacheModel cacheModel;
  • trunk/WebKit2/UIProcess/API/C/WKContext.cpp

    r69214 r69614  
    121121    toImpl(contextRef)->registerURLSchemeAsEmptyDocument(toImpl(urlScheme)->string());
    122122}
     123
     124void WKContextRegisterURLSchemeAsSecure(WKContextRef contextRef, WKStringRef urlScheme)
     125{
     126    toImpl(contextRef)->registerURLSchemeAsSecure(toImpl(urlScheme)->string());
     127}
  • trunk/WebKit2/UIProcess/API/C/WKContextPrivate.h

    r64287 r69614  
    4949WK_EXPORT void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef context, WKStringRef urlScheme);
    5050
     51WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKStringRef urlScheme);
     52
    5153#ifdef __cplusplus
    5254}
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r69056 r69614  
    153153   
    154154    copyToVector(m_schemesToRegisterAsEmptyDocument, parameters.urlSchemesRegistererdAsEmptyDocument);
     155    copyToVector(m_schemesToRegisterAsSecure, parameters.urlSchemesRegisteredAsSecure);
    155156
    156157    // Add any platform specific parameters
     
    309310
    310311    m_process->send(Messages::WebProcess::RegisterURLSchemeAsEmptyDocument(urlScheme), 0);
     312}
     313
     314void WebContext::registerURLSchemeAsSecure(const String& urlScheme)
     315{
     316    m_schemesToRegisterAsSecure.add(urlScheme);
     317
     318    if (!hasValidProcess())
     319        return;
     320
     321    m_process->send(Messages::WebProcess::RegisterURLSchemeAsSecure(urlScheme), 0);
    311322}
    312323
  • trunk/WebKit2/UIProcess/WebContext.h

    r69240 r69614  
    103103   
    104104    void registerURLSchemeAsEmptyDocument(const String&);
     105    void registerURLSchemeAsSecure(const String&);
    105106   
    106107    void addVisitedLink(const String&);
     
    143144       
    144145    HashSet<String> m_schemesToRegisterAsEmptyDocument;
     146    HashSet<String> m_schemesToRegisterAsSecure;
    145147    Vector<pair<String, RefPtr<APIObject> > > m_pendingMessagesToPostToInjectedBundle;
    146148
  • trunk/WebKit2/WebProcess/WebProcess.cpp

    r69503 r69614  
    133133    setShouldTrackVisitedLinks(parameters.shouldTrackVisitedLinks);
    134134    setCacheModel(static_cast<uint32_t>(parameters.cacheModel));
     135
    135136    for (size_t i = 0; i < parameters.urlSchemesRegistererdAsEmptyDocument.size(); ++i)
    136137        registerURLSchemeAsEmptyDocument(parameters.urlSchemesRegistererdAsEmptyDocument[i]);
    137138
     139    for (size_t i = 0; i < parameters.urlSchemesRegisteredAsSecure.size(); ++i)
     140        registerURLSchemeAsSecure(parameters.urlSchemesRegisteredAsSecure[i]);
     141
    138142#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
    139143    m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
     
    152156{
    153157    SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
     158}
     159
     160void WebProcess::registerURLSchemeAsSecure(const String& urlScheme) const
     161{
     162    SchemeRegistry::registerURLSchemeAsSecure(urlScheme);
    154163}
    155164
  • trunk/WebKit2/WebProcess/WebProcess.h

    r69037 r69614  
    9191    void setShouldTrackVisitedLinks(bool);
    9292    void registerURLSchemeAsEmptyDocument(const String&);
     93    void registerURLSchemeAsSecure(const String&) const;
    9394#if PLATFORM(WIN)
    9495    void setShouldPaintNativeControls(bool);
  • trunk/WebKit2/WebProcess/WebProcess.messages.in

    r69037 r69614  
    3737    SetCacheModel(uint32_t cacheModel)
    3838    RegisterURLSchemeAsEmptyDocument(WTF::String scheme)
     39    RegisterURLSchemeAsSecure(WTF::String scheme)
    3940#if PLATFORM(WIN)
    4041    SetShouldPaintNativeControls(bool shouldPaintNativeControls)
Note: See TracChangeset for help on using the changeset viewer.