blob: ceef8f7a64c6f24ee9514b0159695972c7595bc8 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/strings/string16.h"
#include "mojo/public/cpp/bindings/bindings_export.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/string_traits.h"
namespace mojo {
template <>
struct MOJO_CPP_BINDINGS_EXPORT StringTraits<base::string16> {
static bool IsNull(const base::string16& input) {
// base::string16 is always converted to non-null mojom string.
return false;
static void SetToNull(base::string16* output) {
// Convert null to an "empty" base::string16.
static void* SetUpContext(const base::string16& input);
static void TearDownContext(const base::string16& input, void* context);
static size_t GetSize(const base::string16& input, void* context);
static const char* GetData(const base::string16& input, void* context);
static bool Read(StringDataView input, base::string16* output);
} // namespace mojo