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

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2726593002: Use mayNotBeMainThread() for wrapper optimization (Closed)
Patch Set: Use V8TestingScope 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after
2517 case Node::kDocumentFragmentNode: 2517 case Node::kDocumentFragmentNode:
2518 return toContainerNode(this)->countChildren(); 2518 return toContainerNode(this)->countChildren();
2519 case Node::kAttributeNode: 2519 case Node::kAttributeNode:
2520 case Node::kDocumentTypeNode: 2520 case Node::kDocumentTypeNode:
2521 return 0; 2521 return 0;
2522 } 2522 }
2523 NOTREACHED(); 2523 NOTREACHED();
2524 return 0; 2524 return 0;
2525 } 2525 }
2526 2526
2527 DISABLE_CFI_PERF
2528 v8::Local<v8::Object> Node::wrap(v8::Isolate* isolate,
2529 v8::Local<v8::Object> creationContext) {
2530 DCHECK(!DOMDataStore::containsWrapper(this, isolate));
2531
2532 const WrapperTypeInfo* wrapperType = wrapperTypeInfo();
2533
2534 v8::Local<v8::Object> wrapper =
2535 V8DOMWrapper::createWrapper(isolate, creationContext, wrapperType);
2536 DCHECK(!wrapper.IsEmpty());
2537 return associateWithWrapper(isolate, wrapperType, wrapper);
2538 }
2539
2540 v8::Local<v8::Object> Node::associateWithWrapper(
2541 v8::Isolate* isolate,
2542 const WrapperTypeInfo* wrapperType,
2543 v8::Local<v8::Object> wrapper) {
2544 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
2545 wrapper);
2546 }
2547
2548 } // namespace blink 2527 } // namespace blink
2549 2528
2550 #ifndef NDEBUG 2529 #ifndef NDEBUG
2551 2530
2552 void showNode(const blink::Node* node) { 2531 void showNode(const blink::Node* node) {
2553 if (node) 2532 if (node)
2554 LOG(INFO) << *node; 2533 LOG(INFO) << *node;
2555 else 2534 else
2556 LOG(INFO) << "Cannot showNode for <null>"; 2535 LOG(INFO) << "Cannot showNode for <null>";
2557 } 2536 }
2558 2537
2559 void showTree(const blink::Node* node) { 2538 void showTree(const blink::Node* node) {
2560 if (node) 2539 if (node)
2561 LOG(INFO) << "\n" << node->toTreeStringForThis().utf8().data(); 2540 LOG(INFO) << "\n" << node->toTreeStringForThis().utf8().data();
2562 else 2541 else
2563 LOG(INFO) << "Cannot showTree for <null>"; 2542 LOG(INFO) << "Cannot showTree for <null>";
2564 } 2543 }
2565 2544
2566 void showNodePath(const blink::Node* node) { 2545 void showNodePath(const blink::Node* node) {
2567 if (node) { 2546 if (node) {
2568 std::stringstream stream; 2547 std::stringstream stream;
2569 node->printNodePathTo(stream); 2548 node->printNodePathTo(stream);
2570 LOG(INFO) << stream.str(); 2549 LOG(INFO) << stream.str();
2571 } else { 2550 } else {
2572 LOG(INFO) << "Cannot showNodePath for <null>"; 2551 LOG(INFO) << "Cannot showNodePath for <null>";
2573 } 2552 }
2574 } 2553 }
2575 2554
2576 #endif 2555 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/RangeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698