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

Side by Side Diff: webkit/fileapi/file_system_dir_url_request_job.cc

Issue 10197007: Change webkit/{fileapi,quota} code to use TaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "webkit/fileapi/file_system_dir_url_request_job.h" 5 #include "webkit/fileapi/file_system_dir_url_request_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 21 matching lines...) Expand all
32 32
33 static FilePath GetRelativePath(const GURL& url) { 33 static FilePath GetRelativePath(const GURL& url) {
34 FilePath relative_path; 34 FilePath relative_path;
35 GURL unused_url; 35 GURL unused_url;
36 FileSystemType unused_type; 36 FileSystemType unused_type;
37 CrackFileSystemURL(url, &unused_url, &unused_type, &relative_path); 37 CrackFileSystemURL(url, &unused_url, &unused_type, &relative_path);
38 return relative_path; 38 return relative_path;
39 } 39 }
40 40
41 FileSystemDirURLRequestJob::FileSystemDirURLRequestJob( 41 FileSystemDirURLRequestJob::FileSystemDirURLRequestJob(
42 URLRequest* request, FileSystemContext* file_system_context, 42 URLRequest* request, FileSystemContext* file_system_context)
43 scoped_refptr<base::MessageLoopProxy> file_thread_proxy)
44 : URLRequestJob(request), 43 : URLRequestJob(request),
45 file_system_context_(file_system_context), 44 file_system_context_(file_system_context),
46 file_thread_proxy_(file_thread_proxy),
47 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 45 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
48 } 46 }
49 47
50 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { 48 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() {
51 } 49 }
52 50
53 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, 51 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size,
54 int *bytes_read) { 52 int *bytes_read) {
55 int count = std::min(dest_size, static_cast<int>(data_.size())); 53 int count = std::min(dest_size, static_cast<int>(data_.size()));
56 if (count > 0) { 54 if (count > 0) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 request_->url(), 132 request_->url(),
135 base::Bind(&FileSystemDirURLRequestJob::DidReadDirectory, this)); 133 base::Bind(&FileSystemDirURLRequestJob::DidReadDirectory, this));
136 } else { 134 } else {
137 set_expected_content_size(data_.size()); 135 set_expected_content_size(data_.size());
138 NotifyHeadersComplete(); 136 NotifyHeadersComplete();
139 } 137 }
140 } 138 }
141 139
142 FileSystemOperationInterface* 140 FileSystemOperationInterface*
143 FileSystemDirURLRequestJob::GetNewOperation(const GURL& url) { 141 FileSystemDirURLRequestJob::GetNewOperation(const GURL& url) {
144 return file_system_context_->CreateFileSystemOperation( 142 return file_system_context_->CreateFileSystemOperation(url);
145 url,
146 file_thread_proxy_);
147 } 143 }
148 144
149 } // namespace fileapi 145 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job.h ('k') | webkit/fileapi/file_system_dir_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698