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

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

Issue 2011783002: Rename OwnPtr::clear() to reset() in platform/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/animation/CompositorFilterKeyframe.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 "platform/WebThreadSupportingGC.h" 5 #include "platform/WebThreadSupportingGC.h"
6 6
7 #include "platform/heap/SafePoint.h" 7 #include "platform/heap/SafePoint.h"
8 #include "public/platform/WebScheduler.h" 8 #include "public/platform/WebScheduler.h"
9 #include "wtf/Threading.h" 9 #include "wtf/Threading.h"
10 10
(...skipping 24 matching lines...) Expand all
35 m_owningThread = adoptPtr(Platform::current()->createThread(name)); 35 m_owningThread = adoptPtr(Platform::current()->createThread(name));
36 m_thread = m_owningThread.get(); 36 m_thread = m_owningThread.get();
37 } 37 }
38 } 38 }
39 39
40 WebThreadSupportingGC::~WebThreadSupportingGC() 40 WebThreadSupportingGC::~WebThreadSupportingGC()
41 { 41 {
42 if (ThreadState::current() && m_owningThread) { 42 if (ThreadState::current() && m_owningThread) {
43 // WebThread's destructor blocks until all the tasks are processed. 43 // WebThread's destructor blocks until all the tasks are processed.
44 SafePointScope scope(BlinkGC::HeapPointersOnStack); 44 SafePointScope scope(BlinkGC::HeapPointersOnStack);
45 m_owningThread.clear(); 45 m_owningThread.reset();
46 } 46 }
47 } 47 }
48 48
49 void WebThreadSupportingGC::initialize() 49 void WebThreadSupportingGC::initialize()
50 { 50 {
51 ThreadState::attachCurrentThread(m_perThreadHeapEnabled); 51 ThreadState::attachCurrentThread(m_perThreadHeapEnabled);
52 m_gcTaskRunner = adoptPtr(new GCTaskRunner(m_thread)); 52 m_gcTaskRunner = adoptPtr(new GCTaskRunner(m_thread));
53 } 53 }
54 54
55 void WebThreadSupportingGC::shutdown() 55 void WebThreadSupportingGC::shutdown()
56 { 56 {
57 #if defined(LEAK_SANITIZER) 57 #if defined(LEAK_SANITIZER)
58 ThreadState::current()->releaseStaticPersistentNodes(); 58 ThreadState::current()->releaseStaticPersistentNodes();
59 #endif 59 #endif
60 // Ensure no posted tasks will run from this point on. 60 // Ensure no posted tasks will run from this point on.
61 m_gcTaskRunner.clear(); 61 m_gcTaskRunner.reset();
62 62
63 // Shutdown the thread (via its scheduler) only when the thread is created 63 // Shutdown the thread (via its scheduler) only when the thread is created
64 // and is owned by this instance. 64 // and is owned by this instance.
65 if (m_owningThread) 65 if (m_owningThread)
66 m_owningThread->scheduler()->shutdown(); 66 m_owningThread->scheduler()->shutdown();
67 67
68 ThreadState::detachCurrentThread(); 68 ThreadState::detachCurrentThread();
69 } 69 }
70 70
71 } // namespace blink 71 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/animation/CompositorFilterKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698