Commit 46b0d6a9 authored by Egor Pasko's avatar Egor Pasko Committed by Commit Bot

startup_metric_utils: Remove wallclock leftovers

Trivial cleanup: removing parameters/functions that are not used in producing
startup metrics (The RecordMainEntryPointTime() used to take wall clock time
into account, but now on all platforms wallclock time is not needed except for
executable start time).

Bug: 797762
Change-Id: I1242246ad6af2b4b3e955b0225144154084e568f
Reviewed-on: https://chromium-review.googlesource.com/1174548Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Reviewed-by: default avatarJay Civelli <jcivelli@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584015}
parent 59802d40
......@@ -15,7 +15,6 @@ import org.chromium.base.annotations.MainDex;
*/
@JNINamespace("chrome::android")
public class UmaUtils {
private static long sApplicationStartWallClockMs;
private static boolean sRunningApplicationStart;
// All these values originate from SystemClock.uptimeMillis().
......@@ -33,7 +32,6 @@ public class UmaUtils {
// isn't initialized until we start the native content browser component, and we
// then need the start time in the C++ side before we return to Java. As such we
// save it in a static that the C++ can fetch once it has initialized the JNI.
sApplicationStartWallClockMs = System.currentTimeMillis();
sApplicationStartTimeMs = SystemClock.uptimeMillis();
}
......@@ -87,11 +85,6 @@ public class UmaUtils {
nativeRecordMetricsReportingDefaultOptIn(optIn);
}
@CalledByNative
public static long getMainEntryPointWallTime() {
return sApplicationStartWallClockMs;
}
@CalledByNative
public static long getMainEntryPointTicks() {
return sApplicationStartTimeMs;
......
......@@ -91,7 +91,6 @@ int ChromeMainDelegateAndroid::RunProcess(
// start time of the application, and will be same for all requests.
if (!browser_runner_.get()) {
startup_metric_utils::RecordMainEntryPointTime(
chrome::android::GetMainEntryPointTimeWallClock(),
chrome::android::GetMainEntryPointTimeTicks());
browser_runner_.reset(content::BrowserMainRunner::Create());
}
......
......@@ -482,8 +482,7 @@ void RecordMainStartupMetrics(base::TimeTicks exe_entry_point_ticks) {
// from the Java side until it has initialized the JNI. See
// ChromeMainDelegateAndroid.
#if !defined(OS_ANDROID)
startup_metric_utils::RecordMainEntryPointTime(base::Time::Now(),
base::TimeTicks::Now());
startup_metric_utils::RecordMainEntryPointTime(base::TimeTicks::Now());
#endif
}
#endif // !defined(CHROME_MULTIPLE_DLL_CHILD)
......
......@@ -18,13 +18,6 @@ class PrefService;
namespace chrome {
namespace android {
base::Time GetMainEntryPointTimeWallClock() {
JNIEnv* env = base::android::AttachCurrentThread();
int64_t startTimeUnixMs = Java_UmaUtils_getMainEntryPointWallTime(env);
return base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(startTimeUnixMs);
}
base::TimeTicks GetMainEntryPointTimeTicks() {
JNIEnv* env = base::android::AttachCurrentThread();
return base::TimeTicks::FromUptimeMillis(
......
......@@ -12,7 +12,6 @@
namespace chrome {
namespace android {
base::Time GetMainEntryPointTimeWallClock();
base::TimeTicks GetMainEntryPointTimeTicks();
} // namespace android
......
......@@ -547,7 +547,7 @@ void RecordStartupProcessCreationTime(base::Time time) {
DCHECK(!g_process_creation_ticks.is_null());
}
void RecordMainEntryPointTime(base::Time wall_time, base::TimeTicks ticks) {
void RecordMainEntryPointTime(base::TimeTicks ticks) {
DCHECK(g_browser_main_entry_point_ticks.is_null());
g_browser_main_entry_point_ticks = ticks;
DCHECK(!g_browser_main_entry_point_ticks.is_null());
......
......@@ -52,14 +52,12 @@ void RecordStartupProcessCreationTime(base::Time time);
// Call this with a time recorded as early as possible in the startup process.
// On Android, the entry point time is the time at which the Java code starts.
// In Mojo, the entry point time is the time at which the shell starts.
// TODO(pasko): Remove the wallclock-based main entry point time calculation,
// see: http://crbug.com/797762.
void RecordMainEntryPointTime(base::Time wall_time, base::TimeTicks ticks);
void RecordMainEntryPointTime(base::TimeTicks ticks);
// Call this with the time when the executable is loaded and main() is entered.
// Can be different from |RecordMainEntryPointTime| when the startup process is
// contained in a separate dll, such as with chrome.exe / chrome.dll on Windows.
void RecordExeMainEntryPointTicks(base::TimeTicks time);
void RecordExeMainEntryPointTicks(base::TimeTicks ticks);
// Call this with the time recorded just before the message loop is started.
// |is_first_run| - is the current launch part of a first run. |pref_service| is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment