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

Side by Side Diff: content/common_child/fileapi/webfilewriter_impl.cc

Issue 16325022: move content/common_child to content/child (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/common_child/fileapi/webfilewriter_impl.h"
6
7 #include "base/bind.h"
8 #include "content/common/child_thread.h"
9 #include "content/common/fileapi/file_system_dispatcher.h"
10
11 namespace content {
12
13 namespace {
14
15 inline FileSystemDispatcher* GetFileSystemDispatcher() {
16 return ChildThread::current()->file_system_dispatcher();
17 }
18
19 } // namespace
20
21 WebFileWriterImpl::WebFileWriterImpl(
22 const GURL& path, WebKit::WebFileWriterClient* client)
23 : WebFileWriterBase(path, client),
24 request_id_(0) {
25 }
26
27 WebFileWriterImpl::~WebFileWriterImpl() {
28 }
29
30 void WebFileWriterImpl::DoTruncate(const GURL& path, int64 offset) {
31 // The FileSystemDispatcher takes ownership of the CallbackDispatcher.
32 GetFileSystemDispatcher()->Truncate(
33 path, offset, &request_id_,
34 base::Bind(&WebFileWriterImpl::DidFinish, AsWeakPtr()));
35 }
36
37 void WebFileWriterImpl::DoWrite(
38 const GURL& path, const GURL& blob_url, int64 offset) {
39 GetFileSystemDispatcher()->Write(
40 path, blob_url, offset, &request_id_,
41 base::Bind(&WebFileWriterImpl::DidWrite, AsWeakPtr()),
42 base::Bind(&WebFileWriterImpl::DidFinish, AsWeakPtr()));
43 }
44
45 void WebFileWriterImpl::DoCancel() {
46 GetFileSystemDispatcher()->Cancel(
47 request_id_,
48 base::Bind(&WebFileWriterImpl::DidFinish, AsWeakPtr()));
49 }
50
51 } // namespace content
OLDNEW
« no previous file with comments | « content/common_child/fileapi/webfilewriter_impl.h ('k') | content/common_child/indexed_db/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698