RESOLVED FIXED 130376
[WK2] Pass ranges over IPC in a cross-platform manner
https://bugs.webkit.org/show_bug.cgi?id=130376
Summary [WK2] Pass ranges over IPC in a cross-platform manner
Alexey Proskuryakov
Reported 2014-03-17 18:00:34 PDT
Ranges are passed as a pair of uint64_t numbers over IPC, and we pass NSNotFound as is. This is unfortunate in many ways: 1. Code that is otherwise cross-platform becomes Objective-C only because of NSNotFound. 2. We sometimes get NSNotFound confused with WTF::notFound, which has a different numeric value. All cross-platform code like TextIterator::getLocationAndLengthFromRange uses notFound, but we never convert it to NSNotFound when returning over API boundary. 3. Argument lists get longer than they need to be.
Attachments
proposed patch (50.79 KB, patch)
2014-03-17 18:03 PDT, Alexey Proskuryakov
andersca: review+
Alexey Proskuryakov
Comment 1 2014-03-17 18:03:45 PDT
Created attachment 226991 [details] proposed patch
WebKit Commit Bot
Comment 2 2014-03-17 18:05:38 PDT
Attachment 226991 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/EditingRange.h:64: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Total errors found: 1 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alexey Proskuryakov
Comment 3 2014-03-18 09:55:06 PDT
Comment on attachment 226991 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=226991&action=review > Source/WebKit2/Shared/EditingRange.h:67 > + if (location != NSNotFound) > + return NSMakeRange(location, length); > + else > + return NSMakeRange(NSNotFound, 0); if (location == notFound) return NSMakeRange(NSNotFound, 0); return NSMakeRange(location, length);
Alexey Proskuryakov
Comment 4 2014-03-18 11:14:25 PDT
Note You need to log in before you can comment on or make changes to this bug.