lindenlab/desura-cef3 — pull request #9 by nat-goodspeed (2014-04-28 17:10:03+00:00)
Title: Small fixes for clang errors; set strings more generically.

The previous convention in Desura wrapper code was to call
cef_string_utf8_to_utf16() to set a cef_string_t field in a struct such as
CefWindowInfo. The problem there is that cef_string_t is not always
cef_string_utf16_t. Introduce setCefString() to call cef_string_from_utf8(),
which is aliased to cef_string_utf8_to_utf16() when cef_string_t IS
cef_string_utf16_t, or to cef_string_utf8_copy() when it's cef_string_utf8_t.
Also added cefSetString() overloads to catch the case in which the source is a
const char[] array (e.g. a "string literal") versus a const char* (C-style
string param): for that case we call cef_string_from_ascii(), on the plausible
assumption that we're not really likely to put UTF8 strings in "string
literals" in the C++ source code.

Several classes include a virtual void destroy() { delete this; } method.
Although the point of these destroy() methods is in fact to ensure that
'delete' sees the correct leaf class, those 'delete's, combined with the
presence of at least one virtual method, are enough to make clang require a
virtual destructor as well. Shrug -- since we're already defining virtual
methods, the incremental cost of adding a virtual destructor is negligible.

ChromiumRenderer declares and sets a couple data members, but never again
references them. This produces a clang error. Comment out these members and
their initializers in case we come up with a use case.

clang produces a "fatal warning" when your constructor's initializer list
enumerates members other than in declaration order. Reorder a couple such
initializer lists.

ChromiumBrowserEvents.h #defines OVERRIDE -- which sometimes happens already to
be defined. When it is, #undef it before redefining.

clang also complains about a source file that doesn't end in newline. Add one.