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

Unified Diff: components/open_from_clipboard/clipboard_recent_content_ios.mm

Issue 2434473005: Use SysNSStringToUTF8 instead of UTF8String in recent clipboard. (Closed)
Patch Set: use SysNSStringToUTF8 Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/open_from_clipboard/clipboard_recent_content_ios.mm
diff --git a/components/open_from_clipboard/clipboard_recent_content_ios.mm b/components/open_from_clipboard/clipboard_recent_content_ios.mm
index c7f7c81857d8bad3834807e94c7cf21149eb83f0..0ef8e97124dfac6e7a593f981902839c67878ac0 100644
--- a/components/open_from_clipboard/clipboard_recent_content_ios.mm
+++ b/components/open_from_clipboard/clipboard_recent_content_ios.mm
@@ -98,7 +98,8 @@ const char* kAuthorizedSchemes[] = {
// having copied a given string.
NSData* WeakMD5FromNSString(NSString* string) {
unsigned char hash[CC_MD5_DIGEST_LENGTH];
- const char* c_string = [string UTF8String];
+ const std::string clipboard = base::SysNSStringToUTF8(string);
+ const char* c_string = clipboard.c_str();
CC_MD5(c_string, strlen(c_string), hash);
NSData* data = [NSData dataWithBytes:hash length:4];
return data;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698