Bug 1477707: Fix all infer errors in GeckoView. r=jchen

This fixes some errors reported by infer on GeckoView that are not related to threading.

Differential Revision: https://phabricator.services.mozilla.com/D3787

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Robert Bartlensky 2018-08-24 15:32:18 +00:00
parent 213272e55b
commit 9712f4f4c6
4 changed files with 14 additions and 3 deletions

View file

@ -802,6 +802,9 @@ public final class GeckoProfile {
final INIParser parser = GeckoProfileDirectories.getProfilesINI(mMozillaDir);
final Hashtable<String, INISection> sections = parser.getSections();
if (sections == null) {
return false;
}
for (Enumeration<INISection> e = sections.elements(); e.hasMoreElements();) {
final INISection section = e.nextElement();
String name = section.getStringProperty("Name");

View file

@ -119,7 +119,9 @@ public final class GeckoHLSDemuxerWrapper {
assertTrue(callback != null);
try {
mPlayer = GeckoPlayerFactory.getPlayer(id);
mPlayer.addDemuxerWrapperCallbackListener(callback);
if (mPlayer != null) {
mPlayer.addDemuxerWrapperCallbackListener(callback);
}
} catch (Exception e) {
Log.e(LOGTAG, "Constructing GeckoHLSDemuxerWrapper ... error", e);
callback.onError(BaseHlsPlayer.DemuxerError.UNKNOWN.code());

View file

@ -175,7 +175,10 @@ public final class GeckoProcessManager extends IProcessManager.Stub {
public void crashChild() {
try {
mConnections.get("tab").bind().crash();
IChildProcess childProcess = mConnections.get("tab").bind();
if (childProcess != null) {
childProcess.crash();
}
} catch (RemoteException e) {
}
}

View file

@ -210,7 +210,10 @@ import java.lang.reflect.Proxy;
}
break;
case android.R.id.paste:
commitText(Clipboard.getText(view.getContext()), 1);
String text = Clipboard.getText(view.getContext());
if (text != null) {
commitText(text, 1);
}
break;
case android.R.id.copy:
// Copy the current selection or the empty string if nothing is selected.