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

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

Issue 11419093: [Android WebView] Implement WebSettings.{get|set}CacheMode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged after the last changes Created 8 years, 1 month 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_contents_io_thread_client_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_impl.h" 10 #include "android_webview/native/intercepted_request_data_impl.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 AwContentsIoThreadClientImpl::AwContentsIoThreadClientImpl( 170 AwContentsIoThreadClientImpl::AwContentsIoThreadClientImpl(
171 const JavaRef<jobject>& obj) 171 const JavaRef<jobject>& obj)
172 : java_object_(obj) { 172 : java_object_(obj) {
173 } 173 }
174 174
175 AwContentsIoThreadClientImpl::~AwContentsIoThreadClientImpl() { 175 AwContentsIoThreadClientImpl::~AwContentsIoThreadClientImpl() {
176 // explict, out-of-line destructor. 176 // explict, out-of-line destructor.
177 } 177 }
178 178
179 AwContentsIoThreadClient::CacheMode
180 AwContentsIoThreadClientImpl::GetCacheMode() const {
181 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
182 if (java_object_.is_null())
183 return AwContentsIoThreadClient::LOAD_DEFAULT;
184
185 JNIEnv* env = AttachCurrentThread();
186 return static_cast<AwContentsIoThreadClient::CacheMode>(
187 Java_AwContentsIoThreadClient_getCacheMode(
188 env, java_object_.obj()));
189 }
190
179 scoped_ptr<InterceptedRequestData> 191 scoped_ptr<InterceptedRequestData>
180 AwContentsIoThreadClientImpl::ShouldInterceptRequest( 192 AwContentsIoThreadClientImpl::ShouldInterceptRequest(
181 const GURL& location, 193 const GURL& location,
182 const net::URLRequest* request) { 194 const net::URLRequest* request) {
183 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
184 if (java_object_.is_null()) 196 if (java_object_.is_null())
185 return scoped_ptr<InterceptedRequestData>(); 197 return scoped_ptr<InterceptedRequestData>();
186 198
187 JNIEnv* env = AttachCurrentThread(); 199 JNIEnv* env = AttachCurrentThread();
188 ScopedJavaLocalRef<jstring> jstring_url = 200 ScopedJavaLocalRef<jstring> jstring_url =
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 JNIEnv* env = AttachCurrentThread(); 236 JNIEnv* env = AttachCurrentThread();
225 return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads( 237 return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads(
226 env, java_object_.obj()); 238 env, java_object_.obj());
227 } 239 }
228 240
229 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env) { 241 bool RegisterAwContentsIoThreadClientImpl(JNIEnv* env) {
230 return RegisterNativesImpl(env); 242 return RegisterNativesImpl(env);
231 } 243 }
232 244
233 } // namespace android_webview 245 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents_io_thread_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698