Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1809)

Unified Diff: content/browser/renderer_host/text_input_client_message_filter.mm

Issue 1619363002: Add compile time checks against longs being used in IPC structs on 32 bit Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more per Dmitry Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/text_input_client_message_filter.mm
diff --git a/content/browser/renderer_host/text_input_client_message_filter.mm b/content/browser/renderer_host/text_input_client_message_filter.mm
index 34e9467826d3134c310a77d75941a4225ac98356..a1efb2e0b3b8dc3a0c2e68d41763b98c25c3e9a6 100644
--- a/content/browser/renderer_host/text_input_client_message_filter.mm
+++ b/content/browser/renderer_host/text_input_client_message_filter.mm
@@ -48,14 +48,17 @@ void TextInputClientMessageFilter::OnGotStringAtPoint(
service->GetStringAtPointReply(string, NSPointFromCGPoint(point.ToCGPoint()));
}
-void TextInputClientMessageFilter::OnGotCharacterIndexForPoint(size_t index) {
+void TextInputClientMessageFilter::OnGotCharacterIndexForPoint(uint32_t index) {
TextInputClientMac* service = TextInputClientMac::GetInstance();
// |index| could be WTF::notFound (-1) and its value is different from
// NSNotFound so we need to convert it.
- if (index == static_cast<size_t>(-1)) {
- index = NSNotFound;
+ size_t char_index;
+ if (index == static_cast<uint32_t>(-1)) {
+ char_index = NSNotFound;
+ } else {
+ char_index = index;
}
- service->SetCharacterIndexAndSignal(index);
+ service->SetCharacterIndexAndSignal(char_index);
}
void TextInputClientMessageFilter::OnGotFirstRectForRange(

Powered by Google App Engine
This is Rietveld 408576698