forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "android: Experiment setup for the reached code profiler."
This is a reland of 48f72ca Failed tests that caused the revert in https://crbug.com/930262 were fixed in https://crrev.com/c/1464581 Original change's description: > android: Experiment setup for the reached code profiler. > > This CL prepares the reached code profiler for the finch experiment. It adds: > - base::Feature "ReachedCodeProfiler", which state is cached in > - Android shared preference "reached_code_profiler_enabled", that determines > whether to set > - command line switch "enable-reached-code-profiler", that eventually enables > the profiler > > We cannot simply use a base::Feature for the reached code profiler because > we have to know the feature state very early in the startup, before the > FeatureList is initialized. > > To work around this limitation we cache the feature state in Android shared > preferences that are available in Java before native is initialized. > > Since only the browser process has a right to read the shared preferences we > pass the value of the cached feature state as a command line flag to all > processes. > > Bug: 916263 > Change-Id: I730b98c5484ca595bdfda46592572f5853784aa8 > Reviewed-on: https://chromium-review.googlesource.com/c/1393328 > Reviewed-by: Andrew Grieve <[email protected]> > Reviewed-by: Bo <[email protected]> > Reviewed-by: Gabriel Charette <[email protected]> > Reviewed-by: Egor Pasko <[email protected]> > Commit-Queue: Alex Ilin <[email protected]> > Cr-Commit-Position: refs/heads/master@{#630298} TBR: [email protected], [email protected], [email protected], [email protected] Bug: 916263 Change-Id: Ib3da0a08976ebebff3ece9d42acbd02e069f3287 Reviewed-on: https://chromium-review.googlesource.com/c/1466521 Reviewed-by: Alex Ilin <[email protected]> Commit-Queue: Alex Ilin <[email protected]> Cr-Commit-Position: refs/heads/master@{#631177}
- Loading branch information
Alexandr Ilin
authored and
Commit Bot
committed
Feb 12, 2019
1 parent
17dfe7a
commit 0455bb9
Showing
21 changed files
with
276 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
base/test/android/javatests/src/org/chromium/base/test/ReachedCodeProfiler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package org.chromium.base.test; | ||
|
||
import org.chromium.base.annotations.JNINamespace; | ||
|
||
/** | ||
* Class containing only static methods for querying the status of the reached code profiler. | ||
*/ | ||
@JNINamespace("base::android") | ||
public class ReachedCodeProfiler { | ||
private ReachedCodeProfiler() {} | ||
|
||
/** | ||
* @return Whether the reached code profiler is enabled. | ||
*/ | ||
public static boolean isEnabled() { | ||
return nativeIsReachedCodeProfilerEnabled(); | ||
} | ||
|
||
/** | ||
* @return Whether the currently used version of native library supports the reached code | ||
* profiler. | ||
*/ | ||
public static boolean isSupported() { | ||
return nativeIsReachedCodeProfilerSupported(); | ||
} | ||
|
||
private static native boolean nativeIsReachedCodeProfilerEnabled(); | ||
private static native boolean nativeIsReachedCodeProfilerSupported(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/android/jni_android.h" | ||
#include "base/android/reached_code_profiler.h" | ||
#include "jni/ReachedCodeProfiler_jni.h" | ||
|
||
// This file provides functions to query the state of the reached code profiler | ||
// from Java. It's used only for tests. | ||
namespace base { | ||
namespace android { | ||
|
||
static jboolean JNI_ReachedCodeProfiler_IsReachedCodeProfilerEnabled( | ||
JNIEnv* env) { | ||
return IsReachedCodeProfilerEnabled(); | ||
} | ||
|
||
static jboolean JNI_ReachedCodeProfiler_IsReachedCodeProfilerSupported( | ||
JNIEnv* env) { | ||
return IsReachedCodeProfilerSupported(); | ||
} | ||
|
||
} // namespace android | ||
} // namespace base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.