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

Side by Side Diff: Source/platform/WebThreadSupportingGC.cpp

Issue 874203002: Add a thread-safety assertion in DEFINE_STATIC_LOCAL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/webdatabase/Database.cpp ('k') | Source/wtf/MainThread.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/WebThreadSupportingGC.h" 6 #include "platform/WebThreadSupportingGC.h"
7 7
8 #include "wtf/Threading.h"
9
8 namespace blink { 10 namespace blink {
9 11
10 PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::create(const char* name ) 12 PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::create(const char* name )
11 { 13 {
14 #if ENABLE(ASSERT)
15 WTF::willCreateThread();
kinuko 2015/01/27 14:50:37 Adding a hook here feels a bit slippery, suggestio
16 #endif
12 return adoptPtr(new WebThreadSupportingGC(name)); 17 return adoptPtr(new WebThreadSupportingGC(name));
13 } 18 }
14 19
15 WebThreadSupportingGC::WebThreadSupportingGC(const char* name) 20 WebThreadSupportingGC::WebThreadSupportingGC(const char* name)
16 : m_thread(adoptPtr(Platform::current()->createThread(name))) 21 : m_thread(adoptPtr(Platform::current()->createThread(name)))
17 { 22 {
18 } 23 }
19 24
20 WebThreadSupportingGC::~WebThreadSupportingGC() 25 WebThreadSupportingGC::~WebThreadSupportingGC()
21 { 26 {
(...skipping 16 matching lines...) Expand all
38 void WebThreadSupportingGC::detachGC() 43 void WebThreadSupportingGC::detachGC()
39 { 44 {
40 ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get()); 45 ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get());
41 ThreadState::detach(); 46 ThreadState::detach();
42 platformThread().removeTaskObserver(m_pendingGCRunner.get()); 47 platformThread().removeTaskObserver(m_pendingGCRunner.get());
43 m_pendingGCRunner = nullptr; 48 m_pendingGCRunner = nullptr;
44 m_messageLoopInterruptor = nullptr; 49 m_messageLoopInterruptor = nullptr;
45 } 50 }
46 51
47 } // namespace blink 52 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/Database.cpp ('k') | Source/wtf/MainThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698