Use MESSAGE_CHECK in WebPageProxy::loadRecentSearches() and WebPageProxy::saveRecentSearches(). <rdar://problem/59240446>
Created attachment 396830 [details] Patch v1
Comment on attachment 396830 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=396830&action=review > Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:73 > - if (!name) { > - // FIXME: This should be a message check. > - return; > - } > + MESSAGE_CHECK(!name.isNull()); We could also write this like so: MESSAGE_CHECK(!!name); I'm not sure if that is easier to read that !name.isNull().
Comment on attachment 396830 [details] Patch v1 r=me My preference is the "!name.isNull()" style. I think it reads more clearly. Also, "!!" is kind of mind-bending if you haven't seen it before. I believe that the "!!" style originated, especially on Windows, to work around a missing feature in C++ (a safe way to convert to boolean without converting to integer by accident). You can see vestigial remnants of the same issue in WebKit's uses of "UnspecifiedBoolType" (which is even more mind-bending). See also http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2333.html. In the modern C++ world, where operator bool can be made explicit, I believe there is no need to use "!!" anymore.
Committed r260347: <https://trac.webkit.org/changeset/260347> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396830 [details].