Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: chrome/browser/chromeos/drive/file_system_backend_delegate.cc

Issue 148913005: Create fileapi/ subdirectory under c/b/cros/drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/file_system_backend_delegate.cc
diff --git a/chrome/browser/chromeos/drive/file_system_backend_delegate.cc b/chrome/browser/chromeos/drive/file_system_backend_delegate.cc
deleted file mode 100644
index ee606b600ab6d30ff15569b0573ca4407373141d..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drive/file_system_backend_delegate.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2013 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 "chrome/browser/chromeos/drive/file_system_backend_delegate.h"
-
-#include "base/bind.h"
-#include "base/files/file_path.h"
-#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/chromeos/drive/async_file_util.h"
-#include "chrome/browser/chromeos/drive/file_system_util.h"
-#include "chrome/browser/chromeos/drive/webkit_file_stream_reader_impl.h"
-#include "chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_thread.h"
-#include "webkit/browser/blob/file_stream_reader.h"
-#include "webkit/browser/fileapi/async_file_util.h"
-#include "webkit/browser/fileapi/file_system_context.h"
-#include "webkit/browser/fileapi/file_system_url.h"
-
-using content::BrowserThread;
-
-namespace drive {
-
-FileSystemBackendDelegate::FileSystemBackendDelegate(
- content::BrowserContext* browser_context)
- : profile_id_(Profile::FromBrowserContext(browser_context)),
- async_file_util_(new internal::AsyncFileUtil(
- base::Bind(&util::GetFileSystemByProfileId, profile_id_))) {
- DCHECK(profile_id_);
-}
-
-FileSystemBackendDelegate::~FileSystemBackendDelegate() {
-}
-
-fileapi::AsyncFileUtil* FileSystemBackendDelegate::GetAsyncFileUtil(
- fileapi::FileSystemType type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DCHECK_EQ(fileapi::kFileSystemTypeDrive, type);
- return async_file_util_.get();
-}
-
-scoped_ptr<webkit_blob::FileStreamReader>
-FileSystemBackendDelegate::CreateFileStreamReader(
- const fileapi::FileSystemURL& url,
- int64 offset,
- const base::Time& expected_modification_time,
- fileapi::FileSystemContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DCHECK_EQ(fileapi::kFileSystemTypeDrive, url.type());
-
- base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url);
- if (file_path.empty())
- return scoped_ptr<webkit_blob::FileStreamReader>();
-
- return scoped_ptr<webkit_blob::FileStreamReader>(
- new internal::WebkitFileStreamReaderImpl(
- base::Bind(&util::GetFileSystemByProfileId, profile_id_),
- context->default_file_task_runner(),
- file_path, offset, expected_modification_time));
-}
-
-scoped_ptr<fileapi::FileStreamWriter>
-FileSystemBackendDelegate::CreateFileStreamWriter(
- const fileapi::FileSystemURL& url,
- int64 offset,
- fileapi::FileSystemContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DCHECK_EQ(fileapi::kFileSystemTypeDrive, url.type());
-
- base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url);
- // Hosted documents don't support stream writer.
- if (file_path.empty() || util::HasGDocFileExtension(file_path))
- return scoped_ptr<fileapi::FileStreamWriter>();
-
- return scoped_ptr<fileapi::FileStreamWriter>(
- new internal::WebkitFileStreamWriterImpl(
- base::Bind(&util::GetFileSystemByProfileId, profile_id_),
- context->default_file_task_runner(),file_path, offset));
-}
-
-} // namespace drive
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_backend_delegate.h ('k') | chrome/browser/chromeos/drive/fileapi/async_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698