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 <string_view> 9 10 #include "base/component_export.h" 11 #include "mojo/public/cpp/bindings/struct_traits.h" 12 #include "url/gurl.h" 13 #include "url/mojom/url.mojom-shared.h" 14 15 namespace mojo { 16 17 template <> COMPONENT_EXPORT(URL_MOJOM_TRAITS)18struct COMPONENT_EXPORT(URL_MOJOM_TRAITS) 19 StructTraits<url::mojom::UrlDataView, GURL> { 20 static std::string_view url(const GURL& r); 21 static bool Read(url::mojom::UrlDataView data, GURL* out); 22 }; 23 24 } // namespace mojo 25 26 #endif // URL_MOJOM_URL_GURL_MOJOM_TRAITS_H_ 27