From 40d29da276a62b445cd77bcb8b2136bb57baa882 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Sat, 8 Sep 2012 21:40:58 -0400 Subject: [PATCH] Bug 770912 - Take out log lines that print out URLs and other sensitive information. r=mfinkle --- mobile/android/base/BrowserApp.java | 4 --- mobile/android/base/Favicons.java | 34 ++-------------------- mobile/android/base/GeckoApp.java | 8 ----- mobile/android/base/GeckoProfile.java | 1 - mobile/android/base/GeckoThread.java | 2 +- mobile/android/base/ProfileMigrator.java | 2 +- mobile/android/base/db/LocalBrowserDB.java | 2 +- 7 files changed, 5 insertions(+), 48 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index f1227ec04d4..bd3686a1dea 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -544,15 +544,11 @@ abstract public class BrowserApp extends GeckoApp if (favicon == null) return; - Log.i(LOGTAG, "Favicon successfully loaded for URL = " + pageUrl); - // The tab might be pointing to another URL by the time the // favicon is finally loaded, in which case we simply ignore it. if (!tab.getURL().equals(pageUrl)) return; - Log.i(LOGTAG, "Favicon is for current URL = " + pageUrl); - tab.updateFavicon(favicon); tab.setFaviconLoadId(Favicons.NOT_LOADING); diff --git a/mobile/android/base/Favicons.java b/mobile/android/base/Favicons.java index 7afee477a0e..d132570aa3e 100644 --- a/mobile/android/base/Favicons.java +++ b/mobile/android/base/Favicons.java @@ -91,8 +91,6 @@ public class Favicons { } public String getFaviconUrlForPageUrl(String pageUrl) { - Log.d(LOGTAG, "Calling getFaviconUrlForPageUrl() for " + pageUrl); - SQLiteDatabase db = mDbHelper.getReadableDatabase(); SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); @@ -117,8 +115,6 @@ public class Favicons { } public void setFaviconUrlForPageUrl(String pageUrl, String faviconUrl) { - Log.d(LOGTAG, "Calling setFaviconUrlForPageUrl() for " + pageUrl); - SQLiteDatabase db = mDbHelper.getWritableDatabase(); ContentValues values = new ContentValues(); @@ -173,10 +169,6 @@ public class Favicons { task.execute(); - Log.d(LOGTAG, "Calling loadFavicon() with URL = " + pageUrl + - " and favicon URL = " + faviconUrl + - " (" + taskId + ")"); - return taskId; } @@ -231,21 +223,13 @@ public class Favicons { mPageUrl = pageUrl; mFaviconUrl = faviconUrl; mListener = listener; - - Log.d(LOGTAG, "Creating LoadFaviconTask with URL = " + pageUrl + - " and favicon URL = " + faviconUrl); } // Runs in background thread private BitmapDrawable loadFaviconFromDb() { - Log.d(LOGTAG, "Loading favicon from DB for URL = " + mPageUrl); - ContentResolver resolver = mContext.getContentResolver(); BitmapDrawable favicon = BrowserDB.getFaviconForUrl(resolver, mPageUrl); - if (favicon != null) - Log.d(LOGTAG, "Loaded favicon from DB successfully for URL = " + mPageUrl); - return favicon; } @@ -254,20 +238,15 @@ public class Favicons { // since the Async task can run this on any number of threads in the // pool, we need to protect against inserting the same url twice synchronized(mDbHelper) { - Log.d(LOGTAG, "Saving favicon on browser database for URL = " + mPageUrl); ContentResolver resolver = mContext.getContentResolver(); BrowserDB.updateFaviconForUrl(resolver, mPageUrl, favicon); - Log.d(LOGTAG, "Saving favicon URL for URL = " + mPageUrl); mDbHelper.setFaviconUrlForPageUrl(mPageUrl, mFaviconUrl); } } // Runs in background thread private BitmapDrawable downloadFavicon(URL faviconUrl) { - Log.d(LOGTAG, "Downloading favicon for URL = " + mPageUrl + - " with favicon URL = " + mFaviconUrl); - if (mFaviconUrl.startsWith("jar:jar:")) { return GeckoJarReader.getBitmapDrawable(GeckoApp.mAppContext.getResources(), mFaviconUrl); } @@ -276,7 +255,7 @@ public class Favicons { try { uri = faviconUrl.toURI(); } catch (URISyntaxException e) { - Log.d(LOGTAG, "Could not get URI for favicon URL: " + mFaviconUrl); + Log.d(LOGTAG, "Could not get URI for favicon"); return null; } @@ -324,12 +303,10 @@ public class Favicons { faviconUrl = new URL(mFaviconUrl); } } catch (MalformedURLException e) { - Log.d(LOGTAG, "The provided favicon URL is not valid", e); + Log.d(LOGTAG, "The provided favicon URL is not valid"); return null; } - Log.d(LOGTAG, "Favicon URL is now: " + mFaviconUrl); - if (isCancelled()) return null; @@ -346,7 +323,6 @@ public class Favicons { image = downloadFavicon(faviconUrl); if (image != null) { - Log.d(LOGTAG, "Downloaded favicon successfully for URL = " + mPageUrl); saveFaviconToDb(image); } @@ -355,9 +331,6 @@ public class Favicons { @Override protected void onPostExecute(final BitmapDrawable image) { - Log.d(LOGTAG, "LoadFaviconTask finished for URL = " + mPageUrl + - " (" + mId + ")"); - mLoadTasks.remove(mId); if (mListener != null) { @@ -372,9 +345,6 @@ public class Favicons { @Override protected void onCancelled() { - Log.d(LOGTAG, "LoadFaviconTask cancelled for URL = " + mPageUrl + - " (" + mId + ")"); - mLoadTasks.remove(mId); // Note that we don't call the listener callback if the diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 807a14bbd2e..de91e35bb33 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -841,13 +841,11 @@ abstract public class GeckoApp final int tabId = message.getInt("tabID"); final String title = message.getString("title"); handleTitleChanged(tabId, title); - Log.i(LOGTAG, "title - " + title); } else if (event.equals("DOMLinkAdded")) { final int tabId = message.getInt("tabID"); final String rel = message.getString("rel"); final String href = message.getString("href"); final int size = message.getInt("size"); - Log.i(LOGTAG, "link rel - " + rel + ", href - " + href + ", size - " + size); handleLinkAdded(tabId, rel, href, size); } else if (event.equals("DOMWindowClose")) { final int tabId = message.getInt("tabID"); @@ -964,7 +962,6 @@ abstract public class GeckoApp Intent intent = GeckoAppShell.getWebAppIntent(url, origin, false); if (intent == null) return; - Log.i(LOGTAG, "Open " + url + " (" + origin + ")"); startActivity(intent); } else if (event.equals("WebApps:Install")) { String name = message.getString("name"); @@ -1711,7 +1708,6 @@ abstract public class GeckoApp try { // this class should only be initialized with an intent with non-null data URL url = new URL(mIntent.getData().toString()); - Log.i(LOGTAG, "xxx - Loading: " + url); // data url should have an http scheme mConnection = (HttpURLConnection) url.openConnection(); mConnection.setRequestProperty("User-Agent", getUAStringForHost(url.getHost())); @@ -1832,22 +1828,18 @@ abstract public class GeckoApp else if (ACTION_LOAD.equals(action)) { String uri = intent.getDataString(); loadUrl(uri, AwesomeBar.Target.CURRENT_TAB); - Log.i(LOGTAG,"onNewIntent: " + uri); } else if (Intent.ACTION_VIEW.equals(action)) { String uri = intent.getDataString(); GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(uri)); - Log.i(LOGTAG,"onNewIntent: " + uri); } else if (action != null && action.startsWith(ACTION_WEBAPP_PREFIX)) { String uri = getURIFromIntent(intent); GeckoAppShell.sendEventToGecko(GeckoEvent.createWebappLoadEvent(uri)); - Log.i(LOGTAG,"Intent : WEBAPP (" + action + ") - " + uri); } else if (ACTION_BOOKMARK.equals(action)) { String uri = getURIFromIntent(intent); GeckoAppShell.sendEventToGecko(GeckoEvent.createBookmarkLoadEvent(uri)); - Log.i(LOGTAG,"Intent : BOOKMARK - " + uri); } else if (ACTION_ALERT_CALLBACK.equals(action)) { String alertName = ""; diff --git a/mobile/android/base/GeckoProfile.java b/mobile/android/base/GeckoProfile.java index 0a2b8ddb01d..f04d957ed04 100644 --- a/mobile/android/base/GeckoProfile.java +++ b/mobile/android/base/GeckoProfile.java @@ -369,7 +369,6 @@ public final class GeckoProfile { parser.addSection(generalSection); // only set as default if this is the first profile we're creating - Log.i(LOGTAG, "WESJ - SET DEFAULT"); profileSection.setProperty("Default", 1); } diff --git a/mobile/android/base/GeckoThread.java b/mobile/android/base/GeckoThread.java index 5c5b53c1886..f70e71e5be2 100644 --- a/mobile/android/base/GeckoThread.java +++ b/mobile/android/base/GeckoThread.java @@ -78,7 +78,7 @@ public class GeckoThread extends Thread { } // and then fire us up - Log.i(LOGTAG, "RunGecko - URI = " + mUri + " args = " + args); + Log.i(LOGTAG, "RunGecko - args = " + args); GeckoAppShell.runGecko(app.getApplication().getPackageResourcePath(), args, mUri, diff --git a/mobile/android/base/ProfileMigrator.java b/mobile/android/base/ProfileMigrator.java index 47c24e2f7fa..d9d5b885057 100644 --- a/mobile/android/base/ProfileMigrator.java +++ b/mobile/android/base/ProfileMigrator.java @@ -904,7 +904,7 @@ public class ProfileMigrator { mDB.updateFaviconInBatch(mCr, mOperations, url, faviconUrl, faviconGuid, newData); } catch (SQLException e) { - Log.i(LOGTAG, "Migrating favicon failed: " + mime + " URL: " + url + Log.i(LOGTAG, "Migrating favicon failed: " + mime + " error:" + e.getMessage()); } } diff --git a/mobile/android/base/db/LocalBrowserDB.java b/mobile/android/base/db/LocalBrowserDB.java index c4f72bbca05..32888412338 100644 --- a/mobile/android/base/db/LocalBrowserDB.java +++ b/mobile/android/base/db/LocalBrowserDB.java @@ -409,7 +409,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface { count = c.getCount(); c.close(); } catch (NullPointerException e) { - Log.e(LOGTAG, "NullPointerException in isBookmark for " + uri); + Log.e(LOGTAG, "NullPointerException in isBookmark"); } return (count > 0);