2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 01:20:02 +04:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2013-03-12 21:17:46 +04:00
|
|
|
XPIDL_SOURCES += [
|
|
|
|
'nsIAsyncInputStream.idl',
|
|
|
|
'nsIAsyncOutputStream.idl',
|
|
|
|
'nsIBinaryInputStream.idl',
|
|
|
|
'nsIBinaryOutputStream.idl',
|
2015-02-11 07:55:43 +03:00
|
|
|
'nsICloneableInputStream.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'nsIConverterInputStream.idl',
|
|
|
|
'nsIConverterOutputStream.idl',
|
|
|
|
'nsIDirectoryEnumerator.idl',
|
|
|
|
'nsIDirectoryService.idl',
|
|
|
|
'nsIFile.idl',
|
|
|
|
'nsIInputStream.idl',
|
2018-05-23 08:12:34 +03:00
|
|
|
'nsIInputStreamLength.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'nsIInputStreamTee.idl',
|
2013-10-24 03:05:43 +04:00
|
|
|
'nsIIOUtil.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'nsILineInputStream.idl',
|
|
|
|
'nsILocalFileWin.idl',
|
|
|
|
'nsIMultiplexInputStream.idl',
|
|
|
|
'nsIObjectInputStream.idl',
|
|
|
|
'nsIObjectOutputStream.idl',
|
|
|
|
'nsIOutputStream.idl',
|
|
|
|
'nsIPipe.idl',
|
|
|
|
'nsISafeOutputStream.idl',
|
|
|
|
'nsIScriptableBase64Encoder.idl',
|
|
|
|
'nsIScriptableInputStream.idl',
|
|
|
|
'nsISeekableStream.idl',
|
|
|
|
'nsIStorageStream.idl',
|
|
|
|
'nsIStreamBufferAccess.idl',
|
|
|
|
'nsIStringStream.idl',
|
Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj
In the current code there are 3 main issues:
1. nsFileStream is not really thread-safe. There is nothing to protect the
internal members and we see crashes.
2. nsPipeInputStream doesn't implement ::Seek() method and that caused issues
in devtools when a nsHttpChannel sends POST data using a pipe. In order to fix
this, bug 1494176 added a check in nsHttpChannel: if the stream doesn't
implement ::Seek(), let's clone it. This was an hack around nsPipeInputStream,
and it's bad.
3. When nsHttpChannel sends POST data using a file stream, nsFileStream does
I/O on main-thread because of the issue 2. Plus, ::Seek() is called on the
main-thread causing issue 1.
Note that nsPipeInputStream implements only ::Tell(), of the nsISeekableStream
methods. It doesn't implement ::Seek() and it doesn't implement ::SetEOF().
With this patch I want to fix point 2 and point 3 (and consequentially issue 1
- but we need a separate fix for it - follow up). The patch does:
1. it splits nsISeekableStream in 2 interfaces: nsITellableStream and
nsISeekableStream.
2. nsPipeInputStream implements only nsITellableStream. Doing this, we don't
need the ::Seek() check for point 2 in nsHttpChannel: a simple QI check is
enough.
3. Because we don't call ::Seek() in nsHttpChannel, nsFileStream doesn't do I/O
on the main-thread, and we don't crash doing so.
2018-10-18 14:35:35 +03:00
|
|
|
'nsITellableStream.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'nsIUnicharInputStream.idl',
|
|
|
|
'nsIUnicharLineInputStream.idl',
|
|
|
|
'nsIUnicharOutputStream.idl',
|
|
|
|
]
|
|
|
|
|
2014-02-11 02:57:01 +04:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
2013-03-12 21:20:41 +04:00
|
|
|
XPIDL_SOURCES += [
|
|
|
|
'nsILocalFileMac.idl',
|
|
|
|
]
|
|
|
|
|
2014-02-11 02:57:01 +04:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
2013-04-16 23:24:43 +04:00
|
|
|
EXPORTS += ['nsLocalFileWin.h']
|
2014-02-01 07:14:03 +04:00
|
|
|
EXPORTS.mozilla += [
|
|
|
|
'FileUtilsWin.h',
|
|
|
|
]
|
2013-10-25 03:23:05 +04:00
|
|
|
SOURCES += [
|
2014-02-01 07:14:03 +04:00
|
|
|
'FileUtilsWin.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsLocalFileWin.cpp',
|
|
|
|
]
|
2013-04-16 23:24:43 +04:00
|
|
|
else:
|
|
|
|
EXPORTS += ['nsLocalFileUnix.h']
|
2013-10-25 03:23:05 +04:00
|
|
|
SOURCES += [
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsLocalFileUnix.cpp',
|
|
|
|
]
|
2013-04-16 23:24:43 +04:00
|
|
|
|
2013-03-12 09:00:00 +04:00
|
|
|
XPIDL_MODULE = 'xpcom_io'
|
|
|
|
|
2018-12-19 07:28:14 +03:00
|
|
|
XPCOM_MANIFESTS += [
|
|
|
|
'components.conf',
|
|
|
|
]
|
|
|
|
|
2013-04-16 23:24:43 +04:00
|
|
|
EXPORTS += [
|
2017-06-24 03:10:54 +03:00
|
|
|
'FileDescriptorFile.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsAnonymousTemporaryFile.h',
|
|
|
|
'nsAppDirectoryServiceDefs.h',
|
|
|
|
'nsDirectoryService.h',
|
2013-07-02 01:24:53 +04:00
|
|
|
'nsDirectoryServiceDefs.h',
|
|
|
|
'nsDirectoryServiceUtils.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsEscape.h',
|
|
|
|
'nsLinebreakConverter.h',
|
|
|
|
'nsLocalFile.h',
|
2019-03-02 03:01:26 +03:00
|
|
|
'nsLocalFileCommon.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsMultiplexInputStream.h',
|
|
|
|
'nsNativeCharsetUtils.h',
|
|
|
|
'nsScriptableInputStream.h',
|
|
|
|
'nsStorageStream.h',
|
|
|
|
'nsStreamUtils.h',
|
|
|
|
'nsStringStream.h',
|
|
|
|
'nsUnicharInputStream.h',
|
|
|
|
'nsWildCard.h',
|
2013-10-24 03:05:43 +04:00
|
|
|
'SpecialSystemDirectory.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
EXPORTS.mozilla += [
|
|
|
|
'Base64.h',
|
2018-06-07 20:56:16 +03:00
|
|
|
'FilePreferences.h',
|
2018-05-23 08:12:35 +03:00
|
|
|
'InputStreamLengthHelper.h',
|
2018-05-31 19:12:25 +03:00
|
|
|
'InputStreamLengthWrapper.h',
|
2018-01-31 18:45:20 +03:00
|
|
|
'NonBlockingAsyncInputStream.h',
|
2017-11-07 03:04:06 +03:00
|
|
|
'SlicedInputStream.h',
|
2014-12-12 22:12:27 +03:00
|
|
|
'SnappyCompressOutputStream.h',
|
|
|
|
'SnappyFrameUtils.h',
|
|
|
|
'SnappyUncompressInputStream.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
]
|
|
|
|
|
2013-11-19 06:34:00 +04:00
|
|
|
UNIFIED_SOURCES += [
|
2013-04-24 01:54:15 +04:00
|
|
|
'Base64.cpp',
|
2014-12-12 22:12:27 +03:00
|
|
|
'crc32c.c',
|
2017-06-24 03:10:54 +03:00
|
|
|
'FileDescriptorFile.cpp',
|
2018-06-07 20:56:16 +03:00
|
|
|
'FilePreferences.cpp',
|
2018-05-23 08:12:35 +03:00
|
|
|
'InputStreamLengthHelper.cpp',
|
2018-05-31 19:12:25 +03:00
|
|
|
'InputStreamLengthWrapper.cpp',
|
2018-01-31 18:45:20 +03:00
|
|
|
'NonBlockingAsyncInputStream.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsAnonymousTemporaryFile.cpp',
|
|
|
|
'nsAppFileLocationProvider.cpp',
|
|
|
|
'nsBinaryStream.cpp',
|
2019-03-05 09:38:49 +03:00
|
|
|
'nsDirectoryService.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsEscape.cpp',
|
|
|
|
'nsInputStreamTee.cpp',
|
2013-10-24 03:05:43 +04:00
|
|
|
'nsIOUtil.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsLinebreakConverter.cpp',
|
|
|
|
'nsLocalFileCommon.cpp',
|
|
|
|
'nsMultiplexInputStream.cpp',
|
|
|
|
'nsNativeCharsetUtils.cpp',
|
|
|
|
'nsPipe3.cpp',
|
|
|
|
'nsScriptableBase64Encoder.cpp',
|
|
|
|
'nsScriptableInputStream.cpp',
|
|
|
|
'nsSegmentedBuffer.cpp',
|
|
|
|
'nsStorageStream.cpp',
|
|
|
|
'nsStreamUtils.cpp',
|
|
|
|
'nsStringStream.cpp',
|
|
|
|
'nsUnicharInputStream.cpp',
|
|
|
|
'nsWildCard.cpp',
|
2016-07-25 23:41:02 +03:00
|
|
|
'SlicedInputStream.cpp',
|
2014-12-12 22:12:27 +03:00
|
|
|
'SnappyCompressOutputStream.cpp',
|
|
|
|
'SnappyFrameUtils.cpp',
|
|
|
|
'SnappyUncompressInputStream.cpp',
|
2013-10-24 03:05:43 +04:00
|
|
|
'SpecialSystemDirectory.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
]
|
|
|
|
|
2013-06-07 19:43:39 +04:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
2013-10-25 03:23:05 +04:00
|
|
|
SOURCES += [
|
2013-06-07 19:43:39 +04:00
|
|
|
'CocoaFileUtils.mm',
|
|
|
|
]
|
2013-08-22 10:56:01 +04:00
|
|
|
|
2013-10-02 21:17:55 +04:00
|
|
|
include('/ipc/chromium/chromium-config.mozbuild')
|
|
|
|
|
2014-07-23 03:37:51 +04:00
|
|
|
FINAL_LIBRARY = 'xul'
|
2013-11-27 17:55:07 +04:00
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'Linux' and 'lib64' in CONFIG['libdir']:
|
|
|
|
DEFINES['HAVE_USR_LIB64_DIR'] = True
|
2014-02-18 18:01:06 +04:00
|
|
|
|
2017-09-28 04:49:48 +03:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'!..',
|
|
|
|
'../build',
|
|
|
|
]
|