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

Side by Side Diff: third_party/WebKit/Source/wtf/ThreadRestrictionVerifier.h

Issue 2458003002: Remove ASSERT_WITH_SECURITY_IMPLICATION. (Closed)
Patch Set: Minor formatting fix Created 4 years, 1 month 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 | « third_party/WebKit/Source/wtf/RefCounted.h ('k') | third_party/WebKit/Source/wtf/Vector.h » ('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 (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // used on a single thread. The thread gets captured when setShared(true) is 44 // used on a single thread. The thread gets captured when setShared(true) is
45 // called. The mode may be changed by calling useMutexMode (or 45 // called. The mode may be changed by calling useMutexMode (or
46 // turnOffVerification). 46 // turnOffVerification).
47 class ThreadRestrictionVerifier { 47 class ThreadRestrictionVerifier {
48 public: 48 public:
49 ThreadRestrictionVerifier() : m_shared(false), m_owningThread(0) {} 49 ThreadRestrictionVerifier() : m_shared(false), m_owningThread(0) {}
50 50
51 void checkSafeToUse() const { 51 void checkSafeToUse() const {
52 // If this assert fires, it either indicates a thread safety issue or 52 // If this assert fires, it either indicates a thread safety issue or
53 // that the verification needs to change. 53 // that the verification needs to change.
54 ASSERT_WITH_SECURITY_IMPLICATION(isSafeToUse()); 54 SECURITY_DCHECK(isSafeToUse());
55 } 55 }
56 56
57 // Call onRef() before refCount is incremented in ref(). 57 // Call onRef() before refCount is incremented in ref().
58 void onRef(int refCount) { 58 void onRef(int refCount) {
59 // Start thread verification as soon as the ref count gets to 2. This 59 // Start thread verification as soon as the ref count gets to 2. This
60 // heuristic reflects the fact that items are often created on one 60 // heuristic reflects the fact that items are often created on one
61 // thread and then given to another thread to be used. 61 // thread and then given to another thread to be used.
62 // FIXME: Make this restriction tigher. Especially as we move to more 62 // FIXME: Make this restriction tigher. Especially as we move to more
63 // common methods for sharing items across threads like 63 // common methods for sharing items across threads like
64 // CrossThreadCopier.h 64 // CrossThreadCopier.h
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 bool m_shared; 105 bool m_shared;
106 106
107 ThreadIdentifier m_owningThread; 107 ThreadIdentifier m_owningThread;
108 }; 108 };
109 109
110 } // namespace WTF 110 } // namespace WTF
111 111
112 #endif // ENABLE(ASSERT) 112 #endif // ENABLE(ASSERT)
113 #endif // ThreadRestrictionVerifier_h 113 #endif // ThreadRestrictionVerifier_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/RefCounted.h ('k') | third_party/WebKit/Source/wtf/Vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698