Skip to content

Commit

Permalink
Collapse ENABLE(BLOB)|ENABLE(FILE_SYSTEM) to just ENABLE(BLOB)
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=80592

Patch by Mark Pilgrim <pilgrim@chromium.org> on 2012-03-08
Reviewed by Adam Barth.

In anticipation of moving FILE_SYSTEM-related code to Modules/, we
are collapsing combination BLOB/FILE_SYSTEM ifdefs to just
BLOB. In other words, it is assumed from now on that you can not
have FILE_SYSTEM support without BLOB support.

No new tests, all existing tests pass.

* CMakeLists.txt:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore):
(WebCore::ScriptExecutionContext::fileThread):
* dom/ScriptExecutionContext.h:
(WebCore):
(ScriptExecutionContext):
* fileapi/AsyncFileStream.cpp:
* fileapi/AsyncFileStream.h:
* fileapi/FileError.h:
* fileapi/FileException.cpp:
* fileapi/FileException.h:
* fileapi/FileThread.cpp:
* fileapi/FileThread.h:
* fileapi/OperationNotAllowedException.cpp:
* fileapi/OperationNotAllowedException.h:
* platform/FileStream.cpp:
* platform/FileStream.h:
* platform/FileStreamClient.h:
* platform/SchemeRegistry.cpp:
(WebCore::canDisplayOnlyIfCanRequestSchemes):
(WebCore::CORSEnabledSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):

Canonical link: https://commits.webkit.org/97829@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Mark Pilgrim authored and webkit-commit-queue committed Mar 9, 2012
1 parent 74e3038 commit b831c67
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 47 deletions.
9 changes: 2 additions & 7 deletions Source/WebCore/CMakeLists.txt
Expand Up @@ -1464,7 +1464,9 @@ IF (ENABLE_BLOB)
)

LIST(APPEND WebCore_IDL_FILES
fileapi/FileException.idl
fileapi/FileReaderSync.idl
fileapi/OperationNotAllowedException.idl
)
ENDIF ()

Expand Down Expand Up @@ -1685,13 +1687,6 @@ if (ENABLE_FILE_SYSTEM)
)
ENDIF ()

IF (ENABLE_BLOB OR ENABLE_FILE_SYSTEM)
LIST(APPEND WebCore_IDL_FILES
fileapi/FileException.idl
fileapi/OperationNotAllowedException.idl
)
ENDIF ()

IF (ENABLE_SVG)
LIST(APPEND WebCore_SOURCES
css/SVGCSSComputedStyleDeclaration.cpp
Expand Down
39 changes: 39 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,42 @@
2012-03-08 Mark Pilgrim <pilgrim@chromium.org>

Collapse ENABLE(BLOB)|ENABLE(FILE_SYSTEM) to just ENABLE(BLOB)
https://bugs.webkit.org/show_bug.cgi?id=80592

Reviewed by Adam Barth.

In anticipation of moving FILE_SYSTEM-related code to Modules/, we
are collapsing combination BLOB/FILE_SYSTEM ifdefs to just
BLOB. In other words, it is assumed from now on that you can not
have FILE_SYSTEM support without BLOB support.

No new tests, all existing tests pass.

* CMakeLists.txt:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore):
(WebCore::ScriptExecutionContext::fileThread):
* dom/ScriptExecutionContext.h:
(WebCore):
(ScriptExecutionContext):
* fileapi/AsyncFileStream.cpp:
* fileapi/AsyncFileStream.h:
* fileapi/FileError.h:
* fileapi/FileException.cpp:
* fileapi/FileException.h:
* fileapi/FileThread.cpp:
* fileapi/FileThread.h:
* fileapi/OperationNotAllowedException.cpp:
* fileapi/OperationNotAllowedException.h:
* platform/FileStream.cpp:
* platform/FileStream.h:
* platform/FileStreamClient.h:
* platform/SchemeRegistry.cpp:
(WebCore::canDisplayOnlyIfCanRequestSchemes):
(WebCore::CORSEnabledSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):

