diff options
author | tommycli@chromium.org <tommycli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-24 23:06:56 +0000 |
---|---|---|
committer | tommycli@chromium.org <tommycli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-24 23:06:56 +0000 |
commit | 4c3c2aa023393009dddd42ad0dd989feb4df6e35 (patch) | |
tree | 3511737765b936882112d0937d7eeb2df827816b /webkit/browser | |
parent | 044e86998a829be0e0bae20cffd8e6834ab10a1e (diff) | |
download | chromium_src-4c3c2aa023393009dddd42ad0dd989feb4df6e35.zip chromium_src-4c3c2aa023393009dddd42ad0dd989feb4df6e35.tar.gz chromium_src-4c3c2aa023393009dddd42ad0dd989feb4df6e35.tar.bz2 |
MTP Streaming: Linux streaming infrastructure changes.
BUG=110119
Review URL: https://codereview.chromium.org/107833003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/browser')
-rw-r--r-- | webkit/browser/blob/file_stream_reader.cc | 21 | ||||
-rw-r--r-- | webkit/browser/blob/file_stream_reader.h | 6 | ||||
-rw-r--r-- | webkit/browser/blob/local_file_stream_reader.cc | 8 |
3 files changed, 27 insertions, 8 deletions
diff --git a/webkit/browser/blob/file_stream_reader.cc b/webkit/browser/blob/file_stream_reader.cc new file mode 100644 index 0000000..1b56287 --- /dev/null +++ b/webkit/browser/blob/file_stream_reader.cc @@ -0,0 +1,21 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/browser/blob/file_stream_reader.h" + +#include "base/platform_file.h" +#include "base/time/time.h" + +namespace webkit_blob { + +// Verify if the underlying file has not been modified. +bool FileStreamReader::VerifySnapshotTime( + const base::Time& expected_modification_time, + const base::PlatformFileInfo& file_info) { + return expected_modification_time.is_null() || + expected_modification_time.ToTimeT() == + file_info.last_modified.ToTimeT(); +} + +} // namespace webkit_blob diff --git a/webkit/browser/blob/file_stream_reader.h b/webkit/browser/blob/file_stream_reader.h index d60dfdb..2f3d060 100644 --- a/webkit/browser/blob/file_stream_reader.h +++ b/webkit/browser/blob/file_stream_reader.h @@ -12,6 +12,7 @@ namespace base { class FilePath; +struct PlatformFileInfo; class TaskRunner; class Time; } @@ -56,6 +57,11 @@ class FileStreamReader { int64 initial_offset, const base::Time& expected_modification_time); + // Verify if the underlying file has not been modified. + WEBKIT_STORAGE_BROWSER_EXPORT static bool VerifySnapshotTime( + const base::Time& expected_modification_time, + const base::PlatformFileInfo& file_info); + // It is valid to delete the reader at any time. If the stream is deleted // while it has a pending read, its callback will not be called. virtual ~FileStreamReader() {} diff --git a/webkit/browser/blob/local_file_stream_reader.cc b/webkit/browser/blob/local_file_stream_reader.cc index 0686821..fdf2b06 100644 --- a/webkit/browser/blob/local_file_stream_reader.cc +++ b/webkit/browser/blob/local_file_stream_reader.cc @@ -22,14 +22,6 @@ const int kOpenFlagsForRead = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ | base::PLATFORM_FILE_ASYNC; -// Verify if the underlying file has not been modified. -bool VerifySnapshotTime(const base::Time& expected_modification_time, - const base::PlatformFileInfo& file_info) { - return expected_modification_time.is_null() || - expected_modification_time.ToTimeT() == - file_info.last_modified.ToTimeT(); -} - } // namespace FileStreamReader* FileStreamReader::CreateForLocalFile( |