summaryrefslogtreecommitdiffstats
path: root/components/cronet/android
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 16:12:06 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 16:12:06 +0000
commit3030374e345652de06eecbf954d8b0e212c16f56 (patch)
tree42e28456b62d0abc668d8e8bff52f9a431942a31 /components/cronet/android
parent7e29ff1b73c7be6c2716b87374f1c2aae4ab2bf5 (diff)
downloadchromium_src-3030374e345652de06eecbf954d8b0e212c16f56.zip
chromium_src-3030374e345652de06eecbf954d8b0e212c16f56.tar.gz
chromium_src-3030374e345652de06eecbf954d8b0e212c16f56.tar.bz2
Remove redundant mapping of net errors to strings.
The new list does not have the leading "net::ERR_", to slightly reduce the size of net when compiled. This reduces the size of libcronet.so by about 8k, with symbols stripped. Also add a function to get network error strings without the leading, "net::" as a number of consumers were removing it with duplicated code. This CL slight breaks NetLog loading functionality - loading old logs in new versions will result in error codes missing the leading "ERR_", and the other direction results in error codes having an extra leading "ERR_". BUG=399025 Review URL: https://codereview.chromium.org/432553003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/cronet/android')
-rw-r--r--components/cronet/android/org_chromium_net_UrlRequest.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/cronet/android/org_chromium_net_UrlRequest.cc b/components/cronet/android/org_chromium_net_UrlRequest.cc
index 8ec8b7a..836f016 100644
--- a/components/cronet/android/org_chromium_net_UrlRequest.cc
+++ b/components/cronet/android/org_chromium_net_UrlRequest.cc
@@ -252,10 +252,11 @@ static jstring GetErrorString(JNIEnv* env,
URLRequestPeer* request = reinterpret_cast<URLRequestPeer*>(urlRequestPeer);
int error_code = request->error_code();
char buffer[200];
+ std::string error_string = net::ErrorToString(error_code);
snprintf(buffer,
sizeof(buffer),
"System error: %s(%d)",
- net::ErrorToString(error_code),
+ error_string.c_str(),
error_code);
return ConvertUTF8ToJavaString(env, buffer).Release();
}