blob: f09b7b52bd5e9cd514bd5ff04f47cb5facd1e536 [file] [log] [blame]
// Copyright 2014 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.
#include "ios/net/nsurlrequest_util.h"
#include "base/strings/stringprintf.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
namespace net {
std::string FormatUrlRequestForLogging(NSURLRequest* request) {
NSString* urlAbsoluteString = request.URL.absoluteString;
NSString* mainDocumentURLAbsoluteString =
return base::StringPrintf(
"request: %s request.mainDocURL: %s",
urlAbsoluteString ? urlAbsoluteString.UTF8String : "[nil]",
mainDocumentURLAbsoluteString ?
mainDocumentURLAbsoluteString.UTF8String : "[nil]");
} // namespace net