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

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

Issue 1825323002: bindings: Removes a wrong ASSERT: Exception must be thrown across origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h ('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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/DOMWindow.h" 5 #include "core/frame/DOMWindow.h"
6 6
7 #include "bindings/core/v8/ScriptCallStack.h" 7 #include "bindings/core/v8/ScriptCallStack.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // http://crbug.com/17325 236 // http://crbug.com/17325
237 String DOMWindow::sanitizedCrossDomainAccessErrorMessage(const LocalDOMWindow* c allingWindow) const 237 String DOMWindow::sanitizedCrossDomainAccessErrorMessage(const LocalDOMWindow* c allingWindow) const
238 { 238 {
239 if (!callingWindow || !callingWindow->document() || !frame()) 239 if (!callingWindow || !callingWindow->document() || !frame())
240 return String(); 240 return String();
241 241
242 const KURL& callingWindowURL = callingWindow->document()->url(); 242 const KURL& callingWindowURL = callingWindow->document()->url();
243 if (callingWindowURL.isNull()) 243 if (callingWindowURL.isNull())
244 return String(); 244 return String();
245 245
246 ASSERT(!callingWindow->document()->getSecurityOrigin()->canAccessCheckSubori gins(frame()->securityContext()->getSecurityOrigin()));
247
248 const SecurityOrigin* activeOrigin = callingWindow->document()->getSecurityO rigin(); 246 const SecurityOrigin* activeOrigin = callingWindow->document()->getSecurityO rigin();
249 String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a cross-origin frame."; 247 String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a cross-origin frame.";
250 248
251 // FIXME: Evaluate which details from 'crossDomainAccessErrorMessage' may sa fely be reported to JavaScript. 249 // FIXME: Evaluate which details from 'crossDomainAccessErrorMessage' may sa fely be reported to JavaScript.
252 250
253 return message; 251 return message;
254 } 252 }
255 253
256 String DOMWindow::crossDomainAccessErrorMessage(const LocalDOMWindow* callingWin dow) const 254 String DOMWindow::crossDomainAccessErrorMessage(const LocalDOMWindow* callingWin dow) const
257 { 255 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */ ); 369 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */ );
372 } 370 }
373 371
374 DEFINE_TRACE(DOMWindow) 372 DEFINE_TRACE(DOMWindow)
375 { 373 {
376 visitor->trace(m_location); 374 visitor->trace(m_location);
377 EventTargetWithInlineData::trace(visitor); 375 EventTargetWithInlineData::trace(visitor);
378 } 376 }
379 377
380 } // namespace blink 378 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698