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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/write_file.cc

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Various cleanups Created 5 years, 7 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/file_system_provider/operations/write_file.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/write_file.cc b/chrome/browser/chromeos/file_system_provider/operations/write_file.cc
index 766e9cdad1ff6c5650e1a995a4dd8753ca118552..654ae1a5dbb9b0f91bf623a6038d78184a8e7ae4 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/write_file.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/write_file.cc
@@ -13,14 +13,16 @@ namespace chromeos {
namespace file_system_provider {
namespace operations {
-WriteFile::WriteFile(extensions::EventRouter* event_router,
- const ProvidedFileSystemInfo& file_system_info,
- int file_handle,
- scoped_refptr<net::IOBuffer> buffer,
- int64 offset,
- int length,
- const storage::AsyncFileUtil::StatusCallback& callback)
- : Operation(event_router, file_system_info),
+template <int source>
+WriteFile<source>::WriteFile(
+ typename Operation<source>::EventRouterType* event_router,
+ const ProvidedFileSystemInfo& file_system_info,
+ int file_handle,
+ scoped_refptr<net::IOBuffer> buffer,
+ int64 offset,
+ int length,
+ const storage::AsyncFileUtil::StatusCallback& callback)
+ : Operation<source>(event_router, file_system_info),
file_handle_(file_handle),
buffer_(buffer),
offset_(offset),
@@ -28,18 +30,20 @@ WriteFile::WriteFile(extensions::EventRouter* event_router,
callback_(callback) {
}
-WriteFile::~WriteFile() {
+template <int source>
+WriteFile<source>::~WriteFile() {
}
-bool WriteFile::Execute(int request_id) {
+template <int source>
+bool WriteFile<source>::Execute(int request_id) {
TRACE_EVENT0("file_system_provider", "WriteFile::Execute");
using extensions::api::file_system_provider::WriteFileRequestedOptions;
- if (!file_system_info_.writable())
+ if (!this->file_system_info_.writable())
return false;
WriteFileRequestedOptions options;
- options.file_system_id = file_system_info_.file_system_id();
+ options.file_system_id = this->file_system_info_.file_system_id();
options.request_id = request_id;
options.open_request_id = file_handle_;
options.offset = offset_;
@@ -55,26 +59,31 @@ bool WriteFile::Execute(int request_id) {
scoped_ptr<base::ListValue> event_args(new base::ListValue);
event_args->Append(options_as_value.release());
- return SendEvent(
+ return this->SendEvent(
request_id,
extensions::api::file_system_provider::OnWriteFileRequested::kEventName,
event_args.Pass());
}
-void WriteFile::OnSuccess(int /* request_id */,
- scoped_ptr<RequestValue> /* result */,
- bool /* has_more */) {
+template <int source>
+void WriteFile<source>::OnSuccess(int /* request_id */,
+ scoped_ptr<RequestValue> /* result */,
+ bool /* has_more */) {
TRACE_EVENT0("file_system_provider", "WriteFile::OnSuccess");
callback_.Run(base::File::FILE_OK);
}
-void WriteFile::OnError(int /* request_id */,
- scoped_ptr<RequestValue> /* result */,
- base::File::Error error) {
+template <int source>
+void WriteFile<source>::OnError(int /* request_id */,
+ scoped_ptr<RequestValue> /* result */,
+ base::File::Error error) {
TRACE_EVENT0("file_system_provider", "WriteFile::OnError");
callback_.Run(error);
}
+template class WriteFile<Source_Type::extension>;
+template class WriteFile<Source_Type::plugin>;
+
} // namespace operations
} // namespace file_system_provider
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698