diff options
author | jamescook <jamescook@chromium.org> | 2016-03-25 14:28:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 21:29:57 +0000 |
commit | da88c32858fdbc6040b07d51019d9f564e37416e (patch) | |
tree | 8f9aa64cb05eea75406425170c4b02ca171d9eca /ash | |
parent | 0e07a14f1d8515fb5802c03e7c30dfe0bae4a87d (diff) | |
download | chromium_src-da88c32858fdbc6040b07d51019d9f564e37416e.zip chromium_src-da88c32858fdbc6040b07d51019d9f564e37416e.tar.gz chromium_src-da88c32858fdbc6040b07d51019d9f564e37416e.tar.bz2 |
mus: Remove unnecessary const from property TypeConverter templates
This allows them to be used with the idiomatic mojo::ConvertTo<Foo>() template.
(In particular, ConvertTo<Foo>(my_vector) matches my_vector to "const U&" to
determine which TypeConverter to call. If my_vector is either a "std::vector"
or a "const std::vector" it ends up looking for TypeConverter<Foo, std::vector>.
Since the second TypeConverter template parameter isn't const, the compiler
can't find our existing TypeConverter<Foo, const std::vector> functions. These
functions don't need their template parameter to be const std::vector, as they
use "const std::vector&" for their inputs regardless.)
BUG=none
TEST=compiles
Review URL: https://codereview.chromium.org/1832133002
Cr-Commit-Position: refs/heads/master@{#383366}
Diffstat (limited to 'ash')
-rw-r--r-- | ash/mus/shelf_delegate_mus.cc | 3 | ||||
-rw-r--r-- | ash/mus/sysui_application.cc | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/ash/mus/shelf_delegate_mus.cc b/ash/mus/shelf_delegate_mus.cc index 5b06eda..7dbff29 100644 --- a/ash/mus/shelf_delegate_mus.cc +++ b/ash/mus/shelf_delegate_mus.cc @@ -85,8 +85,7 @@ class ShelfItemDelegateMus : public ShelfItemDelegate { gfx::ImageSkia GetShelfIconFromBitmap( const mojo::Array<uint8_t>& serialized_bitmap) { // Convert the data to an ImageSkia. - SkBitmap bitmap = mojo::ConvertTo<SkBitmap, const std::vector<uint8_t>>( - serialized_bitmap.storage()); + SkBitmap bitmap = mojo::ConvertTo<SkBitmap>(serialized_bitmap.storage()); gfx::ImageSkia icon_image; if (!bitmap.isNull()) { icon_image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); diff --git a/ash/mus/sysui_application.cc b/ash/mus/sysui_application.cc index 5fd5aac..9230248 100644 --- a/ash/mus/sysui_application.cc +++ b/ash/mus/sysui_application.cc @@ -131,14 +131,13 @@ class NativeWidgetFactory { mash::wm::mojom::Container container = GetContainerId(params); if (container != mash::wm::mojom::Container::COUNT) { properties[mash::wm::mojom::kWindowContainer_Property] = - mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( + mojo::ConvertTo<std::vector<uint8_t>>( static_cast<int32_t>(container)); } mash::wm::mojom::AshWindowType type = GetAshWindowType(params.parent); if (type != mash::wm::mojom::AshWindowType::COUNT) { properties[mash::wm::mojom::kAshWindowType_Property] = - mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( - static_cast<int32_t>(type)); + mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>(type)); } } |