| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.
    h" | 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.
    h" | 
| 6 | 6 | 
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" | 
| 8 #include "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
    le_util.h" | 8 #include "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
    le_util.h" | 
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" | 
| 10 #include "webkit/browser/blob/file_stream_reader.h" | 10 #include "webkit/browser/blob/file_stream_reader.h" | 
| 11 #include "webkit/browser/fileapi/file_stream_writer.h" | 11 #include "webkit/browser/fileapi/file_stream_writer.h" | 
| 12 #include "webkit/browser/fileapi/file_system_url.h" | 12 #include "webkit/browser/fileapi/file_system_url.h" | 
| 13 | 13 | 
| 14 using content::BrowserThread; | 14 using content::BrowserThread; | 
| 15 | 15 | 
| 16 namespace chromeos { | 16 namespace chromeos { | 
| 17 namespace file_system_provider { | 17 namespace file_system_provider { | 
| 18 | 18 | 
| 19 BackendDelegate::BackendDelegate() | 19 BackendDelegate::BackendDelegate() | 
| 20     : async_file_util_(new internal::ProviderAsyncFileUtil) {} | 20     : async_file_util_(new internal::ProviderAsyncFileUtil) {} | 
| 21 | 21 | 
| 22 BackendDelegate::~BackendDelegate() {} | 22 BackendDelegate::~BackendDelegate() {} | 
| 23 | 23 | 
| 24 fileapi::AsyncFileUtil* BackendDelegate::GetAsyncFileUtil( | 24 fileapi::AsyncFileUtil* BackendDelegate::GetAsyncFileUtil( | 
| 25     fileapi::FileSystemType type) { | 25     fileapi::FileSystemType type) { | 
| 26   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 26   DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| 27   DCHECK_EQ(fileapi::kFileSystemTypeProvided, type); | 27   DCHECK_EQ(fileapi::kFileSystemTypeProvided, type); | 
| 28   return async_file_util_.get(); | 28   return async_file_util_.get(); | 
| 29 } | 29 } | 
| 30 | 30 | 
| 31 scoped_ptr<webkit_blob::FileStreamReader> | 31 scoped_ptr<webkit_blob::FileStreamReader> | 
| 32 BackendDelegate::CreateFileStreamReader( | 32 BackendDelegate::CreateFileStreamReader( | 
| 33     const fileapi::FileSystemURL& url, | 33     const fileapi::FileSystemURL& url, | 
| 34     int64 offset, | 34     int64 offset, | 
| 35     const base::Time& expected_modification_time, | 35     const base::Time& expected_modification_time, | 
| 36     fileapi::FileSystemContext* context) { | 36     fileapi::FileSystemContext* context) { | 
| 37   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 37   DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| 38   DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); | 38   DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); | 
| 39   NOTIMPLEMENTED(); | 39   NOTIMPLEMENTED(); | 
| 40   return scoped_ptr<webkit_blob::FileStreamReader>(); | 40   return scoped_ptr<webkit_blob::FileStreamReader>(); | 
| 41 } | 41 } | 
| 42 | 42 | 
| 43 scoped_ptr<fileapi::FileStreamWriter> BackendDelegate::CreateFileStreamWriter( | 43 scoped_ptr<fileapi::FileStreamWriter> BackendDelegate::CreateFileStreamWriter( | 
| 44     const fileapi::FileSystemURL& url, | 44     const fileapi::FileSystemURL& url, | 
| 45     int64 offset, | 45     int64 offset, | 
| 46     fileapi::FileSystemContext* context) { | 46     fileapi::FileSystemContext* context) { | 
| 47   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 47   DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| 48   DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); | 48   DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); | 
| 49   NOTIMPLEMENTED(); | 49   NOTIMPLEMENTED(); | 
| 50   return scoped_ptr<fileapi::FileStreamWriter>(); | 50   return scoped_ptr<fileapi::FileStreamWriter>(); | 
| 51 } | 51 } | 
| 52 | 52 | 
| 53 }  // namespace file_system_provider | 53 }  // namespace file_system_provider | 
| 54 }  // namespace chromeos | 54 }  // namespace chromeos | 
| OLD | NEW | 
|---|