| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/public/cpp/bindings/string_traits_wtf.h" | 5 #include "mojo/public/cpp/bindings/string_traits_wtf.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 10 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
| 11 #include "third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h" | 11 #include "third_party/WebKit/Source/platform/wtf/text/StringUTF8Adaptor.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 struct UTF8AdaptorInfo { | 16 struct UTF8AdaptorInfo { |
| 17 explicit UTF8AdaptorInfo(const WTF::String& input) : utf8_adaptor(input) { | 17 explicit UTF8AdaptorInfo(const WTF::String& input) : utf8_adaptor(input) { |
| 18 #if DCHECK_IS_ON() | 18 #if DCHECK_IS_ON() |
| 19 original_size_in_bytes = input.CharactersSizeInBytes(); | 19 original_size_in_bytes = input.CharactersSizeInBytes(); |
| 20 #endif | 20 #endif |
| 21 } | 21 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 // static | 76 // static |
| 77 bool StringTraits<WTF::String>::Read(StringDataView input, | 77 bool StringTraits<WTF::String>::Read(StringDataView input, |
| 78 WTF::String* output) { | 78 WTF::String* output) { |
| 79 WTF::String result = WTF::String::FromUTF8(input.storage(), input.size()); | 79 WTF::String result = WTF::String::FromUTF8(input.storage(), input.size()); |
| 80 output->Swap(result); | 80 output->Swap(result); |
| 81 return true; | 81 return true; |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace mojo | 84 } // namespace mojo |
| OLD | NEW |