| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // We only care about a group if it has more than one object. If it only | 449 // We only care about a group if it has more than one object. If it only |
| 450 // has one object, it has nothing else that needs to be kept alive. | 450 // has one object, it has nothing else that needs to be kept alive. |
| 451 if (next_key_index - i <= 1) { | 451 if (next_key_index - i <= 1) { |
| 452 i = next_key_index; | 452 i = next_key_index; |
| 453 continue; | 453 continue; |
| 454 } | 454 } |
| 455 | 455 |
| 456 Vector<v8::Persistent<v8::Value> > group; | 456 Vector<v8::Persistent<v8::Value> > group; |
| 457 group.reserveCapacity(next_key_index - i); | 457 group.reserveCapacity(next_key_index - i); |
| 458 for (; i < next_key_index; ++i) { | 458 for (; i < next_key_index; ++i) { |
| 459 Node* node = grouper[i].second; |
| 459 v8::Persistent<v8::Value> wrapper = | 460 v8::Persistent<v8::Value> wrapper = |
| 460 getDOMNodeMap().get(grouper[i].second); | 461 getDOMNodeMap().get(node); |
| 461 if (!wrapper.IsEmpty()) | 462 if (!wrapper.IsEmpty()) |
| 462 group.append(wrapper); | 463 group.append(wrapper); |
| 464 // If the node is styled and there is a wrapper for the inline |
| 465 // style declaration, we need to keep that style declaration |
| 466 // wrapper alive as well, so we add it to the object group. |
| 467 if (node->isStyledElement()) { |
| 468 StyledElement* element = reinterpret_cast<StyledElement*>(node); |
| 469 CSSStyleDeclaration* style = element->inlineStyleDecl(); |
| 470 if (style != NULL) { |
| 471 wrapper = getDOMObjectMap().get(style); |
| 472 if (!wrapper.IsEmpty()) |
| 473 group.append(wrapper); |
| 474 } |
| 475 } |
| 463 } | 476 } |
| 464 | 477 |
| 465 if (group.size() > 1) | 478 if (group.size() > 1) |
| 466 v8::V8::AddObjectGroup(&group[0], group.size()); | 479 v8::V8::AddObjectGroup(&group[0], group.size()); |
| 467 | 480 |
| 468 ASSERT(i == next_key_index); | 481 ASSERT(i == next_key_index); |
| 469 } | 482 } |
| 470 } | 483 } |
| 471 | 484 |
| 472 | 485 |
| (...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3293 } | 3306 } |
| 3294 | 3307 |
| 3295 void V8Proxy::RegisterExtension(v8::Extension* extension, | 3308 void V8Proxy::RegisterExtension(v8::Extension* extension, |
| 3296 const String& schemeRestriction) { | 3309 const String& schemeRestriction) { |
| 3297 v8::RegisterExtension(extension); | 3310 v8::RegisterExtension(extension); |
| 3298 V8ExtensionInfo info = {schemeRestriction, extension}; | 3311 V8ExtensionInfo info = {schemeRestriction, extension}; |
| 3299 m_extensions.push_back(info); | 3312 m_extensions.push_back(info); |
| 3300 } | 3313 } |
| 3301 | 3314 |
| 3302 } // namespace WebCore | 3315 } // namespace WebCore |
| OLD | NEW |