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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java

Issue 2392763002: Sanitize unparcable intents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 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
Index: chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
index 5ad0f718f5cf065377d1462c79dfd4d28cf63138..f839db33cf61eaf028f38e0bd071474aa4d5d4cc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
@@ -25,6 +25,7 @@ import org.chromium.base.CommandLineInitUtil;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.TraceEvent;
+import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeApplication;
import org.chromium.chrome.browser.ChromeSwitches;
@@ -117,13 +118,13 @@ public class ChromeLauncherActivity extends Activity
* you add _absolutely has_ to be here.
*/
@Override
- @SuppressLint("MissingSuperCall") // Called in doOnCreate.
public void onCreate(Bundle savedInstanceState) {
// Third-party code adds disk access to Activity.onCreate. http://crbug.com/619824
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
TraceEvent.begin("ChromeLauncherActivity");
TraceEvent.begin("ChromeLauncherActivity.onCreate");
try {
+ super.onCreate(savedInstanceState);
doOnCreate(savedInstanceState);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
@@ -131,15 +132,15 @@ public class ChromeLauncherActivity extends Activity
}
}
- private final void doOnCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ @VisibleForTesting
+ final void doOnCreate(Bundle savedInstanceState) {
// This Activity is only transient. It launches another activity and
// terminates itself. However, some of the work is performed outside of
// {@link Activity#onCreate()}. To capture this, the TraceEvent starts
// in onCreate(), and ends in onPause().
// Needs to be called as early as possible, to accurately capture the
// time at which the intent was received.
- IntentHandler.addTimestampToIntent(getIntent());
+ setIntent(IntentHandler.addTimestampToIntent(getIntent()));
Ted C 2016/10/04 20:19:23 while this seems reasonable to do, it is a bit of
kraush 2016/10/04 21:36:36 Will do.
// Initialize the command line in case we've disabled document mode from there.
CommandLineInitUtil.initCommandLine(this, ChromeApplication.COMMAND_LINE_FILE);

Powered by Google App Engine
This is Rietveld 408576698