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

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

Issue 2668753006: Special-case LocalDOMWindow for same-origin access in bindings. (Closed)
Patch Set: Rebase and address comments. Created 3 years, 10 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..b5a7447cdce29c10697f4262a00d1ffec3e74041 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);
} else {
HTMLFrameOwnerElement* frameOwner =
- culpritDomWindow->document()->localOwner();
+ culpritDomWindow->frame()->deprecatedLocalOwner();
addLongTaskTiming(startTime, endTime, attribution.first,
getFrameAttribute(frameOwner, HTMLNames::srcAttr, false),
getFrameAttribute(frameOwner, HTMLNames::idAttr, false),
« no previous file with comments | « third_party/WebKit/Source/core/timing/Performance.h ('k') | third_party/WebKit/Source/core/timing/PerformanceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698