ScriptExecutionContext::topOrigin() should return a reference.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2017 15:56:13 +0000 (15:56 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2017 15:56:13 +0000 (15:56 +0000)
commit31e9538904124ab6ac1618bb65a1febca37852fa
tree4bea9058e8efe7f6b02b65c44a186dd08cbc01f8
parentb0713710659deb5da9840eb755b8a02fc25169a3
ScriptExecutionContext::topOrigin() should return a reference.
<https://webkit.org/b/167190>

Reviewed by Sam Weinig.

Source/WebCore:

There is always a topOrigin() SecurityOrigin, so make it return a reference
and remove some unnecessary null-checks exposed by this change.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::canCallApplePaySessionAPIs):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedConfiguration):
(WebCore::CDM::getConsentStatus):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::topLevelDocumentOrigin):
(WebCore::canCallGetUserMedia):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setDomainForCachePartition):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::canAccessDatabase):
(WebCore::SecurityOrigin::canAccessSessionStorage):
(WebCore::SecurityOrigin::canAccessPluginStorage):
(WebCore::SecurityOrigin::canAccessApplicationCache):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:

Source/WebKit/mac:

* Misc/WebCache.mm:
(+[WebCache addImageToCache:forURL:forFrame:]):
(+[WebCache removeImageFromCacheForURL:forFrame:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/encryptedmedia/CDM.cpp
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/mediastream/MediaDevicesEnumerationRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/html/DOMURL.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/loader/cache/CachedResourceRequest.cpp
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/storage/StorageNamespaceProvider.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp
Source/WebCore/workers/DedicatedWorkerGlobalScope.h
Source/WebCore/workers/DedicatedWorkerThread.cpp
Source/WebCore/workers/DedicatedWorkerThread.h
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebCache.mm