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

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

Issue 2833923002: WebView: carefully check size for SafeBrowsing interstitial (Closed)
Patch Set: Fix logic error and update comments Created 3 years, 8 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "android_webview/browser/aw_browser_context.h" 10 #include "android_webview/browser/aw_browser_context.h"
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 web_contents_->GetRenderViewHost()) { 1400 web_contents_->GetRenderViewHost()) {
1401 compositor_id.process_id = web_contents_->GetRenderProcessHost()->GetID(); 1401 compositor_id.process_id = web_contents_->GetRenderProcessHost()->GetID();
1402 compositor_id.routing_id = 1402 compositor_id.routing_id =
1403 web_contents_->GetRenderViewHost()->GetRoutingID(); 1403 web_contents_->GetRenderViewHost()->GetRoutingID();
1404 } else { 1404 } else {
1405 LOG(WARNING) << "failed setting the compositor on detaching interstitital"; 1405 LOG(WARNING) << "failed setting the compositor on detaching interstitital";
1406 } 1406 }
1407 browser_view_renderer_.SetActiveCompositorID(compositor_id); 1407 browser_view_renderer_.SetActiveCompositorID(compositor_id);
1408 } 1408 }
1409 1409
1410 bool AwContents::CanShowInterstitial() { 1410 bool AwContents::CanShowInterstitial() {
sgurun-gerrit only 2017/04/24 22:44:10 nobody seems to call this, what is your plan on th
Nate Fischer 2017/04/24 23:00:53 Once we support a second interstitial, we should u
1411 JNIEnv* env = AttachCurrentThread(); 1411 JNIEnv* env = AttachCurrentThread();
1412 const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1412 const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1413 if (obj.is_null()) 1413 if (obj.is_null())
1414 return false; 1414 return false;
1415 return Java_AwContents_canShowInterstitial(env, obj); 1415 return Java_AwContents_canShowInterstitial(env, obj);
1416 } 1416 }
1417 1417
1418 bool AwContents::CanShowBigInterstitial() {
1419 JNIEnv* env = AttachCurrentThread();
1420 const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1421 if (obj.is_null())
1422 return false;
1423 return Java_AwContents_canShowBigInterstitial(env, obj);
1424 }
1425
1418 void AwContents::CallProceedOnInterstitialForTesting( 1426 void AwContents::CallProceedOnInterstitialForTesting(
1419 JNIEnv* env, 1427 JNIEnv* env,
1420 const base::android::JavaParamRef<jobject>& obj) { 1428 const base::android::JavaParamRef<jobject>& obj) {
1421 DCHECK(web_contents_->GetInterstitialPage()); 1429 DCHECK(web_contents_->GetInterstitialPage());
1422 web_contents_->GetInterstitialPage()->Proceed(); 1430 web_contents_->GetInterstitialPage()->Proceed();
1423 } 1431 }
1424 1432
1425 void AwContents::CallDontProceedOnInterstitialForTesting( 1433 void AwContents::CallDontProceedOnInterstitialForTesting(
1426 JNIEnv* env, 1434 JNIEnv* env,
1427 const base::android::JavaParamRef<jobject>& obj) { 1435 const base::android::JavaParamRef<jobject>& obj) {
(...skipping 21 matching lines...) Expand all
1449 1457
1450 return Java_AwContents_onRenderProcessGoneDetail(env, obj, 1458 return Java_AwContents_onRenderProcessGoneDetail(env, obj,
1451 child_process_id, crashed); 1459 child_process_id, crashed);
1452 } 1460 }
1453 1461
1454 void AwContents::RenderProcessReady(content::RenderProcessHost* host) { 1462 void AwContents::RenderProcessReady(content::RenderProcessHost* host) {
1455 UpdateRendererPriority(); 1463 UpdateRendererPriority();
1456 } 1464 }
1457 1465
1458 } // namespace android_webview 1466 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698