Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / mojo / common / common_type_converters.h
blob9afbfc63112c82c6e3d475a97588186369c24e70
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
6 #define MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
8 #include "base/strings/string16.h"
9 #include "base/strings/string_piece.h"
10 #include "mojo/common/mojo_common_export.h"
11 #include "mojo/public/cpp/bindings/string.h"
12 #include "mojo/public/cpp/bindings/type_converter.h"
14 class GURL;
16 namespace mojo {
18 template <>
19 class MOJO_COMMON_EXPORT TypeConverter<String, base::StringPiece> {
20 public:
21 static String ConvertFrom(const base::StringPiece& input);
22 static base::StringPiece ConvertTo(const String& input);
25 template <>
26 class MOJO_COMMON_EXPORT TypeConverter<String, base::string16> {
27 public:
28 static String ConvertFrom(const base::string16& input);
29 static base::string16 ConvertTo(const String& input);
32 template <>
33 class MOJO_COMMON_EXPORT TypeConverter<String, GURL> {
34 public:
35 static String ConvertFrom(const GURL& input);
36 static GURL ConvertTo(const String& input);
39 } // namespace mojo
41 #endif // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_