Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 // Remove this once we remove RefPtrWillBeMember. | 312 // Remove this once we remove RefPtrWillBeMember. |
| 313 template<typename T> | 313 template<typename T> |
| 314 void trace(const RefPtr<T>&) | 314 void trace(const RefPtr<T>&) |
| 315 { | 315 { |
| 316 #if ENABLE(OILPAN) | 316 #if ENABLE(OILPAN) |
| 317 // RefPtrs should never be traced. | 317 // RefPtrs should never be traced. |
| 318 ASSERT_NOT_REACHED(); | 318 ASSERT_NOT_REACHED(); |
| 319 #endif | 319 #endif |
| 320 } | 320 } |
| 321 | 321 |
| 322 // Similarly, this trace method is to trace a RawPtrWillBeMember | |
| 323 // when ENABLE(OILPAN) is not enabled. | |
| 324 // Remove this once we remove RawPtrWillBeMember. | |
| 325 template<typename T> | |
| 326 void trace(const RawPtr<T>&) | |
| 327 { | |
| 328 #if ENABLE(OILPAN) | |
| 329 // RawPtrs should never be traced. | |
| 330 ASSERT_NOT_REACHED(); | |
|
Vyacheslav Egorov (Chromium)
2014/02/14 14:01:42
This should never be instantiated when ENABLE(OILP
sof
2014/02/16 20:29:15
Good idea, https://codereview.chromium.org/1674430
| |
| 331 #endif | |
| 332 } | |
| 333 | |
| 322 // This method marks an object and adds it to the set of objects | 334 // This method marks an object and adds it to the set of objects |
| 323 // that should have their trace method called. Since not all | 335 // that should have their trace method called. Since not all |
| 324 // objects have vtables we have to have the callback as an | 336 // objects have vtables we have to have the callback as an |
| 325 // explicit argument, but we can use the templated one-argument | 337 // explicit argument, but we can use the templated one-argument |
| 326 // mark method above to automatically provide the callback | 338 // mark method above to automatically provide the callback |
| 327 // function. | 339 // function. |
| 328 virtual void mark(const void*, TraceCallback) = 0; | 340 virtual void mark(const void*, TraceCallback) = 0; |
| 329 | 341 |
| 330 // Used to mark objects during conservative scanning. | 342 // Used to mark objects during conservative scanning. |
| 331 virtual void mark(HeapObjectHeader*, TraceCallback) = 0; | 343 virtual void mark(HeapObjectHeader*, TraceCallback) = 0; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 return visitor->isMarked(obj); | 543 return visitor->isMarked(obj); |
| 532 } | 544 } |
| 533 template<typename T> bool ObjectAliveTrait<Member<T> >::isAlive(Visitor* visitor , const Member<T>& obj) | 545 template<typename T> bool ObjectAliveTrait<Member<T> >::isAlive(Visitor* visitor , const Member<T>& obj) |
| 534 { | 546 { |
| 535 return visitor->isMarked(obj.get()); | 547 return visitor->isMarked(obj.get()); |
| 536 } | 548 } |
| 537 | 549 |
| 538 } | 550 } |
| 539 | 551 |
| 540 #endif | 552 #endif |
| OLD | NEW |