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

Side by Side Diff: ios/showcase/common/protocol_alerter.mm

Issue 2778343002: [Payment Request] Picker view + showcase integration + egtests (Closed)
Patch Set: Addressed comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/showcase/common/protocol_alerter.h" 5 #import "ios/showcase/common/protocol_alerter.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 8
9 #import "base/logging.h" 9 #import "base/logging.h"
10 #import "base/strings/sys_string_conversions.h" 10 #import "base/strings/sys_string_conversions.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return [self longLongDescriptionAtIndex:index]; 163 return [self longLongDescriptionAtIndex:index];
164 // Add cases as needed here. 164 // Add cases as needed here.
165 default: 165 default:
166 return [NSString stringWithFormat:@"<Unknown Type:%s>", type]; 166 return [NSString stringWithFormat:@"<Unknown Type:%s>", type];
167 } 167 }
168 } 168 }
169 169
170 // Return a string describing an argument at |index| that's known to be an 170 // Return a string describing an argument at |index| that's known to be an
171 // objective-C object. 171 // objective-C object.
172 - (NSString*)objectDescriptionAtIndex:(NSInteger)index { 172 - (NSString*)objectDescriptionAtIndex:(NSInteger)index {
173 id object; 173 __weak id object;
Moe 2017/03/29 17:04:09 without this the alerter deallocates the object ar
lpromero 2017/04/03 16:41:41 Indeed: http://stackoverflow.com/a/16932813 But pl
Moe 2017/04/05 05:09:49 Done.
174 174
175 [self getArgument:&object atIndex:index]; 175 [self getArgument:&object atIndex:index];
176 if (!object) 176 if (!object)
177 return @"nil"; 177 return @"nil";
178 178
179 NSString* description = [object description]; 179 NSString* description = [object description];
180 NSString* className = NSStringFromClass([object class]); 180 NSString* className = NSStringFromClass([object class]);
181 if (!description) { 181 if (!description) {
182 return 182 return
183 [NSString stringWithFormat:@"<%@ object, no description>", className]; 183 [NSString stringWithFormat:@"<%@ object, no description>", className];
(...skipping 20 matching lines...) Expand all
204 // Returns a string describing an argument at |index| that is known to be a long 204 // Returns a string describing an argument at |index| that is known to be a long
205 // long. 205 // long.
206 - (NSString*)longLongDescriptionAtIndex:(NSInteger)index { 206 - (NSString*)longLongDescriptionAtIndex:(NSInteger)index {
207 long long value; 207 long long value;
208 208
209 [self getArgument:&value atIndex:index]; 209 [self getArgument:&value atIndex:index];
210 return [NSString stringWithFormat:@"%lld", value]; 210 return [NSString stringWithFormat:@"%lld", value];
211 } 211 }
212 212
213 @end 213 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698