OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/services/html_viewer/webcookiejar_impl.h" | 5 #include "mojo/services/html_viewer/webcookiejar_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "third_party/WebKit/public/platform/WebURL.h" | 8 #include "third_party/WebKit/public/platform/WebURL.h" |
9 | 9 |
10 namespace mojo { | 10 using mojo::String; |
| 11 |
| 12 namespace html_viewer { |
11 namespace { | 13 namespace { |
12 | 14 |
13 void CopyBool(bool* output, bool input) { | 15 void CopyBool(bool* output, bool input) { |
14 *output = input; | 16 *output = input; |
15 } | 17 } |
16 | 18 |
17 void CopyString(String* output, const String& input) { | 19 void CopyString(String* output, const String& input) { |
18 *output = input; | 20 *output = input; |
19 } | 21 } |
20 | 22 |
21 } // namespace | 23 } // namespace |
22 | 24 |
23 WebCookieJarImpl::WebCookieJarImpl(CookieStorePtr store) | 25 WebCookieJarImpl::WebCookieJarImpl(mojo::CookieStorePtr store) |
24 : store_(store.Pass()) { | 26 : store_(store.Pass()) { |
25 } | 27 } |
26 | 28 |
27 WebCookieJarImpl::~WebCookieJarImpl() { | 29 WebCookieJarImpl::~WebCookieJarImpl() { |
28 } | 30 } |
29 | 31 |
30 void WebCookieJarImpl::setCookie(const blink::WebURL& url, | 32 void WebCookieJarImpl::setCookie(const blink::WebURL& url, |
31 const blink::WebURL& first_party_for_cookies, | 33 const blink::WebURL& first_party_for_cookies, |
32 const blink::WebString& cookie) { | 34 const blink::WebString& cookie) { |
33 bool success; | 35 bool success; |
(...skipping 25 matching lines...) Expand all Loading... |
59 | 61 |
60 return blink::WebString::fromUTF8(result); | 62 return blink::WebString::fromUTF8(result); |
61 } | 63 } |
62 | 64 |
63 blink::WebString WebCookieJarImpl::cookieRequestHeaderFieldValue( | 65 blink::WebString WebCookieJarImpl::cookieRequestHeaderFieldValue( |
64 const blink::WebURL& url, | 66 const blink::WebURL& url, |
65 const blink::WebURL& first_party_for_cookies) { | 67 const blink::WebURL& first_party_for_cookies) { |
66 return cookies(url, first_party_for_cookies); | 68 return cookies(url, first_party_for_cookies); |
67 } | 69 } |
68 | 70 |
69 } // namespace mojo | 71 } // namespace html_viewer |
OLD | NEW |