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

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

Issue 11090003: [Android] Upstream WebView.allow{Content|File}Access implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments in AwSettings.java Created 8 years, 2 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
OLDNEW
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/native/intercepted_request_data.h" 10 #include "android_webview/native/intercepted_request_data.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 ConvertUTF8ToJavaString(env, request->url().spec()); 187 ConvertUTF8ToJavaString(env, request->url().spec());
188 ScopedJavaLocalRef<jobject> ret = 188 ScopedJavaLocalRef<jobject> ret =
189 Java_AwContentsIoThreadClient_shouldInterceptRequest( 189 Java_AwContentsIoThreadClient_shouldInterceptRequest(
190 env, java_object_.obj(), jstring_url.obj()); 190 env, java_object_.obj(), jstring_url.obj());
191 if (ret.is_null()) 191 if (ret.is_null())
192 return scoped_ptr<InterceptedRequestData>(); 192 return scoped_ptr<InterceptedRequestData>();
193 return scoped_ptr<InterceptedRequestData>( 193 return scoped_ptr<InterceptedRequestData>(
194 new InterceptedRequestData(ret)); 194 new InterceptedRequestData(ret));
195 } 195 }
196 196
197 bool AwContentsIoThreadClientImpl::ShouldBlockContentUrls() const {
198 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
199 if (java_object_.is_null())
200 return false;
201
202 JNIEnv* env = AttachCurrentThread();
203 return Java_AwContentsIoThreadClient_shouldBlockContentUrls(
204 env, java_object_.obj());
205 }
206
207 bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const {
208 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
209 if (java_object_.is_null())
210 return false;
211
212 JNIEnv* env = AttachCurrentThread();
213 return Java_AwContentsIoThreadClient_shouldBlockFileUrls(
214 env, java_object_.obj());
215 }
216
197 bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const { 217 bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const {
198 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
199 if (java_object_.is_null()) 219 if (java_object_.is_null())
200 return false; 220 return false;
201 221
202 JNIEnv* env = AttachCurrentThread(); 222 JNIEnv* env = AttachCurrentThread();
203 return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads( 223 return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads(
204 env, java_object_.obj()); 224 env, java_object_.obj());
205 } 225 }
206 226
207 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env) { 227 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env) {
208 return RegisterNativesImpl(env); 228 return RegisterNativesImpl(env);
209 } 229 }
210 230
211 } // namespace android_webview 231 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698