|
|
DescriptionClipboard buildfix: USE_AURA without TOOLKIT_VIEWS failed to compile.
See: https://codereview.chromium.org/685043002/
R=dcheng@chromium.org,andresantoso@chromium.org
BUG=None
Committed: https://crrev.com/726be5f93e1bb7334368b52bd7f5a977391a89b3
Cr-Commit-Position: refs/heads/master@{#301961}
Patch Set 1 #Patch Set 2 : condition --> !OS_ANDROID #
Messages
Total messages: 17 (1 generated)
Is this broken on the main waterfall, or somewhere else?
On 2014/10/29 20:34:10, dcheng wrote: > Is this broken on the main waterfall, or somewhere else? The Chromecast build is broken. We are still trying to get a trybot. See last comment on https://codereview.chromium.org/685043002/ for error. It can be built with: GYP_GENERATOR_FLAGS="output_dir=out_cast" build/gyp_chromium -Dchromecast=1 && ninja -C out_cast/Debug cast_shell -k500
I think the right fix is to guard the operator< definition with the same #define, no?
On 2014/10/29 20:41:25, dcheng wrote: > I think the right fix is to guard the operator< definition with the same > #define, no? That doesn't fix the problem: other Aura code still uses it. Compile failure with that change: In file included from ../../ui/base/dragdrop/os_exchange_data_provider_aura.cc:5: In file included from ../../ui/base/dragdrop/os_exchange_data_provider_aura.h:8: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/map:60: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_tree.h:63: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_function.h:235:20: error: invalid operands to binary expression ('const ui::Clipboard::FormatType' and 'const ui::Clipboard::FormatType') { return __x < __y; } ~~~ ^ ~~~ /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_map.h:463:22: note: in instantiation of member function 'std::less<ui::Clipboard::FormatType>::operator()' requested here if (__i == end() || key_comp()(__k, (*__i).first)) ^ ../../ui/base/dragdrop/os_exchange_data_provider_aura.cc:78:15: note: in instantiation of member function 'std::__cxx1998::map<ui::Clipboard::FormatType, Pickle, std::less<ui::Clipboard::FormatType>, std::allocator<std::pair<const ui::Clipboard::FormatType, Pickle> > >::operator[]' requested here pickle_data_[format] = data; ^ /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_pair.h:220:5: note: candidate template ignored: could not match 'pair<type-parameter-0-0, type-parameter-0-1>' against 'const ui::Clipboard::FormatType' operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) ^ /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:297:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' operator<(const reverse_iterator<_Iterator>& __x, ^ /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:347:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' operator<(const reverse_iterator<_IteratorL>& __x, ^ /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:1055:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' operator<(const move_iterator<_IteratorL>& __x, ^ /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:1061:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' operator<(const move_iterator<_Iterator>& __x, ^ 1 error generated. I think the operator is still a valid thing to use, in this case to store in a map.
On 2014/10/29 20:48:20, gunsch wrote: > On 2014/10/29 20:41:25, dcheng wrote: > > I think the right fix is to guard the operator< definition with the same > > #define, no? > > That doesn't fix the problem: other Aura code still uses it. Compile failure > with that change: > > In file included from > ../../ui/base/dragdrop/os_exchange_data_provider_aura.cc:5: > In file included from ../../ui/base/dragdrop/os_exchange_data_provider_aura.h:8: > In file included from > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/map:60: > In file included from > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_tree.h:63: > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_function.h:235:20: > error: invalid operands to binary expression ('const ui::Clipboard::FormatType' > and 'const ui::Clipboard::FormatType') > { return __x < __y; } > ~~~ ^ ~~~ > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_map.h:463:22: > note: in instantiation of member function > 'std::less<ui::Clipboard::FormatType>::operator()' requested here > if (__i == end() || key_comp()(__k, (*__i).first)) > ^ > ../../ui/base/dragdrop/os_exchange_data_provider_aura.cc:78:15: note: in > instantiation of member function 'std::__cxx1998::map<ui::Clipboard::FormatType, > Pickle, std::less<ui::Clipboard::FormatType>, std::allocator<std::pair<const > ui::Clipboard::FormatType, Pickle> > >::operator[]' requested here > pickle_data_[format] = data; > ^ > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_pair.h:220:5: > note: candidate template ignored: could not match 'pair<type-parameter-0-0, > type-parameter-0-1>' against 'const ui::Clipboard::FormatType' > operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) > ^ > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:297:5: > note: candidate template ignored: could not match > 'reverse_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > operator<(const reverse_iterator<_Iterator>& __x, > ^ > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:347:5: > note: candidate template ignored: could not match > 'reverse_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > operator<(const reverse_iterator<_IteratorL>& __x, > ^ > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:1055:5: > note: candidate template ignored: could not match > 'move_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > operator<(const move_iterator<_IteratorL>& __x, > ^ > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:1061:5: > note: candidate template ignored: could not match > 'move_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > operator<(const move_iterator<_Iterator>& __x, > ^ > 1 error generated. > > I think the operator is still a valid thing to use, in this case to store in a > map. I think using !defined(OS_ANDROID) in the declaration is simplest and matches the implementations. dcheng@, you still don't like that?
I don't know that I like !OS_ANDROID either---it has the implicit assumption that "!OS_ANDROID == TOOLKIT_VIEWS || USE_AURA", which I don't know is always true. Why make the assumption?
On 2014/10/29 at 20:57:40, andresantoso wrote: > On 2014/10/29 20:48:20, gunsch wrote: > > On 2014/10/29 20:41:25, dcheng wrote: > > > I think the right fix is to guard the operator< definition with the same > > > #define, no? > > > > That doesn't fix the problem: other Aura code still uses it. Compile failure > > with that change: > > > > In file included from > > ../../ui/base/dragdrop/os_exchange_data_provider_aura.cc:5: > > In file included from ../../ui/base/dragdrop/os_exchange_data_provider_aura.h:8: > > In file included from > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/map:60: > > In file included from > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_tree.h:63: > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_function.h:235:20: > > error: invalid operands to binary expression ('const ui::Clipboard::FormatType' > > and 'const ui::Clipboard::FormatType') > > { return __x < __y; } > > ~~~ ^ ~~~ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_map.h:463:22: > > note: in instantiation of member function > > 'std::less<ui::Clipboard::FormatType>::operator()' requested here > > if (__i == end() || key_comp()(__k, (*__i).first)) > > ^ > > ../../ui/base/dragdrop/os_exchange_data_provider_aura.cc:78:15: note: in > > instantiation of member function 'std::__cxx1998::map<ui::Clipboard::FormatType, > > Pickle, std::less<ui::Clipboard::FormatType>, std::allocator<std::pair<const > > ui::Clipboard::FormatType, Pickle> > >::operator[]' requested here > > pickle_data_[format] = data; > > ^ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_pair.h:220:5: > > note: candidate template ignored: could not match 'pair<type-parameter-0-0, > > type-parameter-0-1>' against 'const ui::Clipboard::FormatType' > > operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) > > ^ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:297:5: > > note: candidate template ignored: could not match > > 'reverse_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > > operator<(const reverse_iterator<_Iterator>& __x, > > ^ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:347:5: > > note: candidate template ignored: could not match > > 'reverse_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > > operator<(const reverse_iterator<_IteratorL>& __x, > > ^ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:1055:5: > > note: candidate template ignored: could not match > > 'move_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > > operator<(const move_iterator<_IteratorL>& __x, > > ^ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator.h:1061:5: > > note: candidate template ignored: could not match > > 'move_iterator<type-parameter-0-0>' against 'const ui::Clipboard::FormatType' > > operator<(const move_iterator<_Iterator>& __x, > > ^ > > 1 error generated. > > > > I think the operator is still a valid thing to use, in this case to store in a > > map. > > > I think using !defined(OS_ANDROID) in the declaration is simplest and matches the implementations. > dcheng@, you still don't like that? Yeah let's just do that. I was hoping to make it clear what conditions this operator was actually needed, but that seems more trouble than it's worth.
On 2014/10/29 21:00:11, gunsch wrote: > I don't know that I like !OS_ANDROID either---it has the implicit assumption > that "!OS_ANDROID == TOOLKIT_VIEWS || USE_AURA", which I don't know is always > true. Why make the assumption? Because clipboard_android.cc does not implement it, while all the other clipboard implementations do.
On 2014/10/29 at 21:00:11, gunsch wrote: > I don't know that I like !OS_ANDROID either---it has the implicit assumption that "!OS_ANDROID == TOOLKIT_VIEWS || USE_AURA", which I don't know is always true. Why make the assumption? Like Andre pointed out, Android is the only platform that doesn't define this operator.
On 2014/10/29 21:01:28, dcheng wrote: > On 2014/10/29 at 21:00:11, gunsch wrote: > > I don't know that I like !OS_ANDROID either---it has the implicit assumption > that "!OS_ANDROID == TOOLKIT_VIEWS || USE_AURA", which I don't know is always > true. Why make the assumption? > > Like Andre pointed out, Android is the only platform that doesn't define this > operator. Don't forget to remove the #if defined(TOOLKIT_VIEWS) from clipboard_mac if you go this route (using !ANDROID).
PTAL
lgtm
The CQ bit was checked by gunsch@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/687293003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/726be5f93e1bb7334368b52bd7f5a977391a89b3 Cr-Commit-Position: refs/heads/master@{#301961} |