Disable signin-to-Chrome when using Guest profile.
[chromium-blink-merge.git] / mojo / common / common_type_converters.cc
blobf02be67d52f468b552ec925965cec762d0c47a73
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 #include "mojo/common/common_type_converters.h"
7 namespace mojo {
9 // static
10 String TypeConverter<String, base::StringPiece>::ConvertFrom(
11 const base::StringPiece& input,
12 Buffer* buf) {
13 String::Builder result(input.size(), buf);
14 memcpy(&result[0], input.data(), input.size());
15 return result.Finish();
17 // static
18 base::StringPiece TypeConverter<String, base::StringPiece>::ConvertTo(
19 const String& input) {
20 return input.is_null() ? base::StringPiece() :
21 base::StringPiece(&input[0], input.size());
24 } // namespace mojo