diff options
Diffstat (limited to 'indra')
47 files changed, 163 insertions, 501 deletions
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 2a7e5f3ddb..7360c1acd7 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -33,7 +33,7 @@ #include "llimagej2c.h" #include "llimagetga.h" #include "lldir.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "lltexlayerparams.h" #include "lltexturemanagerbridge.h" #include "lllocaltextureobject.h" diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index d2c4163280..fcffea42a4 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -29,7 +29,7 @@ #include "llaudioengine.h" #include "lllfsthread.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llstring.h" #include "lldir.h" #include "llendianswizzle.h" @@ -93,14 +93,14 @@ protected: std::string mOutFilename; LLLFSThread::handle_t mFileHandle; - LLVFile *mInFilep; + LLDiskCache *mInFilep; OggVorbis_File mVF; S32 mCurrentSection; }; size_t cache_read(void *ptr, size_t size, size_t nmemb, void *datasource) { - LLVFile *file = (LLVFile *)datasource; + LLDiskCache *file = (LLDiskCache *)datasource; if (file->read((U8*)ptr, (S32)(size * nmemb))) /*Flawfinder: ignore*/ { @@ -115,7 +115,7 @@ size_t cache_read(void *ptr, size_t size, size_t nmemb, void *datasource) S32 cache_seek(void *datasource, ogg_int64_t offset, S32 whence) { - LLVFile *file = (LLVFile *)datasource; + LLDiskCache *file = (LLDiskCache *)datasource; // cache has 31-bit files if (offset > S32_MAX) @@ -151,14 +151,14 @@ S32 cache_seek(void *datasource, ogg_int64_t offset, S32 whence) S32 cache_close (void *datasource) { - LLVFile *file = (LLVFile *)datasource; + LLDiskCache *file = (LLDiskCache *)datasource; delete file; return 0; } long cache_tell (void *datasource) { - LLVFile *file = (LLVFile *)datasource; + LLDiskCache *file = (LLDiskCache *)datasource; return file->tell(); } @@ -198,7 +198,7 @@ BOOL LLVorbisDecodeState::initDecode() LL_DEBUGS("AudioEngine") << "Initing decode from vfile: " << mUUID << LL_ENDL; - mInFilep = new LLVFile(mUUID, LLAssetType::AT_SOUND); + mInFilep = new LLDiskCache(mUUID, LLAssetType::AT_SOUND); if (!mInFilep || !mInFilep->getSize()) { LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL; diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 9c8bd3225b..9dd752f492 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -35,7 +35,7 @@ #include "sound_ids.h" // temporary hack for min/max distances -#include "llvfile.h" +#include "lldiskcache.h" #include "lldir.h" #include "llaudiodecodemgr.h" #include "llassetstorage.h" @@ -1015,7 +1015,7 @@ bool LLAudioEngine::hasDecodedFile(const LLUUID &uuid) bool LLAudioEngine::hasLocalFile(const LLUUID &uuid) { // See if it's in the cache. - bool have_local = LLVFile::getExists(uuid, LLAssetType::AT_SOUND); + bool have_local = LLDiskCache::getExists(uuid, LLAssetType::AT_SOUND); LL_DEBUGS("AudioEngine") << "sound uuid " << uuid << " exists in cache" << LL_ENDL; return have_local; } diff --git a/indra/llcache/CMakeLists.txt b/indra/llcache/CMakeLists.txt index ab84bd96a0..379e3ebdbf 100644 --- a/indra/llcache/CMakeLists.txt +++ b/indra/llcache/CMakeLists.txt @@ -15,8 +15,7 @@ set(llcache_SOURCE_FILES lldir.cpp lldiriterator.cpp lllfsthread.cpp - llpidlock.cpp - llvfile.cpp + lldiskcache.cpp ) set(llcache_HEADER_FILES @@ -26,8 +25,7 @@ set(llcache_HEADER_FILES lldirguard.h lldiriterator.h lllfsthread.h - llpidlock.h - llvfile.h + lldiskcache.h ) if (DARWIN) diff --git a/indra/llcache/llvfile.cpp b/indra/llcache/lldiskcache.cpp index be753244c0..af93049e07 100644 --- a/indra/llcache/llvfile.cpp +++ b/indra/llcache/lldiskcache.cpp @@ -1,5 +1,5 @@ /** - * @file llvfile.cpp + * @file lldiskcache.cpp * @brief Implementation of virtual file * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ @@ -26,7 +26,7 @@ #include "linden_common.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llerror.h" #include "llthread.h" @@ -37,14 +37,14 @@ #include <fstream> #include "lldir.h" -const S32 LLVFile::READ = 0x00000001; -const S32 LLVFile::WRITE = 0x00000002; -const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE -const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE +const S32 LLDiskCache::READ = 0x00000001; +const S32 LLDiskCache::WRITE = 0x00000002; +const S32 LLDiskCache::READ_WRITE = 0x00000003; // LLDiskCache::READ & LLDiskCache::WRITE +const S32 LLDiskCache::APPEND = 0x00000006; // 0x00000004 & LLDiskCache::WRITE static LLTrace::BlockTimerStatHandle FTM_VFILE_WAIT("VFile Wait"); -LLVFile::LLVFile(const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode) +LLDiskCache::LLDiskCache(const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode) { mFileType = file_type; mFileID = file_id; @@ -54,7 +54,7 @@ LLVFile::LLVFile(const LLUUID &file_id, const LLAssetType::EType file_type, S32 mMode = mode; } -LLVFile::~LLVFile() +LLDiskCache::~LLDiskCache() { } @@ -124,7 +124,7 @@ const std::string idToFilepath(const std::string id, LLAssetType::EType at) } // static -bool LLVFile::getExists(const LLUUID &file_id, const LLAssetType::EType file_type) +bool LLDiskCache::getExists(const LLUUID &file_id, const LLAssetType::EType file_type) { std::string id_str; file_id.toString(id_str); @@ -140,7 +140,7 @@ bool LLVFile::getExists(const LLUUID &file_id, const LLAssetType::EType file_typ } // static -bool LLVFile::removeFile(const LLUUID &file_id, const LLAssetType::EType file_type) +bool LLDiskCache::removeFile(const LLUUID &file_id, const LLAssetType::EType file_type) { std::string id_str; file_id.toString(id_str); @@ -152,7 +152,7 @@ bool LLVFile::removeFile(const LLUUID &file_id, const LLAssetType::EType file_ty } // static -bool LLVFile::renameFile(const LLUUID &old_file_id, const LLAssetType::EType old_file_type, +bool LLDiskCache::renameFile(const LLUUID &old_file_id, const LLAssetType::EType old_file_type, const LLUUID &new_file_id, const LLAssetType::EType new_file_type) { std::string old_id_str; @@ -175,7 +175,7 @@ bool LLVFile::renameFile(const LLUUID &old_file_id, const LLAssetType::EType old } // static -S32 LLVFile::getFileSize(const LLUUID &file_id, const LLAssetType::EType file_type) +S32 LLDiskCache::getFileSize(const LLUUID &file_id, const LLAssetType::EType file_type) { std::string id_str; file_id.toString(id_str); @@ -192,7 +192,7 @@ S32 LLVFile::getFileSize(const LLUUID &file_id, const LLAssetType::EType file_ty return file_size; } -BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority) +BOOL LLDiskCache::read(U8 *buffer, S32 bytes, BOOL async, F32 priority) { BOOL success = TRUE; @@ -232,7 +232,7 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority) return success; } -BOOL LLVFile::isReadComplete() +BOOL LLDiskCache::isReadComplete() { if (mReadComplete) { @@ -242,17 +242,17 @@ BOOL LLVFile::isReadComplete() return FALSE; } -S32 LLVFile::getLastBytesRead() +S32 LLDiskCache::getLastBytesRead() { return mBytesRead; } -BOOL LLVFile::eof() +BOOL LLDiskCache::eof() { return mPosition >= getSize(); } -BOOL LLVFile::write(const U8 *buffer, S32 bytes) +BOOL LLDiskCache::write(const U8 *buffer, S32 bytes) { std::string id_str; mFileID.toString(id_str); @@ -287,14 +287,14 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes) } //static -BOOL LLVFile::writeFile(const U8 *buffer, S32 bytes, const LLUUID &uuid, LLAssetType::EType type) +BOOL LLDiskCache::writeFile(const U8 *buffer, S32 bytes, const LLUUID &uuid, LLAssetType::EType type) { - LLVFile file(uuid, type, LLVFile::WRITE); + LLDiskCache file(uuid, type, LLDiskCache::WRITE); file.setMaxSize(bytes); return file.write(buffer, bytes); } -BOOL LLVFile::seek(S32 offset, S32 origin) +BOOL LLDiskCache::seek(S32 offset, S32 origin) { if (-1 == origin) { @@ -324,32 +324,32 @@ BOOL LLVFile::seek(S32 offset, S32 origin) return TRUE; } -S32 LLVFile::tell() const +S32 LLDiskCache::tell() const { return mPosition; } -S32 LLVFile::getSize() +S32 LLDiskCache::getSize() { - return LLVFile::getFileSize(mFileID, mFileType); + return LLDiskCache::getFileSize(mFileID, mFileType); } -S32 LLVFile::getMaxSize() +S32 LLDiskCache::getMaxSize() { // offer up a huge size since we don't care what the max is return INT_MAX; } -BOOL LLVFile::setMaxSize(S32 size) +BOOL LLDiskCache::setMaxSize(S32 size) { // we don't care what the max size is so we do nothing // and return true to indicate all was okay return TRUE; } -BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type) +BOOL LLDiskCache::rename(const LLUUID &new_id, const LLAssetType::EType new_type) { - LLVFile::renameFile(mFileID, mFileType, new_id, new_type); + LLDiskCache::renameFile(mFileID, mFileType, new_id, new_type); mFileID = new_id; mFileType = new_type; @@ -357,31 +357,31 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type) return TRUE; } -BOOL LLVFile::remove() +BOOL LLDiskCache::remove() { - LLVFile::removeFile(mFileID, mFileType); + LLDiskCache::removeFile(mFileID, mFileType); return TRUE; } // static -void LLVFile::initClass() +void LLDiskCache::initClass() { } // static -void LLVFile::cleanupClass() +void LLDiskCache::cleanupClass() { } -bool LLVFile::isLocked() +bool LLDiskCache::isLocked() { // I don't think we care about this test since there is no locking // TODO: remove this function and calling sites? return FALSE; } -void LLVFile::waitForLock() +void LLDiskCache::waitForLock() { // TODO: remove this function and calling sites? } diff --git a/indra/llcache/llvfile.h b/indra/llcache/lldiskcache.h index 30130df340..7ad06a8689 100644 --- a/indra/llcache/llvfile.h +++ b/indra/llcache/lldiskcache.h @@ -1,5 +1,5 @@ /** - * @file llvfile.h + * @file lldiskcacke.h * @brief Definition of virtual file * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ @@ -24,17 +24,17 @@ * $/LicenseInfo$ */ -#ifndef LL_LLVFILE_H -#define LL_LLVFILE_H +#ifndef LL_LLDISKCACHE_H +#define LL_LLDISKCACHE_H #include "lluuid.h" #include "llassettype.h" -class LLVFile +class LLDiskCache { public: - LLVFile(const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode = LLVFile::READ); - ~LLVFile(); + LLDiskCache(const LLUUID &file_id, const LLAssetType::EType file_type, S32 mode = LLDiskCache::READ); + ~LLDiskCache(); BOOL read(U8 *buffer, S32 bytes, BOOL async = FALSE, F32 priority = 128.f); /* Flawfinder: ignore */ BOOL isReadComplete(); @@ -79,4 +79,4 @@ protected: S32 mBytesRead; }; -#endif +#endif // LL_LLDISKCACHE_H diff --git a/indra/llcache/llpidlock.cpp b/indra/llcache/llpidlock.cpp deleted file mode 100644 index f770e93d45..0000000000 --- a/indra/llcache/llpidlock.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/** - * @file llformat.cpp - * @date January 2007 - * @brief string formatting utility - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llapr.h" // thread-related functions -#include "llpidlock.h" -#include "lldir.h" -#include "llsd.h" -#include "llsdserialize.h" -#include "llnametable.h" -#include "llframetimer.h" - -#if LL_WINDOWS //For windows platform. - -#include <windows.h> - -bool isProcessAlive(U32 pid) -{ - return (bool) GetProcessVersion((DWORD)pid); -} - -#else //Everyone Else -bool isProcessAlive(U32 pid) -{ - return (bool) kill( (pid_t)pid, 0); -} -#endif //Everyone else. - - - -class LLPidLockFile -{ - public: - LLPidLockFile( ) : - mAutosave(false), - mSaving(false), - mWaiting(false), - mPID(getpid()), - mNameTable(NULL), - mClean(true) - { - mLockName = gDirUtilp->getTempDir() + gDirUtilp->getDirDelimiter() + "savelock"; - } - bool requestLock(LLNameTable<void *> *name_table, bool autosave, - bool force_immediate=FALSE, F32 timeout=300.0); - bool checkLock(); - void releaseLock(); - - private: - void writeLockFile(LLSD pids); - public: - static LLPidLockFile& instance(); // return the singleton black list file - - bool mAutosave; - bool mSaving; - bool mWaiting; - LLFrameTimer mTimer; - U32 mPID; - std::string mLockName; - std::string mSaveName; - LLSD mPIDS_sd; - LLNameTable<void*> *mNameTable; - bool mClean; -}; - -LLPidLockFile& LLPidLockFile::instance() -{ - static LLPidLockFile the_file; - return the_file; -} - -void LLPidLockFile::writeLockFile(LLSD pids) -{ - llofstream ofile(mLockName.c_str()); - - if (!LLSDSerialize::toXML(pids,ofile)) - { - LL_WARNS() << "Unable to write concurrent save lock file." << LL_ENDL; - } - ofile.close(); -} - -bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave, - bool force_immediate, F32 timeout) -{ - bool readyToSave = FALSE; - - if (mSaving) return FALSE; //Bail out if we're currently saving. Will not queue another save. - - if (!mWaiting){ - mNameTable=name_table; - mAutosave = autosave; - } - - LLSD out_pids; - out_pids.append( (LLSD::Integer)mPID ); - - llifstream ifile(mLockName.c_str()); - - if (ifile.is_open()) - { //If file exists, we need to decide whether or not to continue. - if ( force_immediate - || mTimer.hasExpired() ) //Only deserialize if we REALLY need to. - { - - LLSD in_pids; - - LLSDSerialize::fromXML(in_pids, ifile); - - //Clean up any dead PIDS that might be in there. - for (LLSD::array_iterator i=in_pids.beginArray(); - i !=in_pids.endArray(); - ++i) - { - U32 stored_pid=(*i).asInteger(); - - if (isProcessAlive(stored_pid)) - { - out_pids.append( (*i) ); - } - } - - readyToSave=TRUE; - } - ifile.close(); - } - else - { - readyToSave=TRUE; - } - - if (!mWaiting) //Not presently waiting to save. Queue up. - { - mTimer.resetWithExpiry(timeout); - mWaiting=TRUE; - } - - if (readyToSave) - { //Potential race condition won't kill us. Ignore it. - writeLockFile(out_pids); - mSaving=TRUE; - } - - return readyToSave; -} - -bool LLPidLockFile::checkLock() -{ - return mWaiting; -} - -void LLPidLockFile::releaseLock() -{ - llifstream ifile(mLockName.c_str()); - LLSD in_pids; - LLSD out_pids; - bool write_file=FALSE; - - LLSDSerialize::fromXML(in_pids, ifile); - - //Clean up this PID and any dead ones. - for (LLSD::array_iterator i=in_pids.beginArray(); - i !=in_pids.endArray(); - ++i) - { - U32 stored_pid=(*i).asInteger(); - - if (stored_pid != mPID && isProcessAlive(stored_pid)) - { - out_pids.append( (*i) ); - write_file=TRUE; - } - } - ifile.close(); - - if (write_file) - { - writeLockFile(out_pids); - } - else - { - unlink(mLockName.c_str()); - } - - mSaving=FALSE; - mWaiting=FALSE; -} - -//LLPidLock - -void LLPidLock::initClass() { - (void) LLPidLockFile::instance(); -} - -bool LLPidLock::checkLock() -{ - return LLPidLockFile::instance().checkLock(); -} - -bool LLPidLock::requestLock(LLNameTable<void *> *name_table, bool autosave, - bool force_immediate, F32 timeout) -{ - return LLPidLockFile::instance().requestLock(name_table,autosave,force_immediate,timeout); -} - -void LLPidLock::releaseLock() -{ - return LLPidLockFile::instance().releaseLock(); -} - -bool LLPidLock::isClean() -{ - return LLPidLockFile::instance().mClean; -} - -//getters -LLNameTable<void *> * LLPidLock::getNameTable() -{ - return LLPidLockFile::instance().mNameTable; -} - -bool LLPidLock::getAutosave() -{ - return LLPidLockFile::instance().mAutosave; -} - -bool LLPidLock::getClean() -{ - return LLPidLockFile::instance().mClean; -} - -std::string LLPidLock::getSaveName() -{ - return LLPidLockFile::instance().mSaveName; -} - -//setters -void LLPidLock::setClean(bool clean) -{ - LLPidLockFile::instance().mClean=clean; -} - -void LLPidLock::setSaveName(std::string savename) -{ - LLPidLockFile::instance().mSaveName=savename; -} - -S32 LLPidLock::getPID() -{ - return (S32)getpid(); -} diff --git a/indra/llcache/llpidlock.h b/indra/llcache/llpidlock.h deleted file mode 100644 index 334f26bb29..0000000000 --- a/indra/llcache/llpidlock.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file llpidlock.h - * @brief System information debugging classes. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_PIDLOCK_H -#define LL_PIDLOCK_H -#include "llnametable.h" - -class LLSD; -class LLFrameTimer; - -#if !LL_WINDOWS //For non-windows platforms. -#include <signal.h> -#endif - -namespace LLPidLock -{ - void initClass(); // { (void) LLPidLockFile::instance(); } - - bool requestLock( LLNameTable<void *> *name_table=NULL, bool autosave=TRUE, - bool force_immediate=FALSE, F32 timeout=300.0); - bool checkLock(); - void releaseLock(); - bool isClean(); - - //getters - LLNameTable<void *> * getNameTable(); - bool getAutosave(); - bool getClean(); - std::string getSaveName(); - S32 getPID(); - - //setters - void setClean(bool clean); - void setSaveName(std::string savename); -}; - -#endif // LL_PIDLOCK_H diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index beca1af269..d1ac336fc1 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -39,7 +39,7 @@ #include "llendianswizzle.h" #include "llkeyframemotion.h" #include "llquantize.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "m3math.h" #include "message.h" @@ -559,7 +559,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact S32 anim_file_size; BOOL success = FALSE; - LLVFile* anim_file = new LLVFile(mID, LLAssetType::AT_ANIMATION); + LLDiskCache* anim_file = new LLDiskCache(mID, LLAssetType::AT_ANIMATION); if (!anim_file || !anim_file->getSize()) { delete anim_file; @@ -2324,7 +2324,7 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid, // asset already loaded return; } - LLVFile file(asset_uuid, type, LLVFile::READ); + LLDiskCache file(asset_uuid, type, LLDiskCache::READ); S32 size = file.getSize(); U8* buffer = new U8[size]; diff --git a/indra/llcrashlogger/llcrashlock.h b/indra/llcrashlogger/llcrashlock.h index cde183272f..60b060b736 100644 --- a/indra/llcrashlogger/llcrashlock.h +++ b/indra/llcrashlogger/llcrashlock.h @@ -1,5 +1,5 @@ /** - * @file llpidlock.h + * @file llcrashlock.h * @brief Maintainence of disk locking files for crash reporting * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index be5d00d4c9..31c1edd75e 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -42,7 +42,7 @@ // this library includes #include "message.h" #include "llxfermanager.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "lldbstrings.h" #include "lltransfersourceasset.h" @@ -438,7 +438,7 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error) BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType type) { - return LLVFile::getExists(uuid, type); + return LLDiskCache::getExists(uuid, type); } bool LLAssetStorage::findInCacheAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type, @@ -450,10 +450,10 @@ bool LLAssetStorage::findInCacheAndInvokeCallback(const LLUUID& uuid, LLAssetTyp llassert(callback != NULL); } - BOOL exists = LLVFile::getExists(uuid, type); + BOOL exists = LLDiskCache::getExists(uuid, type); if (exists) { - LLVFile file(uuid, type); + LLDiskCache file(uuid, type); U32 size = file.getSize(); if (size > 0) { @@ -523,8 +523,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, return; } - BOOL exists = LLVFile::getExists(uuid, type); - LLVFile file(uuid, type); + BOOL exists = LLDiskCache::getExists(uuid, type); + LLDiskCache file(uuid, type); U32 size = exists ? file.getSize() : 0; if (size > 0) @@ -664,7 +664,7 @@ void LLAssetStorage::downloadCompleteCallback( if (LL_ERR_NOERR == result) { // we might have gotten a zero-size file - LLVFile vfile(callback_id, callback_type); + LLDiskCache vfile(callback_id, callback_type); if (vfile.getSize() <= 0) { LL_WARNS("AssetStorage") << "downloadCompleteCallback has non-existent or zero-size asset " << callback_id << LL_ENDL; @@ -724,8 +724,8 @@ void LLAssetStorage::getEstateAsset( return; } - BOOL exists = LLVFile::getExists(asset_id, atype); - LLVFile file(asset_id, atype); + BOOL exists = LLDiskCache::getExists(asset_id, atype); + LLDiskCache file(asset_id, atype); U32 size = exists ? file.getSize() : 0; if (size > 0) @@ -818,7 +818,7 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback( if (LL_ERR_NOERR == result) { // we might have gotten a zero-size file - LLVFile vfile(req->getUUID(), req->getAType()); + LLDiskCache vfile(req->getUUID(), req->getAType()); if (vfile.getSize() <= 0) { LL_WARNS("AssetStorage") << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL; @@ -860,8 +860,8 @@ void LLAssetStorage::getInvItemAsset( return; } - exists = LLVFile::getExists(asset_id, atype); - LLVFile file(asset_id, atype); + exists = LLDiskCache::getExists(asset_id, atype); + LLDiskCache file(asset_id, atype); size = exists ? file.getSize() : 0; if(exists && size < 1) { @@ -961,7 +961,7 @@ void LLAssetStorage::downloadInvItemCompleteCallback( if (LL_ERR_NOERR == result) { // we might have gotten a zero-size file - LLVFile vfile(req->getUUID(), req->getType()); + LLDiskCache vfile(req->getUUID(), req->getType()); if (vfile.getSize() <= 0) { LL_WARNS("AssetStorage") << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL; @@ -1396,7 +1396,7 @@ void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid, if ( !status && !toxic ) { - LLVFile file(uuid, type); + LLDiskCache file(uuid, type); std::string uuid_str; diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index c931a89b5b..376558400c 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -37,7 +37,7 @@ #include "llsdserialize.h" #include "reader.h" // JSON #include "writer.h" // JSON -#include "llvfile.h" +#include "lldiskcache.h" #include "message.h" // for getting the port @@ -784,7 +784,7 @@ LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request // scoping for our streams so that they go away when we no longer need them. { LLCore::BufferArrayStream outs(fileData.get()); - LLVFile vfile(assetId, assetType, LLVFile::READ); + LLDiskCache vfile(assetId, assetType, LLDiskCache::READ); S32 fileSize = vfile.getSize(); U8* fileBuffer; diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp index 0156d1a5ef..7b00a95b00 100644 --- a/indra/llmessage/lltransfersourceasset.cpp +++ b/indra/llmessage/lltransfersourceasset.cpp @@ -32,7 +32,7 @@ #include "message.h" #include "lldatapacker.h" #include "lldir.h" -#include "llvfile.h" +#include "lldiskcache.h" LLTransferSourceAsset::LLTransferSourceAsset(const LLUUID &request_id, const F32 priority) : LLTransferSource(LLTST_ASSET, request_id, priority), @@ -99,7 +99,7 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, return LLTS_SKIP; } - LLVFile vf(mParams.getAssetID(), mParams.getAssetType(), LLVFile::READ); + LLDiskCache vf(mParams.getAssetID(), mParams.getAssetType(), LLDiskCache::READ); if (!vf.getSize()) { @@ -198,7 +198,7 @@ void LLTransferSourceAsset::responderCallback(const LLUUID& uuid, LLAssetType::E if (LL_ERR_NOERR == result) { // Everything's OK. - LLVFile vf(uuid, type, LLVFile::READ); + LLDiskCache vf(uuid, type, LLDiskCache::READ); tsap->mSize = vf.getSize(); status = LLTS_OK; } diff --git a/indra/llmessage/lltransfersourceasset.h b/indra/llmessage/lltransfersourceasset.h index 2c798d0598..d9055202ec 100644 --- a/indra/llmessage/lltransfersourceasset.h +++ b/indra/llmessage/lltransfersourceasset.h @@ -30,7 +30,7 @@ #include "lltransfermanager.h" #include "llassetstorage.h" -class LLVFile; +class LLDiskCache; class LLTransferSourceParamsAsset : public LLTransferSourceParams { diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index f2e0232a05..f4a5e71d08 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -30,7 +30,7 @@ #include "lldatapacker.h" #include "llerror.h" -#include "llvfile.h" +#include "lldiskcache.h" //static void LLTransferTargetVFile::updateQueue(bool shutdown) @@ -138,7 +138,7 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL; //LL_INFOS() << "Packet: " << packet_id << LL_ENDL; - LLVFile vf(mTempID, mParams.getAssetType(), LLVFile::APPEND); + LLDiskCache vf(mTempID, mParams.getAssetType(), LLDiskCache::APPEND); if (mNeedsCreate) { vf.setMaxSize(mSize); @@ -176,7 +176,7 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) case LLTS_DONE: if (!mNeedsCreate) { - LLVFile file(mTempID, mParams.getAssetType(), LLVFile::WRITE); + LLDiskCache file(mTempID, mParams.getAssetType(), LLDiskCache::WRITE); if (!file.rename(mParams.getAssetID(), mParams.getAssetType())) { LL_ERRS() << "LLTransferTargetVFile: rename failed" << LL_ENDL; @@ -195,7 +195,7 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) { // We're aborting this transfer, we don't want to keep this file. LL_WARNS() << "Aborting vfile transfer for " << mParams.getAssetID() << LL_ENDL; - LLVFile vf(mTempID, mParams.getAssetType(), LLVFile::APPEND); + LLDiskCache vf(mTempID, mParams.getAssetType(), LLDiskCache::APPEND); vf.remove(); } break; diff --git a/indra/llmessage/lltransfertargetvfile.h b/indra/llmessage/lltransfertargetvfile.h index c819c1e2f2..4c1bfe22c5 100644 --- a/indra/llmessage/lltransfertargetvfile.h +++ b/indra/llmessage/lltransfertargetvfile.h @@ -29,9 +29,9 @@ #include "lltransfermanager.h" #include "llassetstorage.h" -#include "llvfile.h" +#include "lldiskcache.h" -class LLVFile; +class LLDiskCache; // Lame, an S32 for now until I figure out the deal with how we want to do // error codes. diff --git a/indra/llmessage/llxfer_vfile.cpp b/indra/llmessage/llxfer_vfile.cpp index 0835970cfc..95629d5fea 100644 --- a/indra/llmessage/llxfer_vfile.cpp +++ b/indra/llmessage/llxfer_vfile.cpp @@ -30,7 +30,7 @@ #include "lluuid.h" #include "llerror.h" #include "llmath.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "lldir.h" // size of chunks read from/written to disk @@ -79,9 +79,9 @@ void LLXfer_VFile::cleanup () if (mTempID.notNull() && mDeleteTempFile) { - if (LLVFile::getExists(mTempID, mType)) + if (LLDiskCache::getExists(mTempID, mType)) { - LLVFile file(mTempID, mType, LLVFile::WRITE); + LLDiskCache file(mTempID, mType, LLDiskCache::WRITE); file.remove(); } else @@ -187,9 +187,9 @@ S32 LLXfer_VFile::startSend (U64 xfer_id, const LLHost &remote_host) delete mVFile; mVFile = NULL; - if(LLVFile::getExists(mLocalID, mType)) + if(LLDiskCache::getExists(mLocalID, mType)) { - mVFile = new LLVFile(mLocalID, mType, LLVFile::READ); + mVFile = new LLDiskCache(mLocalID, mType, LLDiskCache::READ); if (mVFile->getSize() <= 0) { @@ -235,9 +235,9 @@ S32 LLXfer_VFile::reopenFileHandle() if (mVFile == NULL) { - if (LLVFile::getExists(mLocalID, mType)) + if (LLDiskCache::getExists(mLocalID, mType)) { - mVFile = new LLVFile(mLocalID, mType, LLVFile::READ); + mVFile = new LLDiskCache(mLocalID, mType, LLDiskCache::READ); } else { @@ -260,7 +260,7 @@ void LLXfer_VFile::setXferSize (S32 xfer_size) // It would be nice if LLXFers could tell which end of the pipe they were if (! mVFile) { - LLVFile file(mTempID, mType, LLVFile::APPEND); + LLDiskCache file(mTempID, mType, LLDiskCache::APPEND); file.setMaxSize(xfer_size); } } @@ -315,7 +315,7 @@ S32 LLXfer_VFile::flush() S32 retval = 0; if (mBufferLength) { - LLVFile file(mTempID, mType, LLVFile::APPEND); + LLDiskCache file(mTempID, mType, LLDiskCache::APPEND); file.write((U8*)mBuffer, mBufferLength); @@ -335,9 +335,9 @@ S32 LLXfer_VFile::processEOF() if (!mCallbackResult) { - if (LLVFile::getExists(mTempID, mType)) + if (LLDiskCache::getExists(mTempID, mType)) { - LLVFile file(mTempID, mType, LLVFile::WRITE); + LLDiskCache file(mTempID, mType, LLDiskCache::WRITE); if (!file.rename(mLocalID, mType)) { LL_WARNS("Xfer") << "Cache rename of temp file failed: unable to rename " << mTempID << " to " << mLocalID << LL_ENDL; diff --git a/indra/llmessage/llxfer_vfile.h b/indra/llmessage/llxfer_vfile.h index d830c4be96..d6ac6ff818 100644 --- a/indra/llmessage/llxfer_vfile.h +++ b/indra/llmessage/llxfer_vfile.h @@ -30,7 +30,7 @@ #include "llxfer.h" #include "llassetstorage.h" -class LLVFile; +class LLDiskCache; class LLXfer_VFile : public LLXfer { @@ -40,7 +40,7 @@ class LLXfer_VFile : public LLXfer LLUUID mTempID; LLAssetType::EType mType; - LLVFile *mVFile; + LLDiskCache *mVFile; std::string mName; diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h index d1059d55de..fec0f9784f 100644 --- a/indra/llui/llviewereventrecorder.h +++ b/indra/llui/llviewereventrecorder.h @@ -32,7 +32,7 @@ #include "lldir.h" #include "llsd.h" #include "llfile.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "lldate.h" #include "llsdserialize.h" #include "llkeyboard.h" diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b9e3a44786..628a4da921 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -114,7 +114,7 @@ #include "llprimitive.h" #include "llurlaction.h" #include "llurlentry.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llvolumemgr.h" #include "llxfermanager.h" #include "llphysicsextensions.h" @@ -1874,8 +1874,8 @@ bool LLAppViewer::cleanup() SUBSYSTEM_CLEANUP(LLWorldMapView); SUBSYSTEM_CLEANUP(LLFolderViewItem); - LL_INFOS() << "Cleaning up VFILE" << LL_ENDL; - SUBSYSTEM_CLEANUP(LLVFile); + LL_INFOS() << "Cleaning up disk cache" << LL_ENDL; + SUBSYSTEM_CLEANUP(LLDiskCache); LL_INFOS() << "Saving Data" << LL_ENDL; @@ -4148,7 +4148,7 @@ bool LLAppViewer::initCache() LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()); - LLVFile::initClass(); + LLDiskCache::initClass(); return true; } diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 96a2f6796d..5ed8d24bcb 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -52,7 +52,7 @@ #include "lldir.h" #include "llnotificationsutil.h" #include "llviewerstats.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "lluictrlfactory.h" #include "lltrans.h" diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index bbb6409111..42bcb86454 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -32,7 +32,7 @@ #include "llimagej2c.h" #include "llimagetga.h" #include "llparcel.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llwindow.h" #include "message.h" @@ -201,7 +201,7 @@ void LLFloaterAuction::onClickSnapshot(void* data) LLPointer<LLImageTGA> tga = new LLImageTGA; tga->encode(raw); - LLVFile::writeFile(tga->getData(), tga->getDataSize(), self->mImageID, LLAssetType::AT_IMAGE_TGA); + LLDiskCache::writeFile(tga->getData(), tga->getDataSize(), self->mImageID, LLAssetType::AT_IMAGE_TGA); raw->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT); @@ -209,7 +209,7 @@ void LLFloaterAuction::onClickSnapshot(void* data) LLPointer<LLImageJ2C> j2c = new LLImageJ2C; j2c->encode(raw, 0.0f); - LLVFile::writeFile(j2c->getData(), j2c->getDataSize(), self->mImageID, LLAssetType::AT_TEXTURE); + LLDiskCache::writeFile(j2c->getData(), j2c->getDataSize(), self->mImageID, LLAssetType::AT_TEXTURE); self->mImage = LLViewerTextureManager::getLocalTexture((LLImageRaw*)raw, FALSE); gGL.getTexUnit(0)->bind(self->mImage); diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 88ea3d74fb..303b4836e4 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -32,7 +32,7 @@ #include "lldatapacker.h" #include "lldir.h" #include "llnotificationsutil.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llapr.h" #include "llstring.h" @@ -997,7 +997,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata) LLDataPackerBinaryBuffer dp(buffer, file_size); if (motionp->serialize(dp)) { - LLVFile file(motionp->getID(), LLAssetType::AT_ANIMATION, LLVFile::APPEND); + LLDiskCache file(motionp->getID(), LLAssetType::AT_ANIMATION, LLDiskCache::APPEND); S32 size = dp.getCurrentSize(); file.setMaxSize(size); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index bc35975cc6..057c4d0d5c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -77,7 +77,7 @@ #include "llspinctrl.h" #include "lltoggleablemenu.h" #include "lltrans.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llcallbacklist.h" #include "llviewerobjectlist.h" #include "llanimationstates.h" diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 4b67a0f605..d2ab15a9b4 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -36,7 +36,7 @@ #include "llglheaders.h" #include "llregionflags.h" #include "llstl.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llxfermanager.h" #include "indra_constants.h" #include "message.h" @@ -2239,7 +2239,7 @@ void LLPanelEstateCovenant::onLoadComplete(const LLUUID& asset_uuid, { if(0 == status) { - LLVFile file(asset_uuid, type, LLVFile::READ); + LLDiskCache file(asset_uuid, type, LLDiskCache::READ); S32 file_length = file.getSize(); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 09178166e9..d658352442 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -44,7 +44,7 @@ #include "llnotificationsutil.h" #include "llstring.h" #include "llsys.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "mean_collision_data.h" #include "message.h" #include "v3math.h" @@ -899,7 +899,7 @@ void LLFloaterReporter::takeScreenshot(bool use_prev_screenshot) mResourceDatap->mAssetInfo.setDescription("screenshot_descr"); // store in cache - LLVFile::writeFile(upload_data->getData(), + LLDiskCache::writeFile(upload_data->getData(), upload_data->getDataSize(), mResourceDatap->mAssetInfo.mUuid, mResourceDatap->mAssetInfo.mType); diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index bd403f68d7..96da13915c 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -40,7 +40,7 @@ #include "lltextbox.h" #include "llui.h" #include "lluictrlfactory.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "message.h" #include "llstartup.h" // login_alert_done #include "llcorehttputil.h" diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 119e0d21b2..82feb891bc 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -42,7 +42,7 @@ #include "llnotificationsutil.h" #include "llstl.h" #include "llstring.h" // todo: remove -#include "llvfile.h" +#include "lldiskcache.h" #include "message.h" // newview @@ -1055,7 +1055,7 @@ void LLGestureMgr::onLoadComplete(const LLUUID& asset_uuid, if (0 == status) { - LLVFile file(asset_uuid, type, LLVFile::READ); + LLDiskCache file(asset_uuid, type, LLDiskCache::READ); S32 size = file.getSize(); std::vector<char> buffer(size+1); diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 247ebf7719..a139d138f8 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -33,7 +33,7 @@ #include "llappviewer.h" #include "llagent.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewerstats.h" // Globals @@ -105,7 +105,7 @@ void LLLandmarkList::processGetAssetReply( { if( status == 0 ) { - LLVFile file(uuid, type); + LLDiskCache file(uuid, type); S32 file_length = file.getSize(); std::vector<char> buffer(file_length + 1); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 55c64508d2..6e58126847 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -49,7 +49,7 @@ #include "llsdutil_math.h" #include "llsdserialize.h" #include "llthread.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewercontrol.h" #include "llviewerinventory.h" #include "llviewermenufile.h" @@ -1335,7 +1335,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0) { //check cache for mesh skin info - LLVFile file(mesh_id, LLAssetType::AT_MESH); + LLDiskCache file(mesh_id, LLAssetType::AT_MESH); if (file.getSize() >= offset+size) { U8* buffer = new(std::nothrow) U8[size]; @@ -1431,7 +1431,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0) { //check cache for mesh skin info - LLVFile file(mesh_id, LLAssetType::AT_MESH); + LLDiskCache file(mesh_id, LLAssetType::AT_MESH); if (file.getSize() >= offset+size) { U8* buffer = new(std::nothrow) U8[size]; @@ -1528,7 +1528,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0) { //check cache for mesh physics shape info - LLVFile file(mesh_id, LLAssetType::AT_MESH); + LLDiskCache file(mesh_id, LLAssetType::AT_MESH); if (file.getSize() >= offset+size) { LLMeshRepository::sCacheBytesRead += size; @@ -1633,7 +1633,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c { //look for mesh in asset in cache - LLVFile file(mesh_params.getSculptID(), LLAssetType::AT_MESH); + LLDiskCache file(mesh_params.getSculptID(), LLAssetType::AT_MESH); S32 size = file.getSize(); @@ -1712,7 +1712,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, { //check cache for mesh asset - LLVFile file(mesh_id, LLAssetType::AT_MESH); + LLDiskCache file(mesh_id, LLAssetType::AT_MESH); if (file.getSize() >= offset+size) { U8* buffer = new(std::nothrow) U8[size]; @@ -3200,7 +3200,7 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b // only allocate as much space in the cache as is needed for the local cache data_size = llmin(data_size, bytes); - LLVFile file(mesh_id, LLAssetType::AT_MESH, LLVFile::WRITE); + LLDiskCache file(mesh_id, LLAssetType::AT_MESH, LLDiskCache::WRITE); if (file.getMaxSize() >= bytes || file.setMaxSize(bytes)) { LLMeshRepository::sCacheBytesWritten += data_size; @@ -3272,7 +3272,7 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body if (result == MESH_OK) { // good fetch from sim, write to cache - LLVFile file(mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE); + LLDiskCache file(mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLDiskCache::WRITE); S32 offset = mOffset; S32 size = mRequestedBytes; @@ -3336,7 +3336,7 @@ void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /* && gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size)) { // good fetch from sim, write to cache - LLVFile file(mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE); + LLDiskCache file(mMeshID, LLAssetType::AT_MESH, LLDiskCache::WRITE); S32 offset = mOffset; S32 size = mRequestedBytes; @@ -3384,7 +3384,7 @@ void LLMeshDecompositionHandler::processData(LLCore::BufferArray * /* body */, S && gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size)) { // good fetch from sim, write to cache - LLVFile file(mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE); + LLDiskCache file(mMeshID, LLAssetType::AT_MESH, LLDiskCache::WRITE); S32 offset = mOffset; S32 size = mRequestedBytes; @@ -3431,7 +3431,7 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3 && gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size)) { // good fetch from sim, write to cache for caching - LLVFile file(mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE); + LLDiskCache file(mMeshID, LLAssetType::AT_MESH, LLDiskCache::WRITE); S32 offset = mOffset; S32 size = mRequestedBytes; diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 852ba846ff..30604df944 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -32,7 +32,7 @@ // llcommon #include "llcommonutils.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llaccordionctrltab.h" #include "llappearancemgr.h" diff --git a/indra/newview/llpostcard.cpp b/indra/newview/llpostcard.cpp index 5201988d7c..1fd57ef555 100644 --- a/indra/newview/llpostcard.cpp +++ b/indra/newview/llpostcard.cpp @@ -28,7 +28,7 @@ #include "llpostcard.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewerregion.h" #include "message.h" diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index aaae6daf2c..c7f8f790f4 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -47,7 +47,7 @@ #include "llradiogroup.h" #include "llresmgr.h" #include "lltrans.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewerstats.h" @@ -852,7 +852,7 @@ void LLPreviewGesture::onLoadComplete(const LLUUID& asset_uuid, { if (0 == status) { - LLVFile file(asset_uuid, type, LLVFile::READ); + LLDiskCache file(asset_uuid, type, LLDiskCache::READ); S32 size = file.getSize(); std::vector<char> buffer(size+1); @@ -1137,7 +1137,7 @@ void LLPreviewGesture::saveIfNeeded() tid.generate(); assetId = tid.makeAssetID(gAgent.getSecureSessionID()); - LLVFile file(assetId, LLAssetType::AT_GESTURE, LLVFile::APPEND); + LLDiskCache file(assetId, LLAssetType::AT_GESTURE, LLDiskCache::APPEND); S32 size = dp.getCurrentSize(); file.setMaxSize(size); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 62ddfd5b3e..0b21ff5047 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -46,7 +46,7 @@ #include "llselectmgr.h" #include "lltrans.h" #include "llviewertexteditor.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewerinventory.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" @@ -337,7 +337,7 @@ void LLPreviewNotecard::onLoadComplete(const LLUUID& asset_uuid, { if(0 == status) { - LLVFile file(asset_uuid, type, LLVFile::READ); + LLDiskCache file(asset_uuid, type, LLDiskCache::READ); S32 file_length = file.getSize(); @@ -452,7 +452,7 @@ void LLPreviewNotecard::finishInventoryUpload(LLUUID itemId, LLUUID newAssetId, // script actually changed the asset. if (nc->hasEmbeddedInventory()) { - LLVFile::removeFile(newAssetId, LLAssetType::AT_NOTECARD); + LLDiskCache::removeFile(newAssetId, LLAssetType::AT_NOTECARD); } if (newItemId.isNull()) { @@ -477,7 +477,7 @@ void LLPreviewNotecard::finishTaskUpload(LLUUID itemId, LLUUID newAssetId, LLUUI { if (nc->hasEmbeddedInventory()) { - LLVFile::removeFile(newAssetId, LLAssetType::AT_NOTECARD); + LLDiskCache::removeFile(newAssetId, LLAssetType::AT_NOTECARD); } nc->setAssetId(newAssetId); nc->refreshFromInventory(); @@ -556,7 +556,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync) tid.generate(); asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - LLVFile file(asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND); + LLDiskCache file(asset_id, LLAssetType::AT_NOTECARD, LLDiskCache::APPEND); LLSaveNotecardInfo* info = new LLSaveNotecardInfo(this, mItemUUID, mObjectUUID, diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 2eedce9bc1..c2b687cf3b 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -51,7 +51,7 @@ #include "llsdserialize.h" #include "llslider.h" #include "lltooldraganddrop.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llagent.h" #include "llmenugl.h" @@ -1715,7 +1715,7 @@ void LLPreviewLSL::onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType t { if(0 == status) { - LLVFile file(asset_uuid, type); + LLDiskCache file(asset_uuid, type); S32 file_length = file.getSize(); std::vector<char> buffer(file_length+1); @@ -2020,7 +2020,7 @@ void LLLiveLSLEditor::onLoadComplete(const LLUUID& asset_id, void LLLiveLSLEditor::loadScriptText(const LLUUID &uuid, LLAssetType::EType type) { - LLVFile file(uuid, type); + LLDiskCache file(uuid, type); S32 file_length = file.getSize(); std::vector<char> buffer(file_length + 1); file.read((U8*)&buffer[0], file_length); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 0084180cf8..62dc9f24bd 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -57,7 +57,7 @@ #include "llinventorymodel.h" #include "llassetstorage.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "lldrawpoolwater.h" #include <boost/algorithm/string/replace.hpp> @@ -303,7 +303,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(const LLUUID &asset_id, S32 statu LLSettingsBase::ptr_t settings; if (!status) { - LLVFile file(asset_id, LLAssetType::AT_SETTINGS, LLVFile::READ); + LLDiskCache file(asset_id, LLAssetType::AT_SETTINGS, LLDiskCache::READ); S32 size = file.getSize(); std::string buffer(size + 1, '\0'); diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 4b8ceba80f..50523e981a 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -50,7 +50,7 @@ #include "llviewercontrol.h" #include "llviewermenufile.h" // upload_new_resource() #include "llviewerstats.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llwindow.h" #include "llworld.h" #include <boost/filesystem.hpp> @@ -1005,7 +1005,7 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) if (formatted->encode(scaled, 0.0f)) { - LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), new_asset_id, LLAssetType::AT_TEXTURE); + LLDiskCache::writeFile(formatted->getData(), formatted->getDataSize(), new_asset_id, LLAssetType::AT_TEXTURE); std::string pos_string; LLAgentUI::buildLocationString(pos_string, LLAgentUI::LOCATION_FORMAT_FULL); std::string who_took_it; diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index b4e1e2633b..e9c8909fe4 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -28,7 +28,7 @@ #include "llviewerassetstorage.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "message.h" #include "llagent.h" @@ -151,13 +151,13 @@ void LLViewerAssetStorage::storeAssetData( if (mUpstreamHost.isOk()) { - if (LLVFile::getExists(asset_id, asset_type)) + if (LLDiskCache::getExists(asset_id, asset_type)) { // Pack data into this packet if we can fit it. U8 buffer[MTUBYTES]; buffer[0] = 0; - LLVFile vfile(asset_id, asset_type, LLVFile::READ); + LLDiskCache vfile(asset_id, asset_type, LLDiskCache::READ); S32 asset_size = vfile.getSize(); LLAssetRequest *req = new LLAssetRequest(asset_id, asset_type); @@ -179,7 +179,7 @@ void LLViewerAssetStorage::storeAssetData( else { // LLAssetStorage metric: Successful Request - S32 size = LLVFile::getFileSize(asset_id, asset_type); + S32 size = LLDiskCache::getFileSize(asset_id, asset_type); const char *message = "Added to upload queue"; reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, size, MR_OKAY, __FILE__, __LINE__, message ); @@ -290,7 +290,7 @@ void LLViewerAssetStorage::storeAssetData( legacy->mUpCallback = callback; legacy->mUserData = user_data; - LLVFile file(asset_id, asset_type, LLVFile::WRITE); + LLDiskCache file(asset_id, asset_type, LLDiskCache::WRITE); file.setMaxSize(size); @@ -526,7 +526,7 @@ void LLViewerAssetStorage::assetRequestCoro( // case. LLUUID temp_id; temp_id.generate(); - LLVFile vf(temp_id, atype, LLVFile::WRITE); + LLDiskCache vf(temp_id, atype, LLDiskCache::WRITE); vf.setMaxSize(size); req->mBytesFetched = size; if (!vf.write(raw.data(),size)) diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h index 5d3f01fbb5..e65bdc1aea 100644 --- a/indra/newview/llviewerassetstorage.h +++ b/indra/newview/llviewerassetstorage.h @@ -30,7 +30,7 @@ #include "llassetstorage.h" #include "llcorehttputil.h" -class LLVFile; +class LLDiskCache; class LLViewerAssetRequest; diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index d14b6b0568..d62962514c 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -45,7 +45,7 @@ #include "llviewerassetupload.h" #include "llappviewer.h" #include "llviewerstats.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llgesturemgr.h" #include "llpreviewnotecard.h" #include "llpreviewgesture.h" @@ -472,7 +472,7 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() infile.open(filename, LL_APR_RB, NULL, &file_size); if (infile.getFileHandle()) { - LLVFile file(getAssetId(), assetType, LLVFile::WRITE); + LLDiskCache file(getAssetId(), assetType, LLDiskCache::WRITE); file.setMaxSize(file_size); @@ -565,7 +565,7 @@ LLSD LLBufferedAssetUploadInfo::prepareUpload() if (getAssetId().isNull()) generateNewAssetId(); - LLVFile file(getAssetId(), getAssetType(), LLVFile::APPEND); + LLDiskCache file(getAssetId(), getAssetType(), LLDiskCache::APPEND); S32 size = mContents.length() + 1; file.setMaxSize(size); @@ -597,7 +597,7 @@ LLUUID LLBufferedAssetUploadInfo::finishUpload(LLSD &result) if (mStoredToCache) { LLAssetType::EType assetType(getAssetType()); - LLVFile::renameFile(getAssetId(), assetType, newAssetId, assetType); + LLDiskCache::renameFile(getAssetId(), assetType, newAssetId, assetType); } if (mTaskUpload) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index cbf490d68d..6d4e12528d 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -53,7 +53,7 @@ #include "llviewercontrol.h" // gSavedSettings #include "llviewertexturelist.h" #include "lluictrlfactory.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewerinventory.h" #include "llviewermenu.h" // gMenuHolder #include "llviewerparcelmgr.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2d41560441..10ee92c130 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -44,7 +44,7 @@ #include "llteleportflags.h" #include "lltoastnotifypanel.h" #include "lltransactionflags.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llxfermanager.h" #include "mean_collision_data.h" @@ -6816,7 +6816,7 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid, std::string covenant_text; if(0 == status) { - LLVFile file(asset_uuid, type, LLVFile::READ); + LLDiskCache file(asset_uuid, type, LLDiskCache::READ); S32 file_length = file.getSize(); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 470704d84e..874982ed60 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -33,7 +33,7 @@ #include "llfloaterreg.h" #include "llmemory.h" #include "lltimer.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llappviewer.h" diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index b1cbdc4443..5c36635923 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -31,7 +31,7 @@ #include "llagent.h" #include "llimagej2c.h" #include "llnotificationsutil.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llviewerregion.h" #include "llglslshader.h" #include "llvoavatarself.h" diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 8782f282bf..f12ab59e2b 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -39,7 +39,7 @@ #include "llimagej2c.h" #include "llimagetga.h" #include "llstl.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "message.h" #include "lltimer.h" diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 69568cc825..57a2421065 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -54,7 +54,7 @@ class LLTexturePipelineTester ; typedef void (*loaded_callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); -class LLVFile; +class LLDiskCache; class LLMessageSystem; class LLViewerMediaImpl ; class LLVOVolume ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 312a8726ca..e0727d51ba 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -41,7 +41,7 @@ #include "llsdserialize.h" #include "llsys.h" -#include "llvfile.h" +#include "lldiskcache.h" #include "llxmltree.h" #include "message.h" |