Source/WebCore: Moving cookieEnabled/setCookieEnabled from Page to Settings.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jun 2012 23:49:53 +0000 (23:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jun 2012 23:49:53 +0000 (23:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89545

Patch by Garret Kelly <gdk@chromium.org> on 2012-06-20
Reviewed by Adam Barth.

* dom/Document.cpp:
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
* page/Navigator.cpp:
(WebCore::Navigator::cookieEnabled):
* page/Page.h:
(Page):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setCookieEnabled):
(WebCore::Settings::cookieEnabled):
(Settings):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime):

Source/WebKit/chromium: Moving cookieEnabled/setCookieEnabled from Page to Settings, and
exposing through WebSettings.
https://bugs.webkit.org/show_bug.cgi?id=89545

Patch by Garret Kelly <gdk@chromium.org> on 2012-06-20
Reviewed by Adam Barth.

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setCookieEnabled):
* src/WebSettingsImpl.h:
(WebSettingsImpl):

Source/WebKit/mac: Moving cookieEnabled/setCookieEnabled from Page to Settings.
https://bugs.webkit.org/show_bug.cgi?id=89545

Patch by Garret Kelly <gdk@chromium.org> on 2012-06-20
Reviewed by Adam Barth.

* WebView/WebView.mm:
(-[WebView _cookieEnabled]):
(-[WebView _setCookieEnabled:]):

Source/WebKit/win: Moving cookieEnabled/setCookieEnabled from Page to Settings.
https://bugs.webkit.org/show_bug.cgi?id=89545

Patch by Garret Kelly <gdk@chromium.org> on 2012-06-20
Reviewed by Adam Barth.

* WebView.cpp:
(WebView::setCookieEnabled):
(WebView::cookieEnabled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120885 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/page/Navigator.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp

index 926b101..41bd0d9 100644 (file)
@@ -1,3 +1,26 @@
+2012-06-20  Garret Kelly  <gdk@chromium.org>
+
+        Moving cookieEnabled/setCookieEnabled from Page to Settings.
+        https://bugs.webkit.org/show_bug.cgi?id=89545
+
+        Reviewed by Adam Barth.
+
+        * dom/Document.cpp:
+        (WebCore::Document::cookie):
+        (WebCore::Document::setCookie):
+        * page/Navigator.cpp:
+        (WebCore::Navigator::cookieEnabled):
+        * page/Page.h:
+        (Page):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setCookieEnabled):
+        (WebCore::Settings::cookieEnabled):
+        (Settings):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime):
+
 2012-06-20  Adam Barth  <abarth@webkit.org>
 
         internals.settings.setDeviceScaleFactor doesn't work for WebKit2 and must be removed
index 176d913..83a83ef 100644 (file)
@@ -4131,7 +4131,7 @@ HTMLFrameOwnerElement* Document::ownerElement() const
 
 String Document::cookie(ExceptionCode& ec) const
 {
-    if (page() && !page()->cookieEnabled())
+    if (page() && !page()->settings()->cookieEnabled())
         return String();
 
     // FIXME: The HTML5 DOM spec states that this attribute can raise an
@@ -4152,7 +4152,7 @@ String Document::cookie(ExceptionCode& ec) const
 
 void Document::setCookie(const String& value, ExceptionCode& ec)
 {
-    if (page() && !page()->cookieEnabled())
+    if (page() && !page()->settings()->cookieEnabled())
         return;
 
     // FIXME: The HTML5 DOM spec states that this attribute can raise an
index 3af6f07..1af15be 100644 (file)
@@ -115,8 +115,8 @@ bool Navigator::cookieEnabled() const
 {
     if (!m_frame)
         return false;
-        
-    if (m_frame->page() && !m_frame->page()->cookieEnabled())
+
+    if (m_frame->page() && !m_frame->page()->settings()->cookieEnabled())
         return false;
 
     return cookiesEnabled(m_frame->document());
index b0c2be5..e618036 100644 (file)
@@ -237,9 +237,6 @@ namespace WebCore {
         bool inLowQualityImageInterpolationMode() const;
         void setInLowQualityImageInterpolationMode(bool = true);
 
-        bool cookieEnabled() const { return m_cookieEnabled; }
-        void setCookieEnabled(bool enabled) { m_cookieEnabled = enabled; }
-
         float mediaVolume() const { return m_mediaVolume; }
         void setMediaVolume(float volume);
 
index d939b2c..edd3d79 100644 (file)
@@ -270,6 +270,7 @@ Settings::Settings(Page* page)
     , m_needsDidFinishLoadOrderQuirk(false)
     , m_fixedPositionCreatesStackingContext(false)
     , m_syncXHRInDocumentsEnabled(true)
+    , m_cookieEnabled(true)
     , m_windowFocusRestricted(true)
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
     , m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
index a017d8f..d846fa0 100644 (file)
@@ -586,6 +586,9 @@ namespace WebCore {
         static bool shouldRespectPriorityInCSSAttributeSetters();
 #endif
 
+        void setCookieEnabled(bool enabled) { m_cookieEnabled = enabled; }
+        bool cookieEnabled() const { return m_cookieEnabled; }
+
     private:
         Settings(Page*);
 
@@ -750,6 +753,7 @@ namespace WebCore {
 
         bool m_fixedPositionCreatesStackingContext : 1;
         bool m_syncXHRInDocumentsEnabled : 1;
+        bool m_cookieEnabled : 1;
 
         bool m_windowFocusRestricted : 1;
 
index 7d9dcaf..1304963 100644 (file)
@@ -263,7 +263,7 @@ void MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime(const St
     // download the movie into WinInet before asking QuickTime to open it.
     Document* document = m_player->mediaPlayerClient()->mediaPlayerOwningDocument();
     Frame* frame = document ? document->frame() : 0;
-    if (!frame || !frame->page() || !frame->page()->cookieEnabled())
+    if (!frame || !frame->page() || !frame->page()->settings()->cookieEnabled())
         return;
 
     KURL movieURL = KURL(KURL(), url);
index ca543de..ca8b2c2 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-20  Garret Kelly  <gdk@chromium.org>
+
+        Moving cookieEnabled/setCookieEnabled from Page to Settings, and
+        exposing through WebSettings.
+        https://bugs.webkit.org/show_bug.cgi?id=89545
+
+        Reviewed by Adam Barth.
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setCookieEnabled):
+        * src/WebSettingsImpl.h:
+        (WebSettingsImpl):
+
 2012-06-20  Raymes Khoury  <raymes@chromium.org>
 
         Perform hit-test from correct frame in isRectTopmost()
index 0528d8e..bab5c38 100644 (file)
@@ -154,6 +154,7 @@ public:
     virtual void setMaxUntiledLayerSize(WebSize) = 0;
     virtual void setFixedPositionCreatesStackingContext(bool) = 0;
     virtual void setSyncXHRInDocumentsEnabled(bool) = 0;
+    virtual void setCookieEnabled(bool) = 0;
 
     virtual bool forceSoftwareCompositing() const = 0;
 
index 5f8776b..43c433c 100644 (file)
@@ -622,5 +622,9 @@ void WebSettingsImpl::setSyncXHRInDocumentsEnabled(bool enabled)
     m_settings->setSyncXHRInDocumentsEnabled(enabled);
 }
 
+void WebSettingsImpl::setCookieEnabled(bool enabled)
+{
+    m_settings->setCookieEnabled(enabled);
+}
 
 } // namespace WebKit
index 2b58c04..9a65c2a 100644 (file)
@@ -149,6 +149,7 @@ public:
     virtual void setMediaPlaybackRequiresUserGesture(bool);
     virtual bool viewportEnabled() const { return m_viewportEnabled; }
     virtual void setSyncXHRInDocumentsEnabled(bool);
+    virtual void setCookieEnabled(bool);
 
     bool showFPSCounter() const { return m_showFPSCounter; }
     bool showPlatformLayerTree() const { return m_showPlatformLayerTree; }
index 2122e5c..e48b4b6 100644 (file)
@@ -1,3 +1,14 @@
+2012-06-20  Garret Kelly  <gdk@chromium.org>
+
+        Moving cookieEnabled/setCookieEnabled from Page to Settings.
+        https://bugs.webkit.org/show_bug.cgi?id=89545
+
+        Reviewed by Adam Barth.
+
+        * WebView/WebView.mm:
+        (-[WebView _cookieEnabled]):
+        (-[WebView _setCookieEnabled:]):
+
 2012-06-19  Dan Bernstein  <mitz@apple.com>
 
         WebKit/mac part of: Paginated display API doesn’t allow setting the page progression direction
index 0fc8cca..f7a681b 100644 (file)
@@ -2243,14 +2243,14 @@ static inline IMP getMethod(id o, SEL s)
 - (BOOL)_cookieEnabled
 {
     if (_private->page)
-        return _private->page->cookieEnabled();
+        return _private->page->settings()->cookieEnabled();
     return YES;
 }
 
 - (void)_setCookieEnabled:(BOOL)enable
 {
     if (_private->page)
-        _private->page->setCookieEnabled(enable);
+        _private->page->settings()->setCookieEnabled(enable);
 }
 
 - (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths
index 9e27e7a..8a1e10b 100644 (file)
@@ -1,3 +1,14 @@
+2012-06-20  Garret Kelly  <gdk@chromium.org>
+
+        Moving cookieEnabled/setCookieEnabled from Page to Settings.
+        https://bugs.webkit.org/show_bug.cgi?id=89545
+
+        Reviewed by Adam Barth.
+
+        * WebView.cpp:
+        (WebView::setCookieEnabled):
+        (WebView::cookieEnabled):
+
 2012-06-20  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Use IntSize in RenderLayer to represent scroll offsets
index 214e35f..880bc1b 100644 (file)
@@ -6020,7 +6020,7 @@ HRESULT STDMETHODCALLTYPE WebView::setCookieEnabled(BOOL enable)
     if (!m_page)
         return E_FAIL;
 
-    m_page->setCookieEnabled(enable);
+    m_page->settings()->setCookieEnabled(enable);
     return S_OK;
 }
 
@@ -6032,7 +6032,7 @@ HRESULT STDMETHODCALLTYPE WebView::cookieEnabled(BOOL* enabled)
     if (!m_page)
         return E_FAIL;
 
-    *enabled = m_page->cookieEnabled();
+    *enabled = m_page->settings()->cookieEnabled();
     return S_OK;
 }