Commit a4016d7a authored by stuartmorgan's avatar stuartmorgan Committed by Commit bot

Minor cleanup in ios/web utils

Addresses minor comments from upstreaming ios/web utility code in
a previous CL (<https://codereview.chromium.org/988383002/>)

BUG=None

Review URL: https://codereview.chromium.org/1023013002

Cr-Commit-Position: refs/heads/master@{#321579}
parent b04f6c5c
......@@ -26,7 +26,7 @@
return instance;
}
- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
_groupCounts.reset([[NSMutableDictionary alloc] init]);
......@@ -54,8 +54,7 @@
DCHECK_GT(count, 0U);
}
count += numTasks;
[_groupCounts setObject:[NSNumber numberWithUnsignedInteger:count]
forKey:group];
[_groupCounts setObject:@(count) forKey:group];
_totalCount += numTasks;
if (_totalCount == numTasks) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
......@@ -74,8 +73,7 @@
if (count == 0) {
[_groupCounts removeObjectForKey:group];
} else {
[_groupCounts setObject:[NSNumber numberWithUnsignedInteger:count]
forKey:group];
[_groupCounts setObject:@(count) forKey:group];
}
_totalCount -= numTasks;
if (_totalCount == 0) {
......@@ -111,5 +109,4 @@
return _totalCount;
}
@end
......@@ -5,8 +5,6 @@
#ifndef IOS_WEB_HISTORY_STATE_UTIL_H_
#define IOS_WEB_HISTORY_STATE_UTIL_H_
#import <Foundation/Foundation.h>
#include <string>
class GURL;
......
......@@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Foundation/Foundation.h>
#import "ios/web/history_state_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
#include "url/gurl.h"
......
......@@ -16,7 +16,7 @@ void EncodeString(NSCoder* coder, NSString* key, const std::string& string) {
}
std::string DecodeString(NSCoder* decoder, NSString* key) {
NSUInteger length;
NSUInteger length = 0;
const uint8_t* bytes = [decoder decodeBytesForKey:key returnedLength:&length];
return std::string(reinterpret_cast<const char*>(bytes), length);
}
......
......@@ -13,7 +13,7 @@ BlockedPopupInfo::BlockedPopupInfo(const GURL& url,
: url_(url),
referrer_(referrer),
window_name_([window_name copy]),
show_popup_handler_([show_popup_handler copy]){
show_popup_handler_([show_popup_handler copy]) {
}
BlockedPopupInfo::BlockedPopupInfo(const BlockedPopupInfo& blocked_popup_info)
......
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