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

Unified Diff: ios/chrome/common/physical_web/physical_web_request.mm

Issue 2413923002: Enable lost URL detection in the Physical Web scanner (Closed)
Patch Set: fixes Created 4 years, 2 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: ios/chrome/common/physical_web/physical_web_request.mm
diff --git a/ios/chrome/common/physical_web/physical_web_request.mm b/ios/chrome/common/physical_web/physical_web_request.mm
index 15e2a207149a5a891d0c8284b5e3279271cc5e72..e6d89e47ae77615028b44e26cb652856f1be2f15 100644
--- a/ios/chrome/common/physical_web/physical_web_request.mm
+++ b/ios/chrome/common/physical_web/physical_web_request.mm
@@ -73,6 +73,10 @@ std::string GetUserAgent() {
return nil;
}
+- (NSURL*)requestURL {
+ return [device_ requestURL];
+}
+
- (void)cancel {
[urlSessionTask_ cancel];
block_.reset();
@@ -96,7 +100,7 @@ std::string GetUserAgent() {
// body of the POST request.
NSDictionary* jsonBody =
- @{ kUrlsKey : @[ @{kUrlKey : [[device_ url] absoluteString]} ] };
+ @{ kUrlsKey : @[ @{kUrlKey : [[device_ requestURL] absoluteString]} ] };
[request_ setHTTPBody:[NSJSONSerialization dataWithJSONObject:jsonBody
options:0
error:NULL]];
@@ -232,20 +236,19 @@ std::string GetUserAgent() {
NSString* description =
base::mac::ObjCCast<NSString>(pageInfo[kDescriptionKey]);
NSString* title = base::mac::ObjCCast<NSString>(pageInfo[kTitleKey]);
- NSURL* scannedUrl =
- scannedUrlString ? [NSURL URLWithString:scannedUrlString] : nil;
NSURL* resolvedUrl =
resolvedUrlString ? [NSURL URLWithString:resolvedUrlString] : nil;
NSURL* icon = iconString ? [NSURL URLWithString:iconString] : nil;
base::scoped_nsobject<PhysicalWebDevice> device([[PhysicalWebDevice alloc]
initWithURL:resolvedUrl
- requestURL:scannedUrl
+ requestURL:[device_ requestURL]
icon:icon
title:title
description:description
transmitPower:[device_ transmitPower]
rssi:[device_ rssi]
- rank:physical_web::kMaxRank]);
+ rank:physical_web::kMaxRank
+ scanTimestamp:[device_ scanTimestamp]]);
if (block_.get() != nil) {
block_.get()(device, nil);
}
« no previous file with comments | « ios/chrome/common/physical_web/physical_web_request.h ('k') | ios/chrome/common/physical_web/physical_web_scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698