| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CONTENT_PUBLIC_COMMON_REFERRER_STRUCT_TRAITS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_REFERRER_STRUCT_TRAITS_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_REFERRER_STRUCT_TRAITS_H_ | 6 #define CONTENT_PUBLIC_COMMON_REFERRER_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" |
| 8 #include "content/public/common/referrer.h" | 9 #include "content/public/common/referrer.h" |
| 9 #include "third_party/WebKit/public/platform/referrer.mojom.h" | 10 #include "third_party/WebKit/public/platform/referrer.mojom.h" |
| 10 | 11 |
| 11 namespace mojo { | 12 namespace mojo { |
| 12 | 13 |
| 13 template <> | 14 template <> |
| 14 struct StructTraits<::blink::mojom::ReferrerDataView, content::Referrer> { | 15 struct CONTENT_EXPORT |
| 16 StructTraits<::blink::mojom::ReferrerDataView, content::Referrer> { |
| 15 static const GURL& url(const content::Referrer& r) { | 17 static const GURL& url(const content::Referrer& r) { |
| 16 return r.url; | 18 return r.url; |
| 17 } | 19 } |
| 18 | 20 |
| 19 static ::blink::WebReferrerPolicy policy(const content::Referrer& r) { | 21 static ::blink::WebReferrerPolicy policy(const content::Referrer& r) { |
| 20 return r.policy; | 22 return r.policy; |
| 21 } | 23 } |
| 22 | 24 |
| 23 static bool Read(::blink::mojom::ReferrerDataView data, | 25 static bool Read(::blink::mojom::ReferrerDataView data, |
| 24 content::Referrer* out); | 26 content::Referrer* out); |
| 25 }; | 27 }; |
| 26 | 28 |
| 27 } | 29 } |
| 28 | 30 |
| 29 #endif // CONTENT_PUBLIC_COMMON_REFERRER_STRUCT_TRAITS_H_ | 31 #endif // CONTENT_PUBLIC_COMMON_REFERRER_STRUCT_TRAITS_H_ |
| OLD | NEW |