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