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

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 2774473003: Simplify pre+post GC ThreadState steps. (Closed)
Patch Set: Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 } // namespace WTF 274 } // namespace WTF
275 275
276 namespace blink { 276 namespace blink {
277 277
278 class TestGCScope { 278 class TestGCScope {
279 public: 279 public:
280 explicit TestGCScope(BlinkGC::StackState state) 280 explicit TestGCScope(BlinkGC::StackState state)
281 : m_state(ThreadState::current()), m_safePointScope(state) { 281 : m_state(ThreadState::current()), m_safePointScope(state) {
282 ASSERT(m_state->checkThread()); 282 ASSERT(m_state->checkThread());
283 m_state->heap().preGC(); 283 m_state->preGC();
284 } 284 }
285 285
286 ~TestGCScope() { 286 ~TestGCScope() {
287 m_state->heap().postGC(BlinkGC::GCWithSweep); 287 m_state->postGC(BlinkGC::GCWithSweep);
288 m_state->heap().preSweep(BlinkGC::GCWithSweep); 288 m_state->preSweep(BlinkGC::GCWithSweep);
289 } 289 }
290 290
291 private: 291 private:
292 ThreadState* m_state; 292 ThreadState* m_state;
293 SafePointScope m_safePointScope; 293 SafePointScope m_safePointScope;
294 }; 294 };
295 295
296 class SimpleObject : public GarbageCollected<SimpleObject> { 296 class SimpleObject : public GarbageCollected<SimpleObject> {
297 public: 297 public:
298 static SimpleObject* create() { return new SimpleObject(); } 298 static SimpleObject* create() { return new SimpleObject(); }
(...skipping 6046 matching lines...) Expand 10 before | Expand all | Expand 10 after
6345 "HeapVector"); 6345 "HeapVector");
6346 static_assert( 6346 static_assert(
6347 WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::value, 6347 WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::value,
6348 "HeapDeque"); 6348 "HeapDeque");
6349 static_assert(WTF::IsGarbageCollectedType< 6349 static_assert(WTF::IsGarbageCollectedType<
6350 HeapTerminatedArray<Member<IntWrapper>>>::value, 6350 HeapTerminatedArray<Member<IntWrapper>>>::value,
6351 "HeapTerminatedArray"); 6351 "HeapTerminatedArray");
6352 } 6352 }
6353 6353
6354 } // namespace blink 6354 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698