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

Unified Diff: third_party/WebKit/Source/core/timing/Performance.cpp

Issue 2668753006: Special-case LocalDOMWindow for same-origin access in bindings. (Closed)
Patch Set: . Created 3 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
Index: third_party/WebKit/Source/core/timing/Performance.cpp
diff --git a/third_party/WebKit/Source/core/timing/Performance.cpp b/third_party/WebKit/Source/core/timing/Performance.cpp
index 1268af74dea9766c2a8dd56aa5082710f4045297..4d4c7aff5290929a4d8e021f12dd9ded83e68b8b 100644
--- a/third_party/WebKit/Source/core/timing/Performance.cpp
+++ b/third_party/WebKit/Source/core/timing/Performance.cpp
@@ -186,7 +186,7 @@ static bool canAccessOrigin(Frame* frame1, Frame* frame2) {
std::pair<String, DOMWindow*> Performance::sanitizedAttribution(
ExecutionContext* taskContext,
bool hasMultipleContexts,
- Frame* observerFrame) {
+ LocalFrame* observerFrame) {
if (hasMultipleContexts) {
// Unable to attribute, multiple script execution contents were involved.
return std::make_pair(kAmbiguousAttribution, nullptr);
@@ -237,12 +237,13 @@ void Performance::reportLongTask(double startTime,
std::pair<String, DOMWindow*> attribution = Performance::sanitizedAttribution(
taskContext, hasMultipleContexts, frame());
DOMWindow* culpritDomWindow = attribution.second;
- if (!culpritDomWindow || !culpritDomWindow->document() ||
- !culpritDomWindow->document()->localOwner()) {
- addLongTaskTiming(startTime, endTime, attribution.first, "", "", "");
+ if (!culpritDomWindow || !culpritDomWindow->frame() ||
+ !culpritDomWindow->frame()->deprecatedLocalOwner()) {
+ addLongTaskTiming(startTime, endTime, attribution.first, emptyString(),
+ emptyString(), emptyString());
dcheng 2017/02/01 07:22:59 To avoid constructing three new empty strings.
} else {
HTMLFrameOwnerElement* frameOwner =
- culpritDomWindow->document()->localOwner();
+ culpritDomWindow->frame()->deprecatedLocalOwner();
addLongTaskTiming(startTime, endTime, attribution.first,
getFrameAttribute(frameOwner, HTMLNames::srcAttr, false),
getFrameAttribute(frameOwner, HTMLNames::idAttr, false),

Powered by Google App Engine
This is Rietveld 408576698