1 // Copyright 2016 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef URL_MOJOM_URL_GURL_MOJOM_TRAITS_H_ 6 #define URL_MOJOM_URL_GURL_MOJOM_TRAITS_H_ 7 8 #include "base/component_export.h" 9 #include "base/strings/string_piece.h" 10 #include "mojo/public/cpp/bindings/struct_traits.h" 11 #include "url/gurl.h" 12 #include "url/mojom/url.mojom-shared.h" 13 14 namespace mojo { 15 16 template <> COMPONENT_EXPORT(URL_MOJOM_TRAITS)17struct COMPONENT_EXPORT(URL_MOJOM_TRAITS) 18 StructTraits<url::mojom::UrlDataView, GURL> { 19 static base::StringPiece url(const GURL& r); 20 static bool Read(url::mojom::UrlDataView data, GURL* out); 21 }; 22 23 } // namespace mojo 24 25 #endif // URL_MOJOM_URL_GURL_MOJOM_TRAITS_H_ 26