2012-03-08 James Robinson <jamesr@chromium.org>

Use an explicit attribute to signal that a context prefers to use a discrete GPU
Expand Down
8 changes: 2 additions & 6 deletions Source/WebCore/dom/ScriptExecutionContext.cpp
Expand Up @@ -112,13 +112,11 @@ ScriptExecutionContext::~ScriptExecutionContext()
ASSERT((*iter)->scriptExecutionContext() == this);
(*iter)->contextDestroyed();
}
#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)
if (m_fileThread) {
m_fileThread->stop();
m_fileThread = 0;
}
#endif
#if ENABLE(BLOB)
if (m_publicURLManager)
m_publicURLManager->contextDestroyed();
#endif
Expand Down Expand Up @@ -359,7 +357,7 @@ DOMTimer* ScriptExecutionContext::findTimeout(int timeoutId)
return m_timeouts.get(timeoutId);
}

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)
FileThread* ScriptExecutionContext::fileThread()
{
if (!m_fileThread) {
Expand All @@ -369,9 +367,7 @@ FileThread* ScriptExecutionContext::fileThread()
}
return m_fileThread.get();
}
#endif

#if ENABLE(BLOB)
PublicURLManager& ScriptExecutionContext::publicURLManager()
{
if (!m_publicURLManager)
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/dom/ScriptExecutionContext.h
Expand Up @@ -59,7 +59,7 @@ class MessagePort;
class PublicURLManager;
#endif

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)
class FileThread;
#endif

Expand Down Expand Up @@ -147,7 +147,7 @@ class ScriptExecutionContext : public SecurityContext, public Supplementable<Scr
JSC::JSGlobalData* globalData();
#endif

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)
FileThread* fileThread();
void stopFileThread();
#endif
Expand Down Expand Up @@ -214,7 +214,7 @@ class ScriptExecutionContext : public SecurityContext, public Supplementable<Scr
ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects;
bool m_activeDOMObjectsAreStopped;

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)
RefPtr<FileThread> m_fileThread;
#endif
};
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/AsyncFileStream.cpp
Expand Up @@ -31,7 +31,7 @@

#include "config.h"

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "AsyncFileStream.h"

