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

Unified Diff: chrome/installer/mac/app/OmahaXMLRequest.m

Issue 2094583004: Initial commit for Chrome metainstaller on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fully addressed making the .dmg download asynchronously Created 4 years, 6 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
Index: chrome/installer/mac/app/OmahaXMLRequest.m
diff --git a/chrome/installer/mac/app/OmahaXMLRequest.m b/chrome/installer/mac/app/OmahaXMLRequest.m
new file mode 100644
index 0000000000000000000000000000000000000000..1fbbb03ca3f1f8933974689ec6940a067149cb82
--- /dev/null
+++ b/chrome/installer/mac/app/OmahaXMLRequest.m
@@ -0,0 +1,61 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import <Foundation/Foundation.h>
+#include "OmahaXMLRequest.h"
+
+@implementation OmahaXMLRequest : NSObject
+
+// Boris (borisv) indicated that the OS version, platform, appid, and version
Elly Fong-Jones 2016/07/06 15:22:02 I'd just write "borisv@" here, no need for the fir
+// are the user attributes that Omaha actually looks at. The other parameters
+// are useful for logging purposes but otherwise not directly used.
++ (NSXMLDocument*)createXMLRequestBodyWithOS:(NSString*) operatingSystem
+ andArchitecture:(NSString*) architecture {
+ NSString* protocol = @"3.0";
+ NSString* keystoneVersion = @"KeystoneAgent-1.99.4.0";
+
+ NSString* platform = @"mac";
+ NSString* plat_arch = [NSString stringWithFormat:@"%@_%@", operatingSystem,
+ architecture];
+
+ NSString* appid = @"com.google.Chrome";
+ NSString* version = @"0.0.0.0";
+ NSString* language = @"en-us";
+
+ NSXMLElement* root = [[NSXMLElement alloc] initWithName:@"request"];
+ [root addAttribute:[NSXMLNode attributeWithName:@"protocol"
+ stringValue:protocol]];
+ [root addAttribute:[NSXMLNode attributeWithName:@"version"
+ stringValue:keystoneVersion]];
+
+ NSXMLElement* osChild = [[NSXMLElement alloc] initWithName:@"os"];
+ [osChild addAttribute:[NSXMLNode attributeWithName:@"platform"
+ stringValue:platform]];
+ [osChild addAttribute:[NSXMLNode attributeWithName:@"version"
+ stringValue:operatingSystem]];
+ [osChild addAttribute:[NSXMLNode attributeWithName:@"arch"
+ stringValue:architecture]];
+ [osChild addAttribute:[NSXMLNode attributeWithName:@"sp"
+ stringValue:plat_arch]];
+ [root addChild:osChild];
+
+ NSXMLElement* appChild = [[NSXMLElement alloc] initWithName:@"app"];
+ [appChild addAttribute:[NSXMLNode attributeWithName:@"appid"
+ stringValue:appid]];
+ [appChild addAttribute:[NSXMLNode attributeWithName:@"version"
+ stringValue:version]];
+ [appChild addAttribute:[NSXMLNode attributeWithName:@"lang"
+ stringValue:language]];
+ [root addChild:appChild];
+
+ NSXMLElement* updateChildChild = [[NSXMLElement alloc]
+ initWithName:@"updatecheck"];
+ [appChild addChild:updateChildChild];
+
+ NSXMLDocument* requestXMLDocument = [[NSXMLDocument alloc]
+ initWithRootElement:root];
+ return requestXMLDocument;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698