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

Side by Side Diff: src/views/SkEventSink.cpp

Issue 1945353003: Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/ports/SkTLS_win.cpp ('k') | tests/PathOpsExtendedTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "SkEventSink.h" 9 #include "SkEventSink.h"
10 #include "SkMutex.h" 10 #include "SkMutex.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 //////////////////////////////////////////////////////////////////////////////// //////// 251 //////////////////////////////////////////////////////////////////////////////// ////////
252 //////////////////////////////////////////////////////////////////////////////// //////// 252 //////////////////////////////////////////////////////////////////////////////// ////////
253 253
254 #if 0 // experimental, not tested 254 #if 0 // experimental, not tested
255 255
256 #include "SkMutex.h" 256 #include "SkMutex.h"
257 #include "SkTDict.h" 257 #include "SkTDict.h"
258 258
259 #define kMinStringBufferSize 128 259 #define kMinStringBufferSize 128
260 static SkMutex gNamedSinkMutex; 260 SK_DECLARE_STATIC_MUTEX(gNamedSinkMutex);
261 static SkTDict<SkEventSinkID> gNamedSinkIDs(kMinStringBufferSize); 261 static SkTDict<SkEventSinkID> gNamedSinkIDs(kMinStringBufferSize);
262 262
263 /** Register a name/id pair with the system. If the name already exists, 263 /** Register a name/id pair with the system. If the name already exists,
264 replace its ID with the new id. This pair will persist until UnregisterNamed Sink() 264 replace its ID with the new id. This pair will persist until UnregisterNamed Sink()
265 is called. 265 is called.
266 */ 266 */
267 void SkEventSink::RegisterNamedSinkID(const char name[], SkEventSinkID id) 267 void SkEventSink::RegisterNamedSinkID(const char name[], SkEventSinkID id)
268 { 268 {
269 if (id && name && *name) 269 if (id && name && *name)
270 { 270 {
(...skipping 20 matching lines...) Expand all
291 /** Remove all name/id pairs from the system. This is call internally 291 /** Remove all name/id pairs from the system. This is call internally
292 on shutdown, to ensure no memory leaks. It should not be called 292 on shutdown, to ensure no memory leaks. It should not be called
293 before shutdown. 293 before shutdown.
294 */ 294 */
295 void SkEventSink::RemoveAllNamedSinkIDs() 295 void SkEventSink::RemoveAllNamedSinkIDs()
296 { 296 {
297 SkAutoMutexAcquire ac(gNamedSinkMutex); 297 SkAutoMutexAcquire ac(gNamedSinkMutex);
298 (void)gNamedSinkIDs.reset(); 298 (void)gNamedSinkIDs.reset();
299 } 299 }
300 #endif 300 #endif
OLDNEW
« no previous file with comments | « src/ports/SkTLS_win.cpp ('k') | tests/PathOpsExtendedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698