Expand Down Expand Up @@ -224,4 +224,4 @@ void AsyncFileStream::truncateOnFileThread(long long position)

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/AsyncFileStream.h
Expand Up @@ -32,7 +32,7 @@
#ifndef AsyncFileStream_h
#define AsyncFileStream_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
Expand Down Expand Up @@ -90,6 +90,6 @@ class AsyncFileStream : public RefCounted<AsyncFileStream> {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // AsyncFileStream_h
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/FileError.h
Expand Up @@ -31,7 +31,7 @@
#ifndef FileError_h
#define FileError_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
Expand Down Expand Up @@ -70,6 +70,6 @@ class FileError : public RefCounted<FileError> {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // FileError_h
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/FileException.cpp
Expand Up @@ -28,7 +28,7 @@

#include "config.h"

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "FileException.h"

Expand Down Expand Up @@ -87,4 +87,4 @@ bool FileException::initializeDescription(ExceptionCode ec, ExceptionCodeDescrip

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/FileException.h
Expand Up @@ -31,7 +31,7 @@
#ifndef FileException_h
#define FileException_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "ExceptionBase.h"

Expand Down Expand Up @@ -80,6 +80,6 @@ class FileException : public ExceptionBase {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // FileException_h
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/FileThread.cpp
Expand Up @@ -30,7 +30,7 @@

#include "config.h"

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "FileThread.h"

Expand Down Expand Up @@ -114,4 +114,4 @@ void FileThread::runLoop()

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/FileThread.h
Expand Up @@ -31,7 +31,7 @@
#ifndef FileThread_h
#define FileThread_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include <wtf/MessageQueue.h>
#include <wtf/PassOwnPtr.h>
Expand Down Expand Up @@ -84,6 +84,6 @@ class FileThread : public ThreadSafeRefCounted<FileThread> {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // FileThread_h
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/OperationNotAllowedException.cpp
Expand Up @@ -28,7 +28,7 @@

#include "config.h"

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "OperationNotAllowedException.h"

Expand Down Expand Up @@ -65,4 +65,4 @@ bool OperationNotAllowedException::initializeDescription(ExceptionCode ec, Excep

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)
4 changes: 2 additions & 2 deletions Source/WebCore/fileapi/OperationNotAllowedException.h
Expand Up @@ -31,7 +31,7 @@
#ifndef OperationNotAllowedException_h
#define OperationNotAllowedException_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "ExceptionBase.h"

Expand Down Expand Up @@ -62,6 +62,6 @@ class OperationNotAllowedException : public ExceptionBase {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // OperationNotAllowedException_h
4 changes: 2 additions & 2 deletions Source/WebCore/platform/FileStream.cpp
Expand Up @@ -30,7 +30,7 @@

#include "config.h"

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "FileStream.h"

Expand Down Expand Up @@ -147,4 +147,4 @@ bool FileStream::truncate(long long)

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)
4 changes: 2 additions & 2 deletions Source/WebCore/platform/FileStream.h
Expand Up @@ -31,7 +31,7 @@
#ifndef FileStream_h
#define FileStream_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

#include "FileSystem.h"
#include <wtf/Forward.h>
Expand Down Expand Up @@ -95,6 +95,6 @@ class FileStream : public RefCounted<FileStream> {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // FileStream_h
4 changes: 2 additions & 2 deletions Source/WebCore/platform/FileStreamClient.h
Expand Up @@ -31,7 +31,7 @@
#ifndef FileStreamClient_h
#define FileStreamClient_h

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#if ENABLE(BLOB)

namespace WebCore {

Expand All @@ -53,6 +53,6 @@ class FileStreamClient {

} // namespace WebCore

#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

#endif // FileStreamClient_h
12 changes: 5 additions & 7 deletions Source/WebCore/platform/SchemeRegistry.cpp
Expand Up @@ -20,7 +20,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "config.h"
Expand Down Expand Up @@ -100,16 +100,14 @@ static URLSchemesMap& canDisplayOnlyIfCanRequestSchemes()
{
DEFINE_STATIC_LOCAL(URLSchemesMap, canDisplayOnlyIfCanRequestSchemes, ());

#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
if (canDisplayOnlyIfCanRequestSchemes.isEmpty()) {
#if ENABLE(BLOB)
if (canDisplayOnlyIfCanRequestSchemes.isEmpty()) {
canDisplayOnlyIfCanRequestSchemes.add("blob");
#endif
#if ENABLE(FILE_SYSTEM)
canDisplayOnlyIfCanRequestSchemes.add("filesystem");
#endif
}
#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // ENABLE(BLOB)

return canDisplayOnlyIfCanRequestSchemes;
}
Expand Down Expand Up @@ -155,7 +153,7 @@ static URLSchemesMap& schemesAllowingDatabaseAccessInPrivateBrowsing()

static URLSchemesMap& CORSEnabledSchemes()
{
// FIXME: http://bugs.webkit.org/show_bug.cgi?id=77160
// FIXME: http://bugs.webkit.org/show_bug.cgi?id=77160
DEFINE_STATIC_LOCAL(URLSchemesMap, CORSEnabledSchemes, ());

if (CORSEnabledSchemes.isEmpty()) {
Expand Down Expand Up @@ -251,7 +249,7 @@ void SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(const String& scheme)
canDisplayOnlyIfCanRequestSchemes().add(scheme);
}

void SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs(const String& scheme)
void SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs(const String& scheme)
{
notAllowingJavascriptURLsSchemes().add(scheme);
}
Expand Down

0 comments on commit b831c67

Please sign in to comment.