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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 25505005: Early out if contentviewcore native side is null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make findbugs happy Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 88785c177e4d7083df2badb0f07f756141072d1b..842aee940a9c4fde6a3454448c457e1f69647da1 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -3044,15 +3044,20 @@ import java.util.Map;
*/
public NavigationHistory getNavigationHistory() {
NavigationHistory history = new NavigationHistory();
- int currentIndex = nativeGetNavigationHistory(mNativeContentViewCore, history);
- history.setCurrentEntryIndex(currentIndex);
+ if (mNativeContentViewCore != 0) {
+ int currentIndex = nativeGetNavigationHistory(mNativeContentViewCore, history);
+ history.setCurrentEntryIndex(currentIndex);
+ }
return history;
}
@Override
public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit) {
NavigationHistory history = new NavigationHistory();
- nativeGetDirectedNavigationHistory(mNativeContentViewCore, history, isForward, itemLimit);
+ if (mNativeContentViewCore != 0) {
+ nativeGetDirectedNavigationHistory(
+ mNativeContentViewCore, history, isForward, itemLimit);
+ }
return history;
}
@@ -3061,7 +3066,10 @@ import java.util.Map;
* current entry.
*/
public String getOriginalUrlForActiveNavigationEntry() {
- return nativeGetOriginalUrlForActiveNavigationEntry(mNativeContentViewCore);
+ if (mNativeContentViewCore != 0) {
+ return nativeGetOriginalUrlForActiveNavigationEntry(mNativeContentViewCore);
+ }
+ return "";
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698