| OLD | NEW |
| 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 "RecordInfo.h" | 6 #include "RecordInfo.h" |
| 7 | 7 |
| 8 using namespace clang; | 8 using namespace clang; |
| 9 using std::string; | 9 using std::string; |
| 10 | 10 |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 if (Edge* ptr = CreateEdge(args[0])) | 517 if (Edge* ptr = CreateEdge(args[0])) |
| 518 return new WeakMember(ptr); | 518 return new WeakMember(ptr); |
| 519 return 0; | 519 return 0; |
| 520 } | 520 } |
| 521 | 521 |
| 522 if (Config::IsPersistent(info->name())) { | 522 if (Config::IsPersistent(info->name())) { |
| 523 // Persistent might refer to v8::Persistent, so check the name space. | 523 // Persistent might refer to v8::Persistent, so check the name space. |
| 524 // TODO: Consider using a more canonical identification than names. | 524 // TODO: Consider using a more canonical identification than names. |
| 525 NamespaceDecl* ns = | 525 NamespaceDecl* ns = |
| 526 dyn_cast<NamespaceDecl>(info->record()->getDeclContext()); | 526 dyn_cast<NamespaceDecl>(info->record()->getDeclContext()); |
| 527 if (!ns || ns->getName() != "WebCore") | 527 if (!ns || ns->getName() != "blink") |
| 528 return 0; | 528 return 0; |
| 529 if (!info->GetTemplateArgs(1, &args)) | 529 if (!info->GetTemplateArgs(1, &args)) |
| 530 return 0; | 530 return 0; |
| 531 if (Edge* ptr = CreateEdge(args[0])) | 531 if (Edge* ptr = CreateEdge(args[0])) |
| 532 return new Persistent(ptr); | 532 return new Persistent(ptr); |
| 533 return 0; | 533 return 0; |
| 534 } | 534 } |
| 535 | 535 |
| 536 if (Config::IsGCCollection(info->name()) || | 536 if (Config::IsGCCollection(info->name()) || |
| 537 Config::IsWTFCollection(info->name())) { | 537 Config::IsWTFCollection(info->name())) { |
| 538 bool is_root = Config::IsPersistentGCCollection(info->name()); | 538 bool is_root = Config::IsPersistentGCCollection(info->name()); |
| 539 bool on_heap = is_root || info->IsHeapAllocatedCollection(); | 539 bool on_heap = is_root || info->IsHeapAllocatedCollection(); |
| 540 size_t count = Config::CollectionDimension(info->name()); | 540 size_t count = Config::CollectionDimension(info->name()); |
| 541 if (!info->GetTemplateArgs(count, &args)) | 541 if (!info->GetTemplateArgs(count, &args)) |
| 542 return 0; | 542 return 0; |
| 543 Collection* edge = new Collection(info, on_heap, is_root); | 543 Collection* edge = new Collection(info, on_heap, is_root); |
| 544 for (TemplateArgs::iterator it = args.begin(); it != args.end(); ++it) { | 544 for (TemplateArgs::iterator it = args.begin(); it != args.end(); ++it) { |
| 545 if (Edge* member = CreateEdge(*it)) { | 545 if (Edge* member = CreateEdge(*it)) { |
| 546 edge->members().push_back(member); | 546 edge->members().push_back(member); |
| 547 } | 547 } |
| 548 // TODO: Handle the case where we fail to create an edge (eg, if the | 548 // TODO: Handle the case where we fail to create an edge (eg, if the |
| 549 // argument is a primitive type or just not fully known yet). | 549 // argument is a primitive type or just not fully known yet). |
| 550 } | 550 } |
| 551 return edge; | 551 return edge; |
| 552 } | 552 } |
| 553 | 553 |
| 554 return new Value(info); | 554 return new Value(info); |
| 555 } | 555 } |
| OLD | NEW |