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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 1828193002: DCHECK that jstring to C++ string conversions don't pass in null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: braces Created 4 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 "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 jint page_transition, 522 jint page_transition,
523 const JavaParamRef<jstring>& j_referrer_url, 523 const JavaParamRef<jstring>& j_referrer_url,
524 jint referrer_policy, 524 jint referrer_policy,
525 jboolean is_renderer_initiated, 525 jboolean is_renderer_initiated,
526 jboolean should_replace_current_entry, 526 jboolean should_replace_current_entry,
527 jlong intent_received_timestamp, 527 jlong intent_received_timestamp,
528 jboolean has_user_gesture) { 528 jboolean has_user_gesture) {
529 if (!web_contents()) 529 if (!web_contents())
530 return PAGE_LOAD_FAILED; 530 return PAGE_LOAD_FAILED;
531 531
532 if (url.is_null())
533 return PAGE_LOAD_FAILED;
534
532 GURL gurl(base::android::ConvertJavaStringToUTF8(env, url)); 535 GURL gurl(base::android::ConvertJavaStringToUTF8(env, url));
533 if (gurl.is_empty()) 536 if (gurl.is_empty())
534 return PAGE_LOAD_FAILED; 537 return PAGE_LOAD_FAILED;
535 538
536 // If the page was prerendered, use it. 539 // If the page was prerendered, use it.
537 // Note in incognito mode, we don't have a PrerenderManager. 540 // Note in incognito mode, we don't have a PrerenderManager.
538 541
539 prerender::PrerenderManager* prerender_manager = 542 prerender::PrerenderManager* prerender_manager =
540 prerender::PrerenderManagerFactory::GetForProfile(GetProfile()); 543 prerender::PrerenderManagerFactory::GetForProfile(GetProfile());
541 if (prerender_manager) { 544 if (prerender_manager) {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 919 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
917 TRACE_EVENT0("native", "TabAndroid::Init"); 920 TRACE_EVENT0("native", "TabAndroid::Init");
918 // This will automatically bind to the Java object and pass ownership there. 921 // This will automatically bind to the Java object and pass ownership there.
919 new TabAndroid(env, obj); 922 new TabAndroid(env, obj);
920 } 923 }
921 924
922 // static 925 // static
923 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 926 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
924 return RegisterNativesImpl(env); 927 return RegisterNativesImpl(env);
925 } 928 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698