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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2101283002: Add crash keys to LocalDOMWindow to help diagnose bug 621730. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 4 years, 5 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
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "core/page/CreateWindow.h" 72 #include "core/page/CreateWindow.h"
73 #include "core/page/Page.h" 73 #include "core/page/Page.h"
74 #include "core/page/WindowFeatures.h" 74 #include "core/page/WindowFeatures.h"
75 #include "core/page/scrolling/ScrollingCoordinator.h" 75 #include "core/page/scrolling/ScrollingCoordinator.h"
76 #include "platform/EventDispatchForbiddenScope.h" 76 #include "platform/EventDispatchForbiddenScope.h"
77 #include "platform/weborigin/SecurityOrigin.h" 77 #include "platform/weborigin/SecurityOrigin.h"
78 #include "platform/weborigin/Suborigin.h" 78 #include "platform/weborigin/Suborigin.h"
79 #include "public/platform/Platform.h" 79 #include "public/platform/Platform.h"
80 #include "public/platform/WebFrameScheduler.h" 80 #include "public/platform/WebFrameScheduler.h"
81 #include "public/platform/WebScreenInfo.h" 81 #include "public/platform/WebScreenInfo.h"
82 #include "wtf/debug/CrashLogging.h"
82 #include <memory> 83 #include <memory>
83 84
84 namespace blink { 85 namespace blink {
85 86
86 // Rather than simply inheriting LocalFrameLifecycleObserver like most other 87 // Rather than simply inheriting LocalFrameLifecycleObserver like most other
87 // classes, LocalDOMWindow hides its LocalFrameLifecycleObserver with 88 // classes, LocalDOMWindow hides its LocalFrameLifecycleObserver with
88 // composition. This prevents conflicting overloads between DOMWindow, which 89 // composition. This prevents conflicting overloads between DOMWindow, which
89 // has a frame() accessor that returns Frame* for bindings code, and 90 // has a frame() accessor that returns Frame* for bindings code, and
90 // LocalFrameLifecycleObserver, which has a frame() accessor that returns a 91 // LocalFrameLifecycleObserver, which has a frame() accessor that returns a
91 // LocalFrame*. 92 // LocalFrame*.
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 void LocalDOMWindow::postMessageTimerFired(PostMessageTimer* timer) 681 void LocalDOMWindow::postMessageTimerFired(PostMessageTimer* timer)
681 { 682 {
682 if (!isCurrentlyDisplayedInFrame()) 683 if (!isCurrentlyDisplayedInFrame())
683 return; 684 return;
684 685
685 MessageEvent* event = timer->event(); 686 MessageEvent* event = timer->event();
686 687
687 UserGestureIndicator gestureIndicator(timer->userGestureToken()); 688 UserGestureIndicator gestureIndicator(timer->userGestureToken());
688 689
689 event->entangleMessagePorts(document()); 690 event->entangleMessagePorts(document());
691
692 // Temporary instrumentation for http://crbug.com/621730.
693 WTF::debug::ScopedCrashKey("postmessage_src_origin", event->origin().utf8(). data());
694 WTF::debug::ScopedCrashKey("postmessage_dst_origin", document()->getSecurity Origin()->toRawString().utf8().data());
695 WTF::debug::ScopedCrashKey("postmessage_dst_url", document()->url().getStrin g().utf8().data());
696
690 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->tak eLocation()); 697 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->tak eLocation());
691 } 698 }
692 699
693 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer) 700 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer)
694 { 701 {
695 m_postMessageTimers.remove(timer); 702 m_postMessageTimers.remove(timer);
696 } 703 }
697 704
698 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, Event* event, std::unique_ptr<SourceLocation> location) 705 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, Event* event, std::unique_ptr<SourceLocation> location)
699 { 706 {
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 { 1557 {
1551 // If the LocalDOMWindow still has a frame reference, that frame must point 1558 // If the LocalDOMWindow still has a frame reference, that frame must point
1552 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1559 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1553 // where script execution leaks between different LocalDOMWindows. 1560 // where script execution leaks between different LocalDOMWindows.
1554 if (m_frameObserver->frame()) 1561 if (m_frameObserver->frame())
1555 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1562 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1556 return m_frameObserver->frame(); 1563 return m_frameObserver->frame();
1557 } 1564 }
1558 1565
1559 } // namespace blink 1566 } // namespace blink
OLDNEW
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698