|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by bcwhite Modified:
3 years, 10 months ago Reviewers:
manzagop (departed) CC:
chromium-reviews, vmpstr+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAdd convenience methods so callers don't have to check if enabled.
Changes to make use of these new methods are in a follow-up CL.
BUG=620813
Review-Url: https://codereview.chromium.org/2687973004
Cr-Commit-Position: refs/heads/master@{#451264}
Committed: https://chromium.googlesource.com/chromium/src/+/ddd53c2ef164f4e22c55d3d69b9c1fb386119375
Patch Set 1 #Patch Set 2 : rebased #Messages
Total messages: 21 (15 generated)
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
bcwhite@chromium.org changed reviewers: + manzagop@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by bcwhite@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for base/debug/activity_tracker.h:
While running git apply --index -p1;
error: patch failed: base/debug/activity_tracker.h:751
error: base/debug/activity_tracker.h: patch does not apply
Patch: base/debug/activity_tracker.h
Index: base/debug/activity_tracker.h
diff --git a/base/debug/activity_tracker.h b/base/debug/activity_tracker.h
index
53290e1b7070b7258a041fb672c3b912ea2eb32e..0f45b8ed1c584147fa96bf04c607a9350558bbfa
100644
--- a/base/debug/activity_tracker.h
+++ b/base/debug/activity_tracker.h
@@ -751,6 +751,9 @@ class BASE_EXPORT GlobalActivityTracker {
subtle::NoBarrier_Load(&g_tracker_));
}
+ // Convenience method for determining if a global tracker is active.
+ static bool IsEnabled() { return Get() != nullptr; }
+
// Gets the persistent-memory-allocator in which data is stored. Callers
// can store additional records here to pass more information to the
// analysis process.
@@ -783,15 +786,31 @@ class BASE_EXPORT GlobalActivityTracker {
// Records a log message. The current implementation does NOT recycle these
// only store critical messages such as FATAL ones.
void RecordLogMessage(StringPiece message);
+ static void RecordLogMessageIfEnabled(StringPiece message) {
+ GlobalActivityTracker* tracker = Get();
+ if (tracker)
+ tracker->RecordLogMessage(message);
+ }
// Records a module load/unload event. This is safe to call multiple times
// even with the same information.
void RecordModuleInfo(const ModuleInfo& info);
+ static void RecordModuleInfoIfEnabled(const ModuleInfo& info) {
+ GlobalActivityTracker* tracker = Get();
+ if (tracker)
+ tracker->RecordModuleInfo(info);
+ }
// Record field trial information. This call is thread-safe. In addition to
// this, construction of a GlobalActivityTracker will cause all existing
// active field trials to be fetched and recorded.
void RecordFieldTrial(const std::string& trial_name, StringPiece group_name);
+ static void RecordFieldTrialIfEnabled(const std::string& trial_name,
+ StringPiece group_name) {
+ GlobalActivityTracker* tracker = Get();
+ if (tracker)
+ tracker->RecordFieldTrial(trial_name, group_name);
+ }
// Accesses the global data record for storing arbitrary key/value pairs.
ActivityUserData& global_data() { return global_data_; }
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by bcwhite@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from manzagop@chromium.org Link to the patchset: https://codereview.chromium.org/2687973004/#ps20001 (title: "rebased")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 20001, "attempt_start_ts": 1487314705618100,
"parent_rev": "24ffc96f66c428a9820e839af5c47887ce2042b7", "commit_rev":
"ddd53c2ef164f4e22c55d3d69b9c1fb386119375"}
Message was sent while issue was closed.
Description was changed from ========== Add convenience methods so callers don't have to check if enabled. Changes to make use of these new methods are in a follow-up CL. BUG=620813 ========== to ========== Add convenience methods so callers don't have to check if enabled. Changes to make use of these new methods are in a follow-up CL. BUG=620813 Review-Url: https://codereview.chromium.org/2687973004 Cr-Commit-Position: refs/heads/master@{#451264} Committed: https://chromium.googlesource.com/chromium/src/+/ddd53c2ef164f4e22c55d3d69b9c... ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/ddd53c2ef164f4e22c55d3d69b9c... |
