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

Unified Diff: content/app/android/library_loader_hooks.cc

Issue 11644093: Add support for --enable-dcheck on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years 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/app/android/library_loader_hooks.cc
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc
index a60155ff67bc92a79b260101ac6835ab5bbf8a1f..346a0ed58e938c3ad39d07a4b02ec65fe8f8325a 100644
--- a/content/app/android/library_loader_hooks.cc
+++ b/content/app/android/library_loader_hooks.cc
@@ -9,6 +9,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/at_exit.h"
+#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/file_path.h"
@@ -48,11 +49,18 @@ static jboolean LibraryLoadedOnMainThread(JNIEnv* env, jclass clazz,
// Can only use event tracing after setting up the command line.
TRACE_EVENT0("jni", "JNI_OnLoad continuation");
+ // Note: because logging is setup here right after copying the command line
+ // array from java to native up top of this method, any code that adds the
+ // --enable-dcheck switch must do so on the Java side.
+ logging::DcheckState dcheck_state =
+ command_line->HasSwitch(switches::kEnableDCHECK) ?
+ logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS :
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
logging::InitLogging(NULL,
logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
logging::DONT_LOCK_LOG_FILE,
logging::DELETE_OLD_LOG_FILE,
- logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+ dcheck_state);
// To view log output with IDs and timestamps use "adb logcat -v threadtime".
logging::SetLogItems(false, // Process ID
false, // Thread ID
« 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