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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: Created 4 years 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #include "core/dom/ElementCreationOptions.h" 81 #include "core/dom/ElementCreationOptions.h"
82 #include "core/dom/ElementDataCache.h" 82 #include "core/dom/ElementDataCache.h"
83 #include "core/dom/ElementRegistrationOptions.h" 83 #include "core/dom/ElementRegistrationOptions.h"
84 #include "core/dom/ElementTraversal.h" 84 #include "core/dom/ElementTraversal.h"
85 #include "core/dom/ExceptionCode.h" 85 #include "core/dom/ExceptionCode.h"
86 #include "core/dom/ExecutionContextTask.h" 86 #include "core/dom/ExecutionContextTask.h"
87 #include "core/dom/FrameRequestCallback.h" 87 #include "core/dom/FrameRequestCallback.h"
88 #include "core/dom/IntersectionObserverController.h" 88 #include "core/dom/IntersectionObserverController.h"
89 #include "core/dom/LayoutTreeBuilderTraversal.h" 89 #include "core/dom/LayoutTreeBuilderTraversal.h"
90 #include "core/dom/MainThreadTaskRunner.h" 90 #include "core/dom/MainThreadTaskRunner.h"
91 #include "core/dom/ModuleMap.h"
91 #include "core/dom/MutationObserver.h" 92 #include "core/dom/MutationObserver.h"
92 #include "core/dom/NodeChildRemovalTracker.h" 93 #include "core/dom/NodeChildRemovalTracker.h"
93 #include "core/dom/NodeComputedStyle.h" 94 #include "core/dom/NodeComputedStyle.h"
94 #include "core/dom/NodeFilter.h" 95 #include "core/dom/NodeFilter.h"
95 #include "core/dom/NodeIntersectionObserverData.h" 96 #include "core/dom/NodeIntersectionObserverData.h"
96 #include "core/dom/NodeIterator.h" 97 #include "core/dom/NodeIterator.h"
97 #include "core/dom/NodeRareData.h" 98 #include "core/dom/NodeRareData.h"
98 #include "core/dom/NodeTraversal.h" 99 #include "core/dom/NodeTraversal.h"
99 #include "core/dom/NodeWithIndex.h" 100 #include "core/dom/NodeWithIndex.h"
100 #include "core/dom/NthIndexCache.h" 101 #include "core/dom/NthIndexCache.h"
(...skipping 6334 matching lines...) Expand 10 before | Expand all | Expand 10 after
6435 return LayoutViewItem(m_layoutView); 6436 return LayoutViewItem(m_layoutView);
6436 } 6437 }
6437 6438
6438 PropertyRegistry* Document::propertyRegistry() { 6439 PropertyRegistry* Document::propertyRegistry() {
6439 // TODO(timloh): When the flag is removed, return a reference instead. 6440 // TODO(timloh): When the flag is removed, return a reference instead.
6440 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled()) 6441 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled())
6441 m_propertyRegistry = PropertyRegistry::create(); 6442 m_propertyRegistry = PropertyRegistry::create();
6442 return m_propertyRegistry; 6443 return m_propertyRegistry;
6443 } 6444 }
6444 6445
6446 ModuleMap* Document::ensureModuleMap() {
6447 if (!RuntimeEnabledFeatures::moduleScriptsEnabled())
6448 return nullptr;
6449
6450 if (!m_moduleMap) {
6451 m_moduleMap = ModuleMap::create(fetcher());
6452 }
6453
6454 return m_moduleMap;
6455 }
6456
6445 void Document::incrementPasswordCount() { 6457 void Document::incrementPasswordCount() {
6446 ++m_passwordCount; 6458 ++m_passwordCount;
6447 if (isSecureContext() || m_passwordCount != 1) { 6459 if (isSecureContext() || m_passwordCount != 1) {
6448 // The browser process only cares about passwords on pages where the 6460 // The browser process only cares about passwords on pages where the
6449 // top-level URL is not secure. Secure contexts must have a top-level 6461 // top-level URL is not secure. Secure contexts must have a top-level
6450 // URL that is secure, so there is no need to send notifications for 6462 // URL that is secure, so there is no need to send notifications for
6451 // password fields in secure contexts. 6463 // password fields in secure contexts.
6452 // 6464 //
6453 // Also, only send a message on the first visible password field; the 6465 // Also, only send a message on the first visible password field; the
6454 // browser process doesn't care about the presence of additional 6466 // browser process doesn't care about the presence of additional
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
6516 visitor->trace(m_timeline); 6528 visitor->trace(m_timeline);
6517 visitor->trace(m_compositorPendingAnimations); 6529 visitor->trace(m_compositorPendingAnimations);
6518 visitor->trace(m_contextDocument); 6530 visitor->trace(m_contextDocument);
6519 visitor->trace(m_canvasFontCache); 6531 visitor->trace(m_canvasFontCache);
6520 visitor->trace(m_intersectionObserverController); 6532 visitor->trace(m_intersectionObserverController);
6521 visitor->trace(m_intersectionObserverData); 6533 visitor->trace(m_intersectionObserverData);
6522 visitor->trace(m_snapCoordinator); 6534 visitor->trace(m_snapCoordinator);
6523 visitor->trace(m_resizeObserverController); 6535 visitor->trace(m_resizeObserverController);
6524 visitor->trace(m_propertyRegistry); 6536 visitor->trace(m_propertyRegistry);
6525 visitor->trace(m_styleReattachDataMap); 6537 visitor->trace(m_styleReattachDataMap);
6538 visitor->trace(m_moduleMap);
6526 Supplementable<Document>::trace(visitor); 6539 Supplementable<Document>::trace(visitor);
6527 TreeScope::trace(visitor); 6540 TreeScope::trace(visitor);
6528 ContainerNode::trace(visitor); 6541 ContainerNode::trace(visitor);
6529 ExecutionContext::trace(visitor); 6542 ExecutionContext::trace(visitor);
6530 SecurityContext::trace(visitor); 6543 SecurityContext::trace(visitor);
6531 SynchronousMutationNotifier::trace(visitor); 6544 SynchronousMutationNotifier::trace(visitor);
6532 } 6545 }
6533 6546
6534 void Document::maybeRecordLoadReason(WouldLoadReason reason) { 6547 void Document::maybeRecordLoadReason(WouldLoadReason reason) {
6535 DCHECK(m_wouldLoadReason == Created || reason != Created); 6548 DCHECK(m_wouldLoadReason == Created || reason != Created);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
6571 } 6584 }
6572 6585
6573 void showLiveDocumentInstances() { 6586 void showLiveDocumentInstances() {
6574 WeakDocumentSet& set = liveDocumentSet(); 6587 WeakDocumentSet& set = liveDocumentSet();
6575 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6588 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6576 for (Document* document : set) 6589 for (Document* document : set)
6577 fprintf(stderr, "- Document %p URL: %s\n", document, 6590 fprintf(stderr, "- Document %p URL: %s\n", document,
6578 document->url().getString().utf8().data()); 6591 document->url().getString().utf8().data());
6579 } 6592 }
6580 #endif 6593 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698