Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1332)

Unified Diff: src/utils/SkEventTracer.cpp

Issue 152903005: don't initialize the default Skia tracer if one has already been provided (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: "initialize" is a hard word to spell Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkEventTracer.cpp
diff --git a/src/utils/SkEventTracer.cpp b/src/utils/SkEventTracer.cpp
index f9e72de6b8ee4817d824b803a6305bc90d6230af..bd9676bce63a3ff9734d73d4c9c67dfa331baca9 100644
--- a/src/utils/SkEventTracer.cpp
+++ b/src/utils/SkEventTracer.cpp
@@ -38,8 +38,10 @@ class SkDefaultEventTracer: public SkEventTracer {
SkEventTracer *SkEventTracer::gInstance;
-static void intiailize_default_tracer(int) {
- SkEventTracer::SetInstance(SkNEW(SkDefaultEventTracer));
+static void intialiize_default_tracer(void *current_instance) {
+ if (NULL == current_instance) {
+ SkEventTracer::SetInstance(SkNEW(SkDefaultEventTracer));
+ }
}
static void cleanup_tracer() {
@@ -49,7 +51,10 @@ static void cleanup_tracer() {
SkEventTracer* SkEventTracer::GetInstance() {
SK_DECLARE_STATIC_ONCE(once);
- SkOnce(&once, intiailize_default_tracer, 0, cleanup_tracer);
+ SkOnce(&once,
+ intialiize_default_tracer,
+ SkEventTracer::gInstance,
+ cleanup_tracer);
SkASSERT(NULL != SkEventTracer::gInstance);
return SkEventTracer::gInstance;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698