Commit 8b96058b authored by yfriedman's avatar yfriedman Committed by Commit bot

Move Android metrics files into a /metrics/ subfolder/package.

BUG=428903

Review URL: https://codereview.chromium.org/968943004

Cr-Commit-Position: refs/heads/master@{#318782}
parent 61da6a99
H B Nm: The class name org.chromium.chrome.browser.UmaUtils shadows the simple name of the superclass org.chromium.chrome.browser.metrics.UmaUtils At UmaUtils.java
M M LI: Incorrect lazy initialization of static field org.chromium.chrome.browser.download.DownloadManagerService.sDownloadManagerService in org.chromium.chrome.browser.download.DownloadManagerService.getDownloadManagerService(Context) At DownloadManagerService.java
M D UrF: Unread public/protected field: org.chromium.chrome.browser.document.PendingDocumentData.extraHeaders At DocumentTabModelSelector.java
M D UrF: Unread public/protected field: org.chromium.chrome.browser.document.PendingDocumentData.postData At DocumentTabModelSelector.java
......
......@@ -4,51 +4,9 @@
package org.chromium.chrome.browser;
import org.chromium.base.CalledByNative;
/**
* Utilities to support startup metrics - Android version.
* TODO(yfriedman): Remove this after rolling downstream.
*/
public class UmaUtils {
private static long sApplicationStartWallClockMs;
private static boolean sRunningApplicationStart;
/**
* Record the time at which the activity started. This should be called asap after
* the start of the activity's onCreate function.
*/
public static void recordMainEntryPointTime() {
// We can't simply pass this down through a JNI call, since the JNI for chrome
// 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();
}
/**
* Whether the application is in the early stage since the browser process start. The
* "application start" ends right after the last histogram related to browser startup is
* recorded. Currently, the very first navigation commit in the lifetime of the process ends the
* "application start".
* Must only be called on the UI thread.
*/
public static boolean isRunningApplicationStart() {
return sRunningApplicationStart;
}
/**
* Marks/unmarks the "application start" stage of the browser process lifetime.
* Must only be called on the UI thread.
*/
public static void setRunningApplicationStart(boolean isAppStart) {
sRunningApplicationStart = isAppStart;
}
@CalledByNative
private static long getMainEntryPointTime() {
return sApplicationStartWallClockMs;
}
public class UmaUtils extends org.chromium.chrome.browser.metrics.UmaUtils {
}
......@@ -9,7 +9,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import org.chromium.chrome.browser.UmaBridge;
import org.chromium.chrome.browser.metrics.UmaBridge;
/**
* A helper class for a menu button to decide when to show the app menu and forward touch
......
......@@ -18,7 +18,7 @@ import android.widget.ListPopupWindow;
import android.widget.ListView;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.UmaBridge;
import org.chromium.chrome.browser.metrics.UmaBridge;
import java.util.ArrayList;
......
......@@ -17,7 +17,7 @@ import android.widget.PopupMenu;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.UmaBridge;
import org.chromium.chrome.browser.metrics.UmaBridge;
import java.util.ArrayList;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser;
package org.chromium.chrome.browser.metrics;
import org.chromium.chrome.browser.preferences.bandwidth.BandwidthReductionPreferences;
import org.chromium.chrome.browser.preferences.bandwidth.DataReductionPromoScreen;
......
// Copyright 2013 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.chrome.browser.metrics;
import org.chromium.base.CalledByNative;
/**
* Utilities to support startup metrics - Android version.
*/
public class UmaUtils {
private static long sApplicationStartWallClockMs;
private static boolean sRunningApplicationStart;
/**
* Record the time at which the activity started. This should be called asap after
* the start of the activity's onCreate function.
*/
public static void recordMainEntryPointTime() {
// We can't simply pass this down through a JNI call, since the JNI for chrome
// 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();
}
/**
* Whether the application is in the early stage since the browser process start. The
* "application start" ends right after the last histogram related to browser startup is
* recorded. Currently, the very first navigation commit in the lifetime of the process ends the
* "application start".
* Must only be called on the UI thread.
*/
public static boolean isRunningApplicationStart() {
return sRunningApplicationStart;
}
/**
* Marks/unmarks the "application start" stage of the browser process lifetime.
* Must only be called on the UI thread.
*/
public static void setRunningApplicationStart(boolean isAppStart) {
sRunningApplicationStart = isAppStart;
}
@CalledByNative
private static long getMainEntryPointTime() {
return sApplicationStartWallClockMs;
}
}
......@@ -18,7 +18,7 @@ import android.widget.Toast;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.UmaBridge;
import org.chromium.chrome.browser.metrics.UmaBridge;
import java.net.MalformedURLException;
import java.net.URL;
......
......@@ -16,9 +16,9 @@ import android.preference.PreferenceManager;
import android.text.format.DateUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.UmaBridge;
import org.chromium.chrome.browser.firstrun.FirstRunStatus;
import org.chromium.chrome.browser.infobar.DataReductionProxyInfoBar;
import org.chromium.chrome.browser.metrics.UmaBridge;
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
import org.chromium.chrome.browser.preferences.ChromeSwitchPreference;
import org.chromium.chrome.browser.preferences.ManagedPreferenceDelegate;
......
......@@ -19,7 +19,7 @@ import android.widget.LinearLayout.LayoutParams;
import org.chromium.base.ApplicationStatus;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromiumApplication;
import org.chromium.chrome.browser.UmaBridge;
import org.chromium.chrome.browser.metrics.UmaBridge;
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
......
......@@ -8,7 +8,7 @@
#include "base/trace_event/trace_event.h"
#include "chrome/browser/android/chrome_jni_registrar.h"
#include "chrome/browser/android/chrome_startup_flags.h"
#include "chrome/browser/android/uma_utils.h"
#include "chrome/browser/android/metrics/uma_utils.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
#include "content/public/browser/browser_main_runner.h"
......
......@@ -32,7 +32,9 @@
#include "chrome/browser/android/intent_helper.h"
#include "chrome/browser/android/location_settings_impl.h"
#include "chrome/browser/android/logo_bridge.h"
#include "chrome/browser/android/metrics/uma_bridge.h"
#include "chrome/browser/android/metrics/uma_session_stats.h"
#include "chrome/browser/android/metrics/uma_utils.h"
#include "chrome/browser/android/most_visited_sites.h"
#include "chrome/browser/android/new_tab_page_prefs.h"
#include "chrome/browser/android/omnibox/answers_image_bridge.h"
......@@ -51,8 +53,6 @@
#include "chrome/browser/android/signin/signin_manager_android.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/android/tab_state.h"
#include "chrome/browser/android/uma_bridge.h"
#include "chrome/browser/android/uma_utils.h"
#include "chrome/browser/android/url_utilities.h"
#include "chrome/browser/android/voice_search_tab_helper.h"
#include "chrome/browser/autofill/android/personal_data_manager_android.h"
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/android/uma_bridge.h"
#include "chrome/browser/android/metrics/uma_bridge.h"
#include <jni.h>
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_UMA_BRIDGE_H_
#define CHROME_BROWSER_ANDROID_UMA_BRIDGE_H_
#ifndef CHROME_BROWSER_ANDROID_METRICS_UMA_BRIDGE_H_
#define CHROME_BROWSER_ANDROID_METRICS_UMA_BRIDGE_H_
#include <jni.h>
......@@ -16,4 +16,4 @@ bool RegisterUmaBridge(JNIEnv* env);
} // namespace android
} // namespace chrome
#endif // CHROME_BROWSER_ANDROID_UMA_BRIDGE_H_
#endif // CHROME_BROWSER_ANDROID_METRICS_UMA_BRIDGE_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/android/uma_utils.h"
#include "chrome/browser/android/metrics/uma_utils.h"
#include "jni/UmaUtils_jni.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_UMA_UTILS_H_
#define CHROME_BROWSER_ANDROID_UMA_UTILS_H_
#ifndef CHROME_BROWSER_ANDROID_METRICS_UMA_UTILS_H_
#define CHROME_BROWSER_ANDROID_METRICS_UMA_UTILS_H_
#include <jni.h>
......@@ -18,4 +18,4 @@ bool RegisterStartupMetricUtils(JNIEnv* env);
} // namespace android
} // namespace chrome
#endif // CHROME_BROWSER_ANDROID_UMA_UTILS_H_
#endif // CHROME_BROWSER_ANDROID_METRICS_UMA_UTILS_H_
......@@ -12,7 +12,7 @@
#include "cc/layers/layer.h"
#include "chrome/browser/android/chrome_web_contents_delegate_android.h"
#include "chrome/browser/android/compositor/tab_content_manager.h"
#include "chrome/browser/android/uma_utils.h"
#include "chrome/browser/android/metrics/uma_utils.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
......
......@@ -101,8 +101,12 @@
'browser/android/logo_service.h',
'browser/android/manifest_icon_selector.cc',
'browser/android/manifest_icon_selector.h',
'browser/android/metrics/uma_bridge.cc',
'browser/android/metrics/uma_bridge.h',
'browser/android/metrics/uma_session_stats.cc',
'browser/android/metrics/uma_session_stats.h',
'browser/android/metrics/uma_utils.cc',
'browser/android/metrics/uma_utils.h',
'browser/android/most_visited_sites.cc',
'browser/android/most_visited_sites.h',
'browser/android/new_tab_page_prefs.cc',
......@@ -156,10 +160,6 @@
'browser/android/thumbnail/thumbnail.h',
'browser/android/thumbnail/thumbnail_store.cc',
'browser/android/thumbnail/thumbnail_store.h',
'browser/android/uma_bridge.cc',
'browser/android/uma_bridge.h',
'browser/android/uma_utils.cc',
'browser/android/uma_utils.h',
'browser/android/url_utilities.cc',
'browser/android/url_utilities.h',
'browser/android/voice_search_tab_helper.cc',
......@@ -1601,7 +1601,9 @@
'android/java/src/org/chromium/chrome/browser/NewTabPagePrefs.java',
'android/java/src/org/chromium/chrome/browser/IntentHelper.java',
'android/java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java',
'android/java/src/org/chromium/chrome/browser/metrics/UmaBridge.java',
'android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java',
'android/java/src/org/chromium/chrome/browser/metrics/UmaUtils.java',
'android/java/src/org/chromium/chrome/browser/NavigationPopup.java',
'android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java',
'android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java',
......@@ -1634,8 +1636,6 @@
'android/java/src/org/chromium/chrome/browser/Tab.java',
'android/java/src/org/chromium/chrome/browser/TabState.java',
'android/java/src/org/chromium/chrome/browser/TtsPlatformImpl.java',
'android/java/src/org/chromium/chrome/browser/UmaBridge.java',
'android/java/src/org/chromium/chrome/browser/UmaUtils.java',
'android/java/src/org/chromium/chrome/browser/UrlUtilities.java',
'android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java',
'android/java/src/org/chromium/chrome/browser/VoiceSearchTabHelper.java',
......
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