OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_STARTUP_METRIC_UTILS_H_ | 5 #ifndef CHROME_COMMON_STARTUP_METRIC_UTILS_H_ |
6 #define CHROME_COMMON_STARTUP_METRIC_UTILS_H_ | 6 #define CHROME_COMMON_STARTUP_METRIC_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Note on usage: This function is idempotent and its overhead is low enough | 24 // Note on usage: This function is idempotent and its overhead is low enough |
25 // in comparison with UI display that it's OK to call it on every | 25 // in comparison with UI display that it's OK to call it on every |
26 // UI invocation regardless of whether the browser window has already | 26 // UI invocation regardless of whether the browser window has already |
27 // been displayed or not. | 27 // been displayed or not. |
28 void SetNonBrowserUIDisplayed(); | 28 void SetNonBrowserUIDisplayed(); |
29 | 29 |
30 // Call this as early as possible in the startup process to record a | 30 // Call this as early as possible in the startup process to record a |
31 // timestamp. | 31 // timestamp. |
32 void RecordMainEntryPointTime(); | 32 void RecordMainEntryPointTime(); |
33 | 33 |
| 34 #if defined(OS_ANDROID) |
| 35 // On Android the entry point time is the time at which the Java code starts. |
| 36 // This is recorded on the Java side, and then passed to the C++ side once the |
| 37 // C++ library is loaded and running. |
| 38 void RecordSavedMainEntryPointTime(const base::Time& entry_point_time); |
| 39 #endif // OS_ANDROID |
| 40 |
34 // Called just before the message loop is about to start. Entry point to record | 41 // Called just before the message loop is about to start. Entry point to record |
35 // startup stats. | 42 // startup stats. |
36 // |is_first_run| - is the current launch part of a first run. | 43 // |is_first_run| - is the current launch part of a first run. |
37 void OnBrowserStartupComplete(bool is_first_run); | 44 void OnBrowserStartupComplete(bool is_first_run); |
38 | 45 |
39 // Called when the initial page load has finished in order to record startup | 46 // Called when the initial page load has finished in order to record startup |
40 // stats. | 47 // stats. |
41 void OnInitialPageLoadComplete(); | 48 void OnInitialPageLoadComplete(); |
42 | 49 |
43 // Scoper that records the time period before it's destructed in a histogram | 50 // Scoper that records the time period before it's destructed in a histogram |
(...skipping 10 matching lines...) Expand all Loading... |
54 private: | 61 private: |
55 const base::TimeTicks start_time_; | 62 const base::TimeTicks start_time_; |
56 const std::string histogram_name_; | 63 const std::string histogram_name_; |
57 | 64 |
58 DISALLOW_COPY_AND_ASSIGN(ScopedSlowStartupUMA); | 65 DISALLOW_COPY_AND_ASSIGN(ScopedSlowStartupUMA); |
59 }; | 66 }; |
60 | 67 |
61 } // namespace startup_metric_utils | 68 } // namespace startup_metric_utils |
62 | 69 |
63 #endif // CHROME_COMMON_STARTUP_METRIC_UTILS_H_ | 70 #endif // CHROME_COMMON_STARTUP_METRIC_UTILS_H_ |
OLD | NEW |