| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "android_webview/native/aw_contents_io_thread_client_impl.h" | 5 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "android_webview/common/devtools_instrumentation.h" | 10 #include "android_webview/common/devtools_instrumentation.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 459 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 460 if (java_object_.is_null()) | 460 if (java_object_.is_null()) |
| 461 return; | 461 return; |
| 462 | 462 |
| 463 JNIEnv* env = AttachCurrentThread(); | 463 JNIEnv* env = AttachCurrentThread(); |
| 464 WebResourceRequest web_request(env, request); | 464 WebResourceRequest web_request(env, request); |
| 465 | 465 |
| 466 vector<string> response_header_names; | 466 vector<string> response_header_names; |
| 467 vector<string> response_header_values; | 467 vector<string> response_header_values; |
| 468 { | 468 { |
| 469 void* headers_iterator = NULL; | 469 size_t headers_iterator = 0; |
| 470 string header_name, header_value; | 470 string header_name, header_value; |
| 471 while (response_headers->EnumerateHeaderLines( | 471 while (response_headers->EnumerateHeaderLines( |
| 472 &headers_iterator, &header_name, &header_value)) { | 472 headers_iterator, &header_name, &header_value)) { |
| 473 response_header_names.push_back(header_name); | 473 response_header_names.push_back(header_name); |
| 474 response_header_values.push_back(header_value); | 474 response_header_values.push_back(header_value); |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 string mime_type, encoding; | 478 string mime_type, encoding; |
| 479 response_headers->GetMimeTypeAndCharset(&mime_type, &encoding); | 479 response_headers->GetMimeTypeAndCharset(&mime_type, &encoding); |
| 480 ScopedJavaLocalRef<jstring> jstring_mime_type = | 480 ScopedJavaLocalRef<jstring> jstring_mime_type = |
| 481 ConvertUTF8ToJavaString(env, mime_type); | 481 ConvertUTF8ToJavaString(env, mime_type); |
| 482 ScopedJavaLocalRef<jstring> jstring_encoding = | 482 ScopedJavaLocalRef<jstring> jstring_encoding = |
| (...skipping 21 matching lines...) Expand all Loading... |
| 504 jstring_reason.obj(), | 504 jstring_reason.obj(), |
| 505 jstringArray_response_header_names.obj(), | 505 jstringArray_response_header_names.obj(), |
| 506 jstringArray_response_header_values.obj()); | 506 jstringArray_response_header_values.obj()); |
| 507 } | 507 } |
| 508 | 508 |
| 509 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env) { | 509 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env) { |
| 510 return RegisterNativesImpl(env); | 510 return RegisterNativesImpl(env); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace android_webview | 513 } // namespace android_webview |
| OLD | NEW |