Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: components/html_viewer/blink_basic_type_converters.cc

Issue 1677293002: Bye bye Mandoline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/html_viewer/blink_basic_type_converters.cc
diff --git a/components/html_viewer/blink_basic_type_converters.cc b/components/html_viewer/blink_basic_type_converters.cc
deleted file mode 100644
index 8d5c32980d359eef9ed6bf7364b00b14d65f58e9..0000000000000000000000000000000000000000
--- a/components/html_viewer/blink_basic_type_converters.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 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 "components/html_viewer/blink_basic_type_converters.h"
-
-#include "mojo/public/cpp/bindings/string.h"
-#include "third_party/WebKit/public/platform/WebRect.h"
-#include "third_party/WebKit/public/platform/WebString.h"
-
-using blink::WebRect;
-using blink::WebString;
-
-namespace mojo {
-
-// static
-String TypeConverter<String, WebString>::Convert(const WebString& str) {
- return String(str.utf8());
-}
-
-// static
-WebString TypeConverter<WebString, String>::Convert(const String& str) {
- return WebString::fromUTF8(str.get());
-}
-
-// static
-WebString TypeConverter<WebString, Array<uint8_t>>::Convert(
- const Array<uint8_t>& input) {
- static_assert(sizeof(uint8_t) == sizeof(char),
- "uint8_t must be the same size as a char");
- return input.is_null()
- ? WebString()
- : WebString::fromUTF8(
- reinterpret_cast<const char*>(&input.front()), input.size());
-}
-
-// static
-RectPtr TypeConverter<RectPtr, WebRect>::Convert(const WebRect& input) {
- RectPtr result(Rect::New());
- result->x = input.x;
- result->y = input.y;
- result->width = input.width;
- result->height = input.height;
- return result;
-};
-
-// static
-Array<uint8_t> TypeConverter<Array<uint8_t>, WebString>::Convert(
- const WebString& input) {
- if (input.isNull())
- return Array<uint8_t>();
- const std::string utf8 = input.utf8();
- Array<uint8_t> result(utf8.size());
- static_assert(sizeof(uint8_t) == sizeof(char),
- "uint8_t must be the same size as an unsigned char");
- memcpy(&result.front(), utf8.data(), utf8.size());
- return result;
-}
-
-} // namespace mojo
« no previous file with comments | « components/html_viewer/blink_basic_type_converters.h ('k') | components/html_viewer/blink_find_type_converters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698