Commit 6ac310e8 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Fix ios compilation with newer clang.

Class cannot be used as NSDictionary key.

Bug: 1017213
Change-Id: I1f660792ccf7ab648cf4fcde3be3b5b8a1b8d745
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884671
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710044}
parent bf68e903
...@@ -32,10 +32,13 @@ void RecordDragAndDropContentHistogram(DragContentForReporting sample) { ...@@ -32,10 +32,13 @@ void RecordDragAndDropContentHistogram(DragContentForReporting sample) {
// Records the DragAndDrop.DragContent histogram for a given |dropSession|. // Records the DragAndDrop.DragContent histogram for a given |dropSession|.
void RecordDragTypesForSession(id<UIDropSession> dropSession) void RecordDragTypesForSession(id<UIDropSession> dropSession)
API_AVAILABLE(ios(11.0)) { API_AVAILABLE(ios(11.0)) {
// Map keys must conform to the NSCopying protocol. Class doesn't declare
// that it does this, but Class does implement |copyWithZone:|, so the cast
// is safe.
static NSDictionary* classToSampleNameMap = @{ static NSDictionary* classToSampleNameMap = @{
[UIImage class] : @(DragContentForReporting::IMAGE), (id)[UIImage class] : @(DragContentForReporting::IMAGE),
[NSURL class] : @(DragContentForReporting::URL), (id)[NSURL class] : @(DragContentForReporting::URL),
[NSString class] : @(DragContentForReporting::TEXT) (id)[NSString class] : @(DragContentForReporting::TEXT)
}; };
bool containsAKnownClass = false; bool containsAKnownClass = false;
// Report a histogram for every item contained in |dropSession|. // Report a histogram for every item contained in |dropSession|.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment