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

Unified Diff: ios/chrome/browser/omaha/omaha_service.mm

Issue 2893523003: [ObjC ARC] Converts ios/chrome/browser/omaha:omaha to ARC. (Closed)
Patch Set: Created 3 years, 7 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 | « ios/chrome/browser/omaha/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/omaha/omaha_service.mm
diff --git a/ios/chrome/browser/omaha/omaha_service.mm b/ios/chrome/browser/omaha/omaha_service.mm
index c3bdf60bd2d98392be6ea52990875353e3cb8e5d..2c4b0e7a9110190406ff863b449c3eb1e4210fe1 100644
--- a/ios/chrome/browser/omaha/omaha_service.mm
+++ b/ios/chrome/browser/omaha/omaha_service.mm
@@ -13,7 +13,6 @@
#include "base/i18n/time_formatting.h"
#include "base/ios/device_util.h"
#include "base/logging.h"
-#include "base/mac/scoped_nsobject.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial.h"
#include "base/rand_util.h"
@@ -44,6 +43,10 @@
#include "net/url_request/url_fetcher.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Number of hours to wait between successful requests.
const int kHoursBetweenRequests = 5;
@@ -127,7 +130,7 @@ @interface ResponseParser : NSObject<NSXMLParserDelegate> {
BOOL manifestIsParsed_;
BOOL pingIsParsed_;
BOOL eventIsParsed_;
- base::scoped_nsobject<NSString> appId_;
+ NSString* appId_;
std::unique_ptr<UpgradeRecommendedDetails> updateInformation_;
}
@@ -148,7 +151,7 @@ @implementation ResponseParser
- (instancetype)initWithAppId:(NSString*)appId {
if (self = [super init]) {
- appId_.reset([appId retain]);
+ appId_ = appId;
}
return self;
}
@@ -596,14 +599,13 @@ GURL url(ios::GetChromeBrowserProvider()
bool result = fetcher->GetResponseAsString(&response);
DCHECK(result);
NSData* xml = [NSData dataWithBytes:response.data() length:response.length()];
- base::scoped_nsobject<NSXMLParser> parser(
- [[NSXMLParser alloc] initWithData:xml]);
+ NSXMLParser* parser = [[NSXMLParser alloc] initWithData:xml];
const std::string application_id = ios::GetChromeBrowserProvider()
->GetOmahaServiceProvider()
->GetApplicationID();
- base::scoped_nsobject<ResponseParser> delegate([[ResponseParser alloc]
- initWithAppId:base::SysUTF8ToNSString(application_id)]);
- parser.get().delegate = delegate.get();
+ ResponseParser* delegate = [[ResponseParser alloc]
+ initWithAppId:base::SysUTF8ToNSString(application_id)];
+ parser.delegate = delegate;
if (![parser parse] || ![delegate isCorrect]) {
DLOG(ERROR) << "Unable to parse XML response from Omaha server.";
@@ -627,8 +629,7 @@ GURL url(ios::GetChromeBrowserProvider()
SendOrScheduleNextPing();
// Send notification for updates if needed.
- UpgradeRecommendedDetails* details =
- [delegate.get() upgradeRecommendedDetails];
+ UpgradeRecommendedDetails* details = [delegate upgradeRecommendedDetails];
if (details) {
web::WebThread::PostTask(
web::WebThread::UI, FROM_HERE,
« no previous file with comments | « ios/chrome/browser/omaha/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698