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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1561663003: CL for perf tryjob on win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 316ab46c290824bdda94c157bfd1b715590322bb..e1f930bdc0bbd25d12acc47fb7bd4eea8473efbc 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2517,6 +2517,8 @@ void Element::setInnerHTML(const String& html, ExceptionState& exceptionState)
container = toHTMLTemplateElement(this)->content();
replaceChildrenWithFragment(container, fragment.release(), exceptionState);
}
+
+ taintElementIfFromIsolatedWorld();
}
void Element::setOuterHTML(const String& html, ExceptionState& exceptionState)
@@ -2546,6 +2548,11 @@ void Element::setOuterHTML(const String& html, ExceptionState& exceptionState)
if (!exceptionState.hadException() && prev && prev->isTextNode())
mergeWithNextTextNode(toText(prev.get()), exceptionState);
+
+ if (node && node->isElementNode())
+ toElement(node)->taintElementIfFromIsolatedWorld();
+ else
+ parent->taintElementIfFromIsolatedWorld();
}
Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionState& exceptionState)
@@ -3616,6 +3623,16 @@ void Element::logUpdateAttributeIfIsolatedWorldAndInDocument(const char element[
activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data());
}
+void Element::taintElementIfFromIsolatedWorld()
+{
+ ASSERT(v8::Isolate::GetCurrent()->InContext());
+ DOMWrapperWorld& currentWorld = DOMWrapperWorld::current(v8::Isolate::GetCurrent());
+ if (currentWorld.isOfIsolatedWorldOrigin()) {
+ TrackExceptionState exceptionState;
+ this->setAttribute("extension-attribution", WebString(String::number(currentWorld.originWorldId())), exceptionState);
+ }
+}
+
DEFINE_TRACE(Element)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698