| OLD | NEW |
| 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 RefPtr<StorageArea> storageArea = page->group().localStorage()->storageArea(
document->securityOrigin()); | 747 RefPtr<StorageArea> storageArea = page->group().localStorage()->storageArea(
document->securityOrigin()); |
| 748 if (!storageArea->canAccessStorage(m_frame)) { | 748 if (!storageArea->canAccessStorage(m_frame)) { |
| 749 ec = SECURITY_ERR; | 749 ec = SECURITY_ERR; |
| 750 return 0; | 750 return 0; |
| 751 } | 751 } |
| 752 | 752 |
| 753 m_localStorage = Storage::create(m_frame, storageArea.release()); | 753 m_localStorage = Storage::create(m_frame, storageArea.release()); |
| 754 return m_localStorage.get(); | 754 return m_localStorage.get(); |
| 755 } | 755 } |
| 756 | 756 |
| 757 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePo
rt* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) | |
| 758 { | |
| 759 MessagePortArray ports; | |
| 760 if (port) | |
| 761 ports.append(port); | |
| 762 postMessage(message, &ports, targetOrigin, source, ec); | |
| 763 } | |
| 764 | |
| 765 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
sagePortArray* ports, const String& targetOrigin, DOMWindow* source, ExceptionCo
de& ec) | 757 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
sagePortArray* ports, const String& targetOrigin, DOMWindow* source, ExceptionCo
de& ec) |
| 766 { | 758 { |
| 767 if (!isCurrentlyDisplayedInFrame()) | 759 if (!isCurrentlyDisplayedInFrame()) |
| 768 return; | 760 return; |
| 769 | 761 |
| 770 Document* sourceDocument = source->document(); | 762 Document* sourceDocument = source->document(); |
| 771 | 763 |
| 772 // Compute the target origin. We need to do this synchronously in order | 764 // Compute the target origin. We need to do this synchronously in order |
| 773 // to generate the SYNTAX_ERR exception correctly. | 765 // to generate the SYNTAX_ERR exception correctly. |
| 774 RefPtr<SecurityOrigin> target; | 766 RefPtr<SecurityOrigin> target; |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1885 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); | 1877 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); |
| 1886 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, | 1878 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, |
| 1887 activeWindow, firstFrame, m_frame, function, functionContext); | 1879 activeWindow, firstFrame, m_frame, function, functionContext); |
| 1888 if (!dialogFrame) | 1880 if (!dialogFrame) |
| 1889 return; | 1881 return; |
| 1890 UserGestureIndicatorDisabler disabler; | 1882 UserGestureIndicatorDisabler disabler; |
| 1891 dialogFrame->page()->chrome()->runModal(); | 1883 dialogFrame->page()->chrome()->runModal(); |
| 1892 } | 1884 } |
| 1893 | 1885 |
| 1894 } // namespace WebCore | 1886 } // namespace WebCore |
| OLD | NEW |