Lines Matching refs:FILE
3 // found in the LICENSE file.
69 AsyncWriter(FILE* file, int32 offset, const void* data, size_t data_len)
70 : file_(file),
84 static bool WriteToFile(FILE* file,
88 if (fseek(file, offset, SEEK_SET) != 0)
89 return false; // Don't write to an invalid part of the file.
91 size_t num_written = fwrite(data, 1, data_len, file);
97 int ret = fflush(file);
104 FILE* file_;
105 int32 offset_; // Offset from the beginning of the file.
114 // Used to asynchronously set the end of the file. This must be done on the
118 explicit AsyncSetEndOfFile(FILE* file) : file_(file) {}
125 FILE* file_;
129 // Used to asynchronously close a file. This must be done on the same thread as
133 explicit AsyncCloseHandle(FILE* file) : file_(file) {}
140 FILE* file_;
301 // Not rebuilding, so we want to keep the file on disk up-to-date.
316 // Keeps the file on disk up-to-date.
433 // Nobody wrote this out for us, write the full file to disk.
500 // This function can get called when the file is open, for example, when we
501 // resize the table. We must handle this case and not try to reopen the file,
502 // since there may be write operations pending on the file I/O thread.
505 // there can be a partial file, but the short file will be detected next time
510 // that the file size is different when we load it back in, and then we will
517 DLOG(ERROR) << "Failed to open file " << filename.value();
537 BrowserThread::FILE, FROM_HERE, new AsyncSetEndOfFile(file_));
601 bool VisitedLinkMaster::ReadFileHeader(FILE* file,
605 // Get file size.
607 // file since ReadFromFile() [which is the next call accessing the file]
609 if (fseek(file, 0, SEEK_END) == -1)
611 size_t file_size = ftell(file);
617 if (!ReadFromFile(file, 0, &header, kFileHeaderSize))
634 // Read the table size and make sure it matches the file size.
647 // This file looks OK from the header's perspective.
729 BrowserThread::FILE, FROM_HERE, new AsyncCloseHandle(file_));
826 // See the TableBuilder definition in the header file for how this works.
904 void VisitedLinkMaster::WriteToFile(FILE* file,
913 BrowserThread::FILE, FROM_HERE,
914 new AsyncWriter(file, offset, data, data_size));
943 bool VisitedLinkMaster::ReadFromFile(FILE* file,
953 if (fseek(file, offset, SEEK_SET) != 0)
956 size_t num_read = fread(data, 1, data_size, file);