| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/net/http_protocol_logging.h" | 5 #include "ios/net/http_protocol_logging.h" |
| 6 | 6 |
| 7 #include <Foundation/Foundation.h> | 7 #include <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| 11 #import "ios/net/url_scheme_util.h" | 11 #import "ios/net/url_scheme_util.h" |
| 12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." |
| 15 #endif |
| 16 |
| 13 namespace { | 17 namespace { |
| 14 const unsigned int kMaxUrlLength = 100; | 18 const unsigned int kMaxUrlLength = 100; |
| 15 } | 19 } |
| 16 | 20 |
| 17 namespace net { | 21 namespace net { |
| 18 | 22 |
| 19 void LogNSURLRequest(NSURLRequest* request) { | 23 void LogNSURLRequest(NSURLRequest* request) { |
| 20 DVLOG_IF(2, UrlHasDataScheme([request URL]) && | 24 DVLOG_IF(2, UrlHasDataScheme([request URL]) && |
| 21 [[[request URL] absoluteString] length] > kMaxUrlLength) | 25 [[[request URL] absoluteString] length] > kMaxUrlLength) |
| 22 << "Request (data scheme) " | 26 << "Request (data scheme) " |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 72 |
| 69 DVLOG_IF(2, [response isKindOfClass:[NSHTTPURLResponse class]]) | 73 DVLOG_IF(2, [response isKindOfClass:[NSHTTPURLResponse class]]) |
| 70 << "Response code: " << [(NSHTTPURLResponse*)response statusCode]; | 74 << "Response code: " << [(NSHTTPURLResponse*)response statusCode]; |
| 71 | 75 |
| 72 DVLOG_IF(2, [response textEncodingName]) | 76 DVLOG_IF(2, [response textEncodingName]) |
| 73 << "Text encoding: " | 77 << "Text encoding: " |
| 74 << base::SysNSStringToUTF8([response textEncodingName]); | 78 << base::SysNSStringToUTF8([response textEncodingName]); |
| 75 } | 79 } |
| 76 | 80 |
| 77 } // namespace http_protocol_logging | 81 } // namespace http_protocol_logging |
| OLD | NEW |