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

Side by Side Diff: android_webview/native/aw_web_resource_response_impl.cc

Issue 337473004: aw: Use comparison DCHECKs where appropriate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « android_webview/native/aw_settings.cc ('k') | android_webview/native/input_stream_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_web_resource_response_impl.h" 5 #include "android_webview/native/aw_web_resource_response_impl.h"
6 6
7 #include "android_webview/native/input_stream_impl.h" 7 #include "android_webview/native/input_stream_impl.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 Java_AwWebResourceResponse_getResponseHeaderValues(env, 80 Java_AwWebResourceResponse_getResponseHeaderValues(env,
81 java_object_.obj()); 81 java_object_.obj());
82 if (jstringArray_headerNames.is_null() || jstringArray_headerValues.is_null()) 82 if (jstringArray_headerNames.is_null() || jstringArray_headerValues.is_null())
83 return false; 83 return false;
84 std::vector<std::string> header_names; 84 std::vector<std::string> header_names;
85 std::vector<std::string> header_values; 85 std::vector<std::string> header_values;
86 AppendJavaStringArrayToStringVector( 86 AppendJavaStringArrayToStringVector(
87 env, jstringArray_headerNames.obj(), &header_names); 87 env, jstringArray_headerNames.obj(), &header_names);
88 AppendJavaStringArrayToStringVector( 88 AppendJavaStringArrayToStringVector(
89 env, jstringArray_headerValues.obj(), &header_values); 89 env, jstringArray_headerValues.obj(), &header_values);
90 DCHECK(header_names.size() == header_values.size()); 90 DCHECK_EQ(header_values.size(), header_names.size());
91 for(size_t i = 0; i < header_names.size(); ++i) { 91 for(size_t i = 0; i < header_names.size(); ++i) {
92 std::string header_line(header_names[i]); 92 std::string header_line(header_names[i]);
93 header_line.append(": "); 93 header_line.append(": ");
94 header_line.append(header_values[i]); 94 header_line.append(header_values[i]);
95 headers->AddHeader(header_line); 95 headers->AddHeader(header_line);
96 } 96 }
97 return true; 97 return true;
98 } 98 }
99 99
100 bool RegisterAwWebResourceResponse(JNIEnv* env) { 100 bool RegisterAwWebResourceResponse(JNIEnv* env) {
101 return RegisterNativesImpl(env); 101 return RegisterNativesImpl(env);
102 } 102 }
103 103
104 } // namespace android_webview 104 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_settings.cc ('k') | android_webview/native/input_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698