summaryrefslogtreecommitdiff
path: root/chromium/storage
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-01 12:59:39 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-04 12:40:43 +0000
commit28b1110370900897ab652cb420c371fab8857ad4 (patch)
tree41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/storage
parent399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff)
downloadqtwebengine-chromium-28b1110370900897ab652cb420c371fab8857ad4.tar.gz
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions. Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/storage')
-rw-r--r--chromium/storage/browser/blob/blob_reader.cc3
-rw-r--r--chromium/storage/browser/blob/blob_reader.h3
-rw-r--r--chromium/storage/browser/blob/blob_url_request_job.cc6
-rw-r--r--chromium/storage/browser/blob/scoped_file.h8
-rw-r--r--chromium/storage/browser/blob/view_blob_internals_job.cc11
-rw-r--r--chromium/storage/browser/fileapi/file_system_dir_url_request_job.cc11
-rw-r--r--chromium/storage/browser/fileapi/file_system_url_request_job.cc11
-rw-r--r--chromium/storage/browser/fileapi/file_writer_delegate.cc18
-rw-r--r--chromium/storage/browser/quota/quota_manager.cc33
-rw-r--r--chromium/storage/browser/quota/quota_task.cc4
-rw-r--r--chromium/storage/common/BUILD.gn5
-rw-r--r--chromium/storage/common/data_element.h2
-rw-r--r--chromium/storage/common/database/database_connections.cc4
13 files changed, 57 insertions, 62 deletions
diff --git a/chromium/storage/browser/blob/blob_reader.cc b/chromium/storage/browser/blob/blob_reader.cc
index 2eafdbcc77e..b342fc907c5 100644
--- a/chromium/storage/browser/blob/blob_reader.cc
+++ b/chromium/storage/browser/blob/blob_reader.cc
@@ -226,6 +226,9 @@ void BlobReader::Kill() {
}
bool BlobReader::IsInMemory() const {
+ if (blob_handle_ && blob_handle_->IsBeingBuilt()) {
+ return false;
+ }
if (!blob_data_.get()) {
return true;
}
diff --git a/chromium/storage/browser/blob/blob_reader.h b/chromium/storage/browser/blob/blob_reader.h
index a3c7cfa10a5..0a5a4b44c82 100644
--- a/chromium/storage/browser/blob/blob_reader.h
+++ b/chromium/storage/browser/blob/blob_reader.h
@@ -120,7 +120,8 @@ class STORAGE_EXPORT BlobReader {
// after this call.
void Kill();
- // Returns if all of the blob's items are in memory.
+ // Returns if all of the blob's items are in memory. Should only be called
+ // after CalculateSize.
bool IsInMemory() const;
// Returns the remaining bytes to be read in the blob. This is populated
diff --git a/chromium/storage/browser/blob/blob_url_request_job.cc b/chromium/storage/browser/blob/blob_url_request_job.cc
index bdaff148683..24882d5e2c9 100644
--- a/chromium/storage/browser/blob/blob_url_request_job.cc
+++ b/chromium/storage/browser/blob/blob_url_request_job.cc
@@ -15,11 +15,13 @@
#include "base/compiler_specific.h"
#include "base/files/file_util_proxy.h"
#include "base/format_macros.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/numerics/safe_conversions.h"
+#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -63,7 +65,7 @@ BlobURLRequestJob::BlobURLRequestJob(
void BlobURLRequestJob::Start() {
// Continue asynchronously.
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&BlobURLRequestJob::DidStart, weak_factory_.GetWeakPtr()));
}
diff --git a/chromium/storage/browser/blob/scoped_file.h b/chromium/storage/browser/blob/scoped_file.h
index 583ce783927..da834740ac5 100644
--- a/chromium/storage/browser/blob/scoped_file.h
+++ b/chromium/storage/browser/blob/scoped_file.h
@@ -9,8 +9,8 @@
#include "base/callback_forward.h"
#include "base/files/file_path.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/move.h"
#include "storage/browser/storage_browser_export.h"
namespace base {
@@ -27,8 +27,6 @@ namespace storage {
// TODO(kinuko): Probably this can be moved under base or somewhere more
// common place.
class STORAGE_EXPORT ScopedFile {
- MOVE_ONLY_TYPE_FOR_CPP_03(ScopedFile)
-
public:
typedef base::Callback<void(const base::FilePath&)> ScopeOutCallback;
typedef std::pair<ScopeOutCallback, scoped_refptr<base::TaskRunner> >
@@ -48,8 +46,6 @@ class STORAGE_EXPORT ScopedFile {
ScopeOutPolicy policy,
const scoped_refptr<base::TaskRunner>& file_task_runner);
- // Move constructor and operator. The data of r-value will be transfered
- // in a destructive way. (See base/move.h)
ScopedFile(ScopedFile&& other);
ScopedFile& operator=(ScopedFile&& rhs) {
MoveFrom(rhs);
@@ -84,6 +80,8 @@ class STORAGE_EXPORT ScopedFile {
ScopeOutPolicy scope_out_policy_;
scoped_refptr<base::TaskRunner> file_task_runner_;
ScopeOutCallbackList scope_out_callbacks_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedFile);
};
} // namespace storage
diff --git a/chromium/storage/browser/blob/view_blob_internals_job.cc b/chromium/storage/browser/blob/view_blob_internals_job.cc
index 287f9943939..269a56036fe 100644
--- a/chromium/storage/browser/blob/view_blob_internals_job.cc
+++ b/chromium/storage/browser/blob/view_blob_internals_job.cc
@@ -12,12 +12,14 @@
#include "base/format_macros.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/time_formatting.h"
+#include "base/location.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/disk_cache.h"
@@ -108,10 +110,9 @@ ViewBlobInternalsJob::~ViewBlobInternalsJob() {
}
void ViewBlobInternalsJob::Start() {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&ViewBlobInternalsJob::StartAsync,
- weak_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ViewBlobInternalsJob::StartAsync,
+ weak_factory_.GetWeakPtr()));
}
bool ViewBlobInternalsJob::IsRedirectResponse(GURL* location,
diff --git a/chromium/storage/browser/fileapi/file_system_dir_url_request_job.cc b/chromium/storage/browser/fileapi/file_system_dir_url_request_job.cc
index b280d5540b8..de0857aa82c 100644
--- a/chromium/storage/browser/fileapi/file_system_dir_url_request_job.cc
+++ b/chromium/storage/browser/fileapi/file_system_dir_url_request_job.cc
@@ -10,9 +10,11 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "net/base/directory_listing.h"
@@ -56,10 +58,9 @@ int FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest,
}
void FileSystemDirURLRequestJob::Start() {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&FileSystemDirURLRequestJob::StartAsync,
- weak_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FileSystemDirURLRequestJob::StartAsync,
+ weak_factory_.GetWeakPtr()));
}
void FileSystemDirURLRequestJob::Kill() {
diff --git a/chromium/storage/browser/fileapi/file_system_url_request_job.cc b/chromium/storage/browser/fileapi/file_system_url_request_job.cc
index 28b9ea69822..30fb47d2589 100644
--- a/chromium/storage/browser/fileapi/file_system_url_request_job.cc
+++ b/chromium/storage/browser/fileapi/file_system_url_request_job.cc
@@ -12,9 +12,11 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/files/file_util_proxy.h"
+#include "base/location.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/threading/thread_restrictions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "net/base/file_stream.h"
@@ -70,10 +72,9 @@ FileSystemURLRequestJob::FileSystemURLRequestJob(
FileSystemURLRequestJob::~FileSystemURLRequestJob() {}
void FileSystemURLRequestJob::Start() {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&FileSystemURLRequestJob::StartAsync,
- weak_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FileSystemURLRequestJob::StartAsync,
+ weak_factory_.GetWeakPtr()));
}
void FileSystemURLRequestJob::Kill() {
diff --git a/chromium/storage/browser/fileapi/file_writer_delegate.cc b/chromium/storage/browser/fileapi/file_writer_delegate.cc
index 2050ca0b135..97327938b82 100644
--- a/chromium/storage/browser/fileapi/file_writer_delegate.cc
+++ b/chromium/storage/browser/fileapi/file_writer_delegate.cc
@@ -12,9 +12,11 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_util_proxy.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/sequenced_task_runner.h"
+#include "base/single_thread_task_runner.h"
#include "base/threading/thread_restrictions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "net/base/net_errors.h"
#include "storage/browser/fileapi/file_stream_writer.h"
#include "storage/browser/fileapi/file_system_context.h"
@@ -113,10 +115,9 @@ void FileWriterDelegate::Read() {
bytes_written_ = 0;
bytes_read_ = 0;
if (request_->Read(io_buffer_.get(), io_buffer_->size(), &bytes_read_)) {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&FileWriterDelegate::OnDataReceived,
- weak_factory_.GetWeakPtr(), bytes_read_));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FileWriterDelegate::OnDataReceived,
+ weak_factory_.GetWeakPtr(), bytes_read_));
} else if (!request_->status().is_io_pending()) {
OnError(base::File::FILE_ERROR_FAILED);
}
@@ -144,10 +145,9 @@ void FileWriterDelegate::Write() {
base::Bind(&FileWriterDelegate::OnDataWritten,
weak_factory_.GetWeakPtr()));
if (write_response > 0) {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&FileWriterDelegate::OnDataWritten,
- weak_factory_.GetWeakPtr(), write_response));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FileWriterDelegate::OnDataWritten,
+ weak_factory_.GetWeakPtr(), write_response));
} else if (net::ERR_IO_PENDING != write_response) {
OnError(NetErrorToFileError(write_response));
}
diff --git a/chromium/storage/browser/quota/quota_manager.cc b/chromium/storage/browser/quota/quota_manager.cc
index ad23d41ec83..79268a61a29 100644
--- a/chromium/storage/browser/quota/quota_manager.cc
+++ b/chromium/storage/browser/quota/quota_manager.cc
@@ -36,18 +36,6 @@
#include "storage/browser/quota/usage_tracker.h"
#include "storage/common/quota/quota_types.h"
-// Platform specific includes for GetVolumeInfo().
-#if defined(OS_WIN)
-#include <windows.h>
-#elif defined(OS_POSIX)
-#if defined(OS_ANDROID)
-#include <sys/vfs.h>
-#define statvfs statfs // Android uses a statvfs-like statfs struct and call.
-#else
-#include <sys/statvfs.h>
-#endif
-#endif
-
#define UMA_HISTOGRAM_MBYTES(name, sample) \
UMA_HISTOGRAM_CUSTOM_COUNTS( \
(name), static_cast<int>((sample) / kMBytes), \
@@ -1860,21 +1848,16 @@ bool QuotaManager::GetVolumeInfo(const base::FilePath& path,
uint64_t* total_size) {
// Inspired by similar code in the base::SysInfo class.
base::ThreadRestrictions::AssertIOAllowed();
-#if defined(OS_WIN)
- ULARGE_INTEGER available, total, free;
- if (!GetDiskFreeSpaceExW(path.value().c_str(), &available, &total, &free))
+
+ int64_t available = base::SysInfo::AmountOfFreeDiskSpace(path);
+ if (available < 0)
return false;
- *available_space = static_cast<uint64_t>(available.QuadPart);
- *total_size = static_cast<uint64_t>(total.QuadPart);
-#elif defined(OS_POSIX)
- struct statvfs stats;
- if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0)
+ int64_t total = base::SysInfo::AmountOfTotalDiskSpace(path);
+ if (total < 0)
return false;
- *available_space = static_cast<uint64_t>(stats.f_bavail) * stats.f_frsize;
- *total_size = static_cast<uint64_t>(stats.f_blocks) * stats.f_frsize;
-#else
-#error Not implemented
-#endif
+
+ *available_space = static_cast<uint64_t>(available);
+ *total_size = static_cast<uint64_t>(total);
return true;
}
diff --git a/chromium/storage/browser/quota/quota_task.cc b/chromium/storage/browser/quota/quota_task.cc
index 2a21b48d3bd..1624785c7b6 100644
--- a/chromium/storage/browser/quota/quota_task.cc
+++ b/chromium/storage/browser/quota/quota_task.cc
@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/location.h"
-#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
using base::TaskRunner;
@@ -52,7 +52,7 @@ void QuotaTask::DeleteSoon() {
if (delete_scheduled_)
return;
delete_scheduled_ = true;
- base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
// QuotaTaskObserver -------------------------------------------------------
diff --git a/chromium/storage/common/BUILD.gn b/chromium/storage/common/BUILD.gn
index 35669e106f3..a524eff74ce 100644
--- a/chromium/storage/common/BUILD.gn
+++ b/chromium/storage/common/BUILD.gn
@@ -32,7 +32,10 @@ component("common") {
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
- configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
+ configs += [
+ "//build/config/compiler:no_size_t_to_int_warning",
+ "//build/config/compiler:wexit_time_destructors",
+ ]
defines = [ "STORAGE_COMMON_IMPLEMENTATION" ]
diff --git a/chromium/storage/common/data_element.h b/chromium/storage/common/data_element.h
index 08fea6e6767..276181b6ec9 100644
--- a/chromium/storage/common/data_element.h
+++ b/chromium/storage/common/data_element.h
@@ -42,7 +42,7 @@ class STORAGE_COMMON_EXPORT DataElement {
~DataElement();
Type type() const { return type_; }
- const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; }
+ const char* bytes() const { return bytes_ ? bytes_ : buf_.data(); }
const base::FilePath& path() const { return path_; }
const GURL& filesystem_url() const { return filesystem_url_; }
const std::string& blob_uuid() const { return blob_uuid_; }
diff --git a/chromium/storage/common/database/database_connections.cc b/chromium/storage/common/database/database_connections.cc
index f6931d3942b..bbc7afcbd74 100644
--- a/chromium/storage/common/database/database_connections.cc
+++ b/chromium/storage/common/database/database_connections.cc
@@ -153,7 +153,9 @@ void DatabaseConnectionsWrapper::RemoveOpenConnection(
bool DatabaseConnectionsWrapper::WaitForAllDatabasesToClose(
base::TimeDelta timeout) {
- base::WaitableEvent waitable_event(true, false);
+ base::WaitableEvent waitable_event(
+ base::WaitableEvent::ResetPolicy::MANUAL,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
{
base::AutoLock auto_lock(open_connections_lock_);
if (open_connections_.IsEmpty())