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

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

Issue 1417023006: bindings: Refactors BindingSecurity::shouldAllowAccessToXXX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the assertion condition. Created 5 years 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) 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return; 467 return;
468 468
469 removeAllEventListeners(); 469 removeAllEventListeners();
470 } 470 }
471 471
472 ExecutionContext* LocalDOMWindow::executionContext() const 472 ExecutionContext* LocalDOMWindow::executionContext() const
473 { 473 {
474 return m_document.get(); 474 return m_document.get();
475 } 475 }
476 476
477 const LocalDOMWindow* LocalDOMWindow::toDOMWindow() const
478 {
479 return this;
480 }
481
477 LocalDOMWindow* LocalDOMWindow::toDOMWindow() 482 LocalDOMWindow* LocalDOMWindow::toDOMWindow()
478 { 483 {
479 return this; 484 return this;
480 } 485 }
481 486
482 PassRefPtrWillBeRawPtr<MediaQueryList> LocalDOMWindow::matchMedia(const String& media) 487 PassRefPtrWillBeRawPtr<MediaQueryList> LocalDOMWindow::matchMedia(const String& media)
483 { 488 {
484 return document() ? document()->mediaQueryMatcher().matchMedia(media) : null ptr; 489 return document() ? document()->mediaQueryMatcher().matchMedia(media) : null ptr;
485 } 490 }
486 491
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 } 1432 }
1428 1433
1429 void LocalDOMWindow::finishedLoading() 1434 void LocalDOMWindow::finishedLoading()
1430 { 1435 {
1431 if (m_shouldPrintWhenFinishedLoading) { 1436 if (m_shouldPrintWhenFinishedLoading) {
1432 m_shouldPrintWhenFinishedLoading = false; 1437 m_shouldPrintWhenFinishedLoading = false;
1433 print(); 1438 print();
1434 } 1439 }
1435 } 1440 }
1436 1441
1437 void LocalDOMWindow::printErrorMessage(const String& message) 1442 void LocalDOMWindow::printErrorMessage(const String& message) const
1438 { 1443 {
1439 if (!isCurrentlyDisplayedInFrame()) 1444 if (!isCurrentlyDisplayedInFrame())
1440 return; 1445 return;
1441 1446
1442 if (message.isEmpty()) 1447 if (message.isEmpty())
1443 return; 1448 return;
1444 1449
1445 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMess ageLevel, message)); 1450 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMess ageLevel, message));
1446 } 1451 }
1447 1452
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 { 1536 {
1532 // If the LocalDOMWindow still has a frame reference, that frame must point 1537 // If the LocalDOMWindow still has a frame reference, that frame must point
1533 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1538 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1534 // where script execution leaks between different LocalDOMWindows. 1539 // where script execution leaks between different LocalDOMWindows.
1535 if (m_frameObserver->frame()) 1540 if (m_frameObserver->frame())
1536 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1541 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1537 return m_frameObserver->frame(); 1542 return m_frameObserver->frame();
1538 } 1543 }
1539 1544
1540 } // namespace blink 1545 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.h ('k') | third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698