OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "public/platform/WebCookieJar.h" | 40 #include "public/platform/WebCookieJar.h" |
41 #include "public/platform/WebURL.h" | 41 #include "public/platform/WebURL.h" |
42 #include "public/platform/WebVector.h" | 42 #include "public/platform/WebVector.h" |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 static blink::WebCookieJar* toCookieJar(const Document* document) | 46 static blink::WebCookieJar* toCookieJar(const Document* document) |
47 { | 47 { |
48 if (!document || !document->frame()) | 48 if (!document || !document->frame()) |
49 return 0; | 49 return 0; |
50 blink::WebCookieJar* cookieJar = document->frame()->loader().client()->cooki
eJar(); | 50 return document->frame()->loader().client()->cookieJar(); |
51 // FIXME: DRT depends on being able to get a cookie jar from Platform rather
than | |
52 // FrameLoaderClient. Delete this when DRT is deleted. | |
53 if (!cookieJar) | |
54 cookieJar = blink::Platform::current()->cookieJar(); | |
55 return cookieJar; | |
56 } | 51 } |
57 | 52 |
58 String cookies(const Document* document, const KURL& url) | 53 String cookies(const Document* document, const KURL& url) |
59 { | 54 { |
60 blink::WebCookieJar* cookieJar = toCookieJar(document); | 55 blink::WebCookieJar* cookieJar = toCookieJar(document); |
61 if (!cookieJar) | 56 if (!cookieJar) |
62 return String(); | 57 return String(); |
63 return cookieJar->cookies(url, document->firstPartyForCookies()); | 58 return cookieJar->cookies(url, document->firstPartyForCookies()); |
64 } | 59 } |
65 | 60 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 100 |
106 void deleteCookie(const Document* document, const KURL& url, const String& cooki
eName) | 101 void deleteCookie(const Document* document, const KURL& url, const String& cooki
eName) |
107 { | 102 { |
108 blink::WebCookieJar* cookieJar = toCookieJar(document); | 103 blink::WebCookieJar* cookieJar = toCookieJar(document); |
109 if (!cookieJar) | 104 if (!cookieJar) |
110 return; | 105 return; |
111 cookieJar->deleteCookie(url, cookieName); | 106 cookieJar->deleteCookie(url, cookieName); |
112 } | 107 } |
113 | 108 |
114 } | 109 } |
OLD | NEW |