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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2702213004: Add security checks to scheduled actions (Closed)
Patch Set: updates 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 "No history item is available."); 890 "No history item is available.");
891 return; 891 return;
892 } 892 }
893 mainItem->clearDocumentState(); 893 mainItem->clearDocumentState();
894 mainItem->setDocumentState(state); 894 mainItem->setDocumentState(state);
895 } 895 }
896 896
897 DOMWindow* Internals::pagePopupWindow() const { 897 DOMWindow* Internals::pagePopupWindow() const {
898 if (!m_document) 898 if (!m_document)
899 return nullptr; 899 return nullptr;
900 if (Page* page = m_document->page()) 900 if (Page* page = m_document->page()) {
901 return page->chromeClient().pagePopupWindowForTesting(); 901 LocalDOMWindow* popup =
902 toLocalDOMWindow(page->chromeClient().pagePopupWindowForTesting());
903 if (popup) {
904 // We need to make the popup same origin so layout tests can access it.
905 popup->document()->setSecurityOrigin(m_document->getSecurityOrigin());
906 }
907 return popup;
908 }
902 return nullptr; 909 return nullptr;
903 } 910 }
904 911
905 ClientRect* Internals::absoluteCaretBounds(ExceptionState& exceptionState) { 912 ClientRect* Internals::absoluteCaretBounds(ExceptionState& exceptionState) {
906 if (!frame()) { 913 if (!frame()) {
907 exceptionState.throwDOMException( 914 exceptionState.throwDOMException(
908 InvalidAccessError, "The document's frame cannot be retrieved."); 915 InvalidAccessError, "The document's frame cannot be retrieved.");
909 return ClientRect::create(); 916 return ClientRect::create();
910 } 917 }
911 918
(...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after
3147 3154
3148 void Internals::crash() { 3155 void Internals::crash() {
3149 CHECK(false) << "Intentional crash"; 3156 CHECK(false) << "Intentional crash";
3150 } 3157 }
3151 3158
3152 void Internals::setIsLowEndDevice(bool isLowEndDevice) { 3159 void Internals::setIsLowEndDevice(bool isLowEndDevice) {
3153 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); 3160 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice);
3154 } 3161 }
3155 3162
3156 } // namespace blink 3163 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698