Changeset 84980 in webkit


Ignore:
Timestamp:
Apr 26, 2011 4:43:03 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-26 Chang Shu <cshu@webkit.org>

Reviewed by Laszlo Gombos.

WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
https://bugs.webkit.org/show_bug.cgi?id=57572

Remove the unnecessary code that updates preference.

  • Shared/WebPreferencesStore.cpp: (WebKit::WebPreferencesStore::decode):
  • Shared/WebPreferencesStore.h:
  • WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetAllowUniversalAccessFromFileURLs):
  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setAllowUniversalAccessFromFileURLs): (WebKit::InjectedBundle::setAllowFileAccessFromFileURLs):
  • WebProcess/InjectedBundle/InjectedBundle.h:

2011-04-26 Chang Shu <cshu@webkit.org>

Reviewed by Laszlo Gombos.

WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
https://bugs.webkit.org/show_bug.cgi?id=57572

Remove the unnecessary code that updates preference.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::beginTesting):
  • WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: (WTR::LayoutTestController::setAllowUniversalAccessFromFileURLs):
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r84970 r84980  
     12011-04-26  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Laszlo Gombos.
     4
     5        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
     6        https://bugs.webkit.org/show_bug.cgi?id=57572
     7
     8        Remove the unnecessary code that updates preference.
     9
     10        * Shared/WebPreferencesStore.cpp:
     11        (WebKit::WebPreferencesStore::decode):
     12        * Shared/WebPreferencesStore.h:
     13        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
     14        (WKBundleSetAllowUniversalAccessFromFileURLs):
     15        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
     16        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     17        (WebKit::InjectedBundle::setAllowUniversalAccessFromFileURLs):
     18        (WebKit::InjectedBundle::setAllowFileAccessFromFileURLs):
     19        * WebProcess/InjectedBundle/InjectedBundle.h:
     20
    1212011-04-26  Brian Weinstein  <bweinstein@apple.com>
    222
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp

    r83766 r84980  
    5151static bool hasXSSAuditorEnabledTestRunnerOverride;
    5252static bool xssAuditorEnabledTestRunnerOverride;
    53 static bool hasAllowUniversalAccessFromFileURLsTestRunnerOverride;
    54 static bool allowUniversalAccessFromFileURLsTestRunnerOverride;
    55 static bool hasAllowFileAccessFromFileURLsTestRunnerOverride;
    56 static bool allowFileAccessFromFileURLsTestRunnerOverride;
    5753
    5854WebPreferencesStore::WebPreferencesStore()
     
    7369        s.m_boolValues.set(WebPreferencesKey::xssAuditorEnabledKey(), xssAuditorEnabledTestRunnerOverride);
    7470
    75     if (hasAllowUniversalAccessFromFileURLsTestRunnerOverride)
    76         s.m_boolValues.set(WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), allowUniversalAccessFromFileURLsTestRunnerOverride);
    77 
    78     if (hasAllowFileAccessFromFileURLsTestRunnerOverride)
    79         s.m_boolValues.set(WebPreferencesKey::allowFileAccessFromFileURLsKey(), allowFileAccessFromFileURLsTestRunnerOverride);
    80 
    8171    return true;
    8272}
     
    8676    hasXSSAuditorEnabledTestRunnerOverride = true;
    8777    xssAuditorEnabledTestRunnerOverride = enabled;
    88 }
    89 
    90 void WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(bool enabled)
    91 {
    92     hasAllowUniversalAccessFromFileURLsTestRunnerOverride = true;
    93     allowUniversalAccessFromFileURLsTestRunnerOverride = enabled;
    94 }
    95 
    96 void WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner(bool enabled)
    97 {
    98     hasAllowFileAccessFromFileURLsTestRunnerOverride = true;
    99     allowFileAccessFromFileURLsTestRunnerOverride = enabled;
    10078}
    10179
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r84648 r84980  
    172172
    173173    static void overrideXSSAuditorEnabledForTestRunner(bool);
    174     static void overrideAllowUniversalAccessFromFileURLsForTestRunner(bool);
    175     static void overrideAllowFileAccessFromFileURLsForTestRunner(bool);
    176174    static void removeTestRunnerOverrides();
    177175
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r84721 r84980  
    129129}
    130130
    131 void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
     131void WKBundleSetAllowUniversalAccessFromFileURLs(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
    132132{
    133     toImpl(bundleRef)->overrideAllowUniversalAccessFromFileURLsForTestRunner(toImpl(pageGroupRef), enabled);
     133    toImpl(bundleRef)->setAllowUniversalAccessFromFileURLs(toImpl(pageGroupRef), enabled);
    134134}
    135135
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h

    r84721 r84980  
    6666// Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use.
    6767WK_EXPORT void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
    68 WK_EXPORT void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
     68WK_EXPORT void WKBundleSetAllowUniversalAccessFromFileURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
    6969WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
    7070WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r84721 r84980  
    114114}
    115115
    116 void InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy* pageGroup, bool enabled)
    117 {
    118     // Override the preference for all future pages.
    119     WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(enabled);
    120 
    121     // Change the setting for existing ones.
     116void InjectedBundle::setAllowUniversalAccessFromFileURLs(WebPageGroupProxy* pageGroup, bool enabled)
     117{
    122118    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
    123119    for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
     
    127123void InjectedBundle::setAllowFileAccessFromFileURLs(WebPageGroupProxy* pageGroup, bool enabled)
    128124{
    129     // Override the preference for all future pages.
    130     WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner(enabled);
    131 
    132     // Change the setting for existing ones.
    133125    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
    134126    for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h

    r84721 r84980  
    9292    void activateMacFontAscentHack();
    9393    void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled);
    94     void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool);
     94    void setAllowUniversalAccessFromFileURLs(WebPageGroupProxy*, bool);
    9595    void setAllowFileAccessFromFileURLs(WebPageGroupProxy*, bool);
    9696    void setFrameFlatteningEnabled(WebPageGroupProxy*, bool);
  • trunk/Tools/ChangeLog

    r84975 r84980  
     12011-04-26  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Laszlo Gombos.
     4
     5        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
     6        https://bugs.webkit.org/show_bug.cgi?id=57572
     7
     8        Remove the unnecessary code that updates preference.
     9
     10        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     11        (WTR::InjectedBundle::beginTesting):
     12        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
     13        (WTR::LayoutTestController::setAllowUniversalAccessFromFileURLs):
     14
    1152011-04-26  Mario Sanchez Prada  <msanchez@igalia.com>
    216
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r84534 r84980  
    178178    WKBundleSetShouldTrackVisitedLinks(m_bundle, false);
    179179    WKBundleRemoveAllVisitedLinks(m_bundle);
    180     WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(m_bundle, m_pageGroup, true);
     180    WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true);
    181181
    182182    WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

    r84721 r84980  
    319319void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
    320320{
    321     WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
     321    WKBundleSetAllowUniversalAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
    322322}
    323323
Note: See TracChangeset for help on using the changeset viewer.