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

Side by Side Diff: include/core/SkMutex.h

Issue 1207893002: Clean up a few includes, introduce iwyu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Just a little more cleanup. Created 5 years, 6 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
OLDNEW
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
1 #ifndef SkMutex_DEFINED 8 #ifndef SkMutex_DEFINED
2 #define SkMutex_DEFINED 9 #define SkMutex_DEFINED
3 10
4 // This file is not part of the public Skia API. 11 // This file is not part of the public Skia API.
5 #include "SkTypes.h" 12 #include "SkTypes.h"
6 13
7 #if defined(SK_BUILD_FOR_WIN) 14 #if defined(SK_BUILD_FOR_WIN)
8 #include "../ports/SkMutex_win.h" 15 #include "../ports/SkMutex_win.h" // IWYU pragma: export
9 #else 16 #else
10 #include "../ports/SkMutex_pthread.h" 17 #include "../ports/SkMutex_pthread.h" // IWYU pragma: export
11 #endif 18 #endif
12 19
13 class SkAutoMutexAcquire : SkNoncopyable { 20 class SkAutoMutexAcquire : SkNoncopyable {
14 public: 21 public:
15 explicit SkAutoMutexAcquire(SkBaseMutex& mutex) : fMutex(&mutex) { 22 explicit SkAutoMutexAcquire(SkBaseMutex& mutex) : fMutex(&mutex) {
16 SkASSERT(fMutex != NULL); 23 SkASSERT(fMutex != NULL);
17 mutex.acquire(); 24 mutex.acquire();
18 } 25 }
19 26
20 explicit SkAutoMutexAcquire(SkBaseMutex* mutex) : fMutex(mutex) { 27 explicit SkAutoMutexAcquire(SkBaseMutex* mutex) : fMutex(mutex) {
(...skipping 23 matching lines...) Expand all
44 fMutex->assertHeld(); 51 fMutex->assertHeld();
45 } 52 }
46 53
47 private: 54 private:
48 SkBaseMutex* fMutex; 55 SkBaseMutex* fMutex;
49 }; 56 };
50 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire) 57 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire)
51 58
52 59
53 #endif//SkMutex_DEFINED 60 #endif//SkMutex_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkAtomics.h ('k') | include/core/SkRefCnt.h » ('j') | include/core/SkRefCnt.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698