Changeset 135013 in webkit
- Timestamp:
- Nov 16, 2012, 3:52:37 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r135009 r135013 1 2012-11-16 Mark Pilgrim <pilgrim@chromium.org> 2 3 [Chromium] Remove cookie-related functions from PlatformSupport 4 https://bugs.webkit.org/show_bug.cgi?id=99340 5 6 Reviewed by Adam Barth. 7 8 Move cookie-related functions out of PlatformSupport and implement 9 new PlatformCookieJar interface via NetworkContext. 10 11 * WebCore.gyp/WebCore.gyp: 12 * WebCore.gypi: 13 * loader/CookieJar.cpp: 14 * loader/chromium/CookieJarChromium.cpp: Removed. 15 * platform/chromium/PlatformSupport.h: 16 (WebCore): 17 (PlatformSupport): 18 * platform/network/NetworkingContext.h: 19 (WebKit): 20 (NetworkingContext): 21 * platform/network/chromium/CookieJarChromium.cpp: Copied from Source/WebCore/loader/chromium/CookieJarChromium.cpp. 22 (WebCore::setCookiesFromDOM): 23 (WebCore::cookiesForDOM): 24 (WebCore::cookieRequestHeaderFieldValue): 25 (WebCore::cookiesEnabled): 26 (WebCore::getRawCookies): 27 (WebCore::deleteCookie): 28 (WebCore::getHostnamesWithCookies): 29 (WebCore::deleteCookiesForHostname): 30 (WebCore::deleteAllCookies): 31 1 32 2012-11-16 Pablo Flouret <pablof@motorola.com> 2 33 -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r134975 r135013 2117 2117 ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'], 2118 2118 ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'], 2119 ['exclude', 'loader/CookieJar\\.cpp$'],2120 2119 ['exclude', 'loader/appcache/'], 2121 2120 ['exclude', 'loader/archive/cf/LegacyWebArchiveMac\\.mm$'], -
trunk/Source/WebCore/WebCore.gypi
r134975 r135013 3050 3050 'loader/cf/ResourceLoaderCFNet.cpp', 3051 3051 'loader/chromium/CachedRawResourceChromium.cpp', 3052 'loader/chromium/CookieJarChromium.cpp',3053 3052 'loader/chromium/DocumentThreadableLoaderChromium.cpp', 3054 3053 'loader/chromium/ResourceLoaderChromium.cpp', … … 5585 5584 'platform/network/chromium/AuthenticationChallenge.h', 5586 5585 'platform/network/chromium/AuthenticationChallengeChromium.cpp', 5586 'platform/network/chromium/CookieJarChromium.cpp', 5587 5587 'platform/network/chromium/DNSChromium.cpp', 5588 5588 'platform/network/chromium/ResourceError.h', -
trunk/Source/WebCore/loader/CookieJar.cpp
r134975 r135013 31 31 #include "PlatformCookieJar.h" 32 32 33 #if PLATFORM( CHROMIUM) || PLATFORM(BLACKBERRY)34 #error Chromium and Blackberry currently usea fork of this file because of layering violations33 #if PLATFORM(BLACKBERRY) 34 #error Blackberry currently uses a fork of this file because of layering violations 35 35 #endif 36 36 -
trunk/Source/WebCore/platform/chromium/PlatformSupport.h
r134975 r135013 70 70 class Widget; 71 71 72 struct Cookie;73 72 struct FontRenderStyle; 74 73 … … 79 78 class PlatformSupport { 80 79 public: 81 // Cookies ------------------------------------------------------------82 static void setCookies(const Document*, const KURL&, const String& value);83 static String cookies(const Document*, const KURL&);84 static String cookieRequestHeaderFieldValue(const Document*, const KURL&);85 static bool rawCookies(const Document*, const KURL&, Vector<Cookie>&);86 static void deleteCookie(const Document*, const KURL&, const String& cookieName);87 static bool cookiesEnabled(const Document*);88 89 80 // Font --------------------------------------------------------------- 90 81 #if OS(WINDOWS) -
trunk/Source/WebCore/platform/network/NetworkingContext.h
r134975 r135013 25 25 #if PLATFORM(MAC) 26 26 #include "SchedulePair.h" 27 #endif 28 29 #if PLATFORM(CHROMIUM) 30 namespace WebKit { 31 class WebCookieJar; 32 } 27 33 #endif 28 34 … … 61 67 62 68 virtual bool isValid() const { return true; } 69 70 #if PLATFORM(CHROMIUM) 71 virtual WebKit::WebCookieJar* cookieJar() const = 0; 72 #endif 63 73 64 74 #if PLATFORM(MAC) -
trunk/Source/WebKit/chromium/ChangeLog
r135002 r135013 1 2012-11-16 Mark Pilgrim <pilgrim@chromium.org> 2 3 [Chromium] Remove cookie-related functions from PlatformSupport 4 https://bugs.webkit.org/show_bug.cgi?id=99340 5 6 Reviewed by Adam Barth. 7 8 Move cookie-related functions out of PlatformSupport and implement 9 new PlatformCookieJar interface via NetworkContext. 10 11 * WebKit.gyp: 12 * src/FrameNetworkingContextImpl.cpp: Added. 13 (WebKit): 14 (WebKit::FrameNetworkingContextImpl::cookieJar): 15 * src/FrameNetworkingContextImpl.h: 16 (FrameNetworkingContextImpl): 17 * src/PlatformSupport.cpp: 18 1 19 2012-11-16 Tien-Ren Chen <trchen@chromium.org> 2 20 -
trunk/Source/WebKit/chromium/WebKit.gyp
r134975 r135013 395 395 'src/FrameLoaderClientImpl.cpp', 396 396 'src/FrameLoaderClientImpl.h', 397 'src/FrameNetworkingContextImpl.cpp', 397 398 'src/FrameNetworkingContextImpl.h', 398 399 'src/GeolocationClientProxy.cpp', -
trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp
r135010 r135013 1 1 /* 2 * Copyright ( c) 2010,Google Inc. All rights reserved.3 * 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions are 6 6 * met: 7 * 7 * 8 8 * * Redistributions of source code must retain the above copyright 9 9 * notice, this list of conditions and the following disclaimer. … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 30 30 31 31 #include "config.h" 32 #include " CookieJar.h"32 #include "FrameNetworkingContextImpl.h" 33 33 34 #include " Cookie.h"35 #include " Document.h"36 #include "PlatformSupport.h"34 #include "WebFrameClient.h" 35 #include "WebFrameImpl.h" 36 #include <public/Platform.h> 37 37 38 namespace Web Core{38 namespace WebKit { 39 39 40 // FIXME: Unfork. This file is forked because all other platforms use NetworkingContext to access cookie jar, not Document or Frame. 41 42 void setCookies(Document* document, const KURL& url, const String& value) 40 WebCookieJar* FrameNetworkingContextImpl::cookieJar() const 43 41 { 44 PlatformSupport::setCookies(document, url, value); 42 WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(frame()); 43 if (!frameImpl || !frameImpl->client()) 44 return 0; 45 WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl); 46 if (!cookieJar) 47 cookieJar = WebKit::Platform::current()->cookieJar(); 48 return cookieJar; 45 49 } 46 50 47 String cookies(const Document* document, const KURL& url)48 {49 return PlatformSupport::cookies(document, url);50 51 } 51 52 String cookieRequestHeaderFieldValue(const Document* document, const KURL& url)53 {54 return PlatformSupport::cookieRequestHeaderFieldValue(document, url);55 }56 57 bool cookiesEnabled(const Document* document)58 {59 return PlatformSupport::cookiesEnabled(document);60 }61 62 bool getRawCookies(const Document* document, const KURL& url, Vector<Cookie>& rawCookies)63 {64 return PlatformSupport::rawCookies(document, url, rawCookies);65 }66 67 void deleteCookie(const Document* document, const KURL& url, const String& cookieName)68 {69 return PlatformSupport::deleteCookie(document, url, cookieName);70 }71 72 void getHostnamesWithCookies(HashSet<String>& hostnames)73 {74 // FIXME: Not yet implemented75 }76 77 void deleteCookiesForHostname(const String& hostname)78 {79 // FIXME: Not yet implemented80 }81 82 void deleteAllCookies()83 {84 // FIXME: Not yet implemented85 }86 87 } // namespace WebCore -
trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h
r134975 r135013 22 22 23 23 #include "FrameNetworkingContext.h" 24 #include <public/WebCookieJar.h> 24 25 25 26 namespace WebKit { … … 27 28 class FrameNetworkingContextImpl : public WebCore::FrameNetworkingContext { 28 29 public: 30 virtual WebCookieJar* cookieJar() const OVERRIDE; 31 29 32 static PassRefPtr<FrameNetworkingContextImpl> create(WebCore::Frame* frame) 30 33 { -
trunk/Source/WebKit/chromium/src/PlatformSupport.cpp
r134975 r135013 85 85 86 86 #include "BitmapImage.h" 87 #include "Cookie.h"88 #include "Document.h"89 87 #include "FrameView.h" 90 88 #include "GraphicsContext.h" … … 98 96 #include "Worker.h" 99 97 #include "WorkerContextProxy.h" 100 #include <public/WebCookie.h>101 #include <public/WebCookieJar.h>102 98 #include <public/WebMimeRegistry.h> 103 99 #include <public/WebVector.h> … … 109 105 namespace WebCore { 110 106 111 static WebCookieJar* getCookieJar(const Document* document)112 {113 WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(document->frame());114 if (!frameImpl || !frameImpl->client())115 return 0;116 WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl);117 if (!cookieJar)118 cookieJar = WebKit::Platform::current()->cookieJar();119 return cookieJar;120 }121 122 // Cookies --------------------------------------------------------------------123 124 void PlatformSupport::setCookies(const Document* document, const KURL& url,125 const String& value)126 {127 WebCookieJar* cookieJar = getCookieJar(document);128 if (cookieJar)129 cookieJar->setCookie(url, document->firstPartyForCookies(), value);130 }131 132 String PlatformSupport::cookies(const Document* document, const KURL& url)133 {134 String result;135 WebCookieJar* cookieJar = getCookieJar(document);136 if (cookieJar)137 result = cookieJar->cookies(url, document->firstPartyForCookies());138 return result;139 }140 141 String PlatformSupport::cookieRequestHeaderFieldValue(const Document* document,142 const KURL& url)143 {144 String result;145 WebCookieJar* cookieJar = getCookieJar(document);146 if (cookieJar)147 result = cookieJar->cookieRequestHeaderFieldValue(url, document->firstPartyForCookies());148 return result;149 }150 151 bool PlatformSupport::rawCookies(const Document* document, const KURL& url, Vector<Cookie>& rawCookies)152 {153 rawCookies.clear();154 WebVector<WebCookie> webCookies;155 156 WebCookieJar* cookieJar = getCookieJar(document);157 if (cookieJar)158 cookieJar->rawCookies(url, document->firstPartyForCookies(), webCookies);159 160 for (unsigned i = 0; i < webCookies.size(); ++i) {161 const WebCookie& webCookie = webCookies[i];162 Cookie cookie(webCookie.name,163 webCookie.value,164 webCookie.domain,165 webCookie.path,166 webCookie.expires,167 webCookie.httpOnly,168 webCookie.secure,169 webCookie.session);170 rawCookies.append(cookie);171 }172 return true;173 }174 175 void PlatformSupport::deleteCookie(const Document* document, const KURL& url, const String& cookieName)176 {177 WebCookieJar* cookieJar = getCookieJar(document);178 if (cookieJar)179 cookieJar->deleteCookie(url, cookieName);180 }181 182 bool PlatformSupport::cookiesEnabled(const Document* document)183 {184 bool result = false;185 WebCookieJar* cookieJar = getCookieJar(document);186 if (cookieJar)187 result = cookieJar->cookiesEnabled(document->cookieURL(), document->firstPartyForCookies());188 return result;189 }190 191 107 // Font ----------------------------------------------------------------------- 192 108
Note:
See TracChangeset
for help on using the changeset viewer.