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

Unified Diff: net/url_request/url_request_file_dir_job.cc

Issue 6339012: More net/ method ordering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More done while waiting for previous patch to clear Created 9 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
« no previous file with comments | « net/url_request/url_request_file_dir_job.h ('k') | net/url_request/url_request_file_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_dir_job.cc
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc
index badb6b8776ac1e84a9a69390ad67a59eaa182d2c..1cc15be9fd7e5bcc168f0be64cd9631725fb42d1 100644
--- a/net/url_request/url_request_file_dir_job.cc
+++ b/net/url_request/url_request_file_dir_job.cc
@@ -33,20 +33,6 @@ URLRequestFileDirJob::URLRequestFileDirJob(URLRequest* request,
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
}
-URLRequestFileDirJob::~URLRequestFileDirJob() {
- DCHECK(read_pending_ == false);
- DCHECK(lister_ == NULL);
-}
-
-void URLRequestFileDirJob::Start() {
- // Start reading asynchronously so that all error reporting and data
- // callbacks happen as they would for network requests.
- MessageLoop::current()->PostTask(
- FROM_HERE,
- method_factory_.NewRunnableMethod(
- &URLRequestFileDirJob::StartAsync));
-}
-
void URLRequestFileDirJob::StartAsync() {
DCHECK(!lister_);
@@ -63,6 +49,15 @@ void URLRequestFileDirJob::StartAsync() {
NotifyHeadersComplete();
}
+void URLRequestFileDirJob::Start() {
+ // Start reading asynchronously so that all error reporting and data
+ // callbacks happen as they would for network requests.
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ method_factory_.NewRunnableMethod(
+ &URLRequestFileDirJob::StartAsync));
+}
+
void URLRequestFileDirJob::Kill() {
if (canceled_)
return;
@@ -174,6 +169,11 @@ void URLRequestFileDirJob::OnListDone(int error) {
Release(); // The Lister is finished; may delete *this*
}
+URLRequestFileDirJob::~URLRequestFileDirJob() {
+ DCHECK(read_pending_ == false);
+ DCHECK(lister_ == NULL);
+}
+
void URLRequestFileDirJob::CloseLister() {
if (lister_) {
lister_->Cancel();
@@ -182,25 +182,6 @@ void URLRequestFileDirJob::CloseLister() {
}
}
-bool URLRequestFileDirJob::FillReadBuffer(char *buf, int buf_size,
- int *bytes_read) {
- DCHECK(bytes_read);
-
- *bytes_read = 0;
-
- int count = std::min(buf_size, static_cast<int>(data_.size()));
- if (count) {
- memcpy(buf, &data_[0], count);
- data_.erase(0, count);
- *bytes_read = count;
- return true;
- } else if (list_complete_) {
- // EOF
- return true;
- }
- return false;
-}
-
void URLRequestFileDirJob::CompleteRead() {
if (read_pending_) {
int bytes_read;
@@ -221,4 +202,23 @@ void URLRequestFileDirJob::CompleteRead() {
}
}
+bool URLRequestFileDirJob::FillReadBuffer(char *buf, int buf_size,
+ int *bytes_read) {
+ DCHECK(bytes_read);
+
+ *bytes_read = 0;
+
+ int count = std::min(buf_size, static_cast<int>(data_.size()));
+ if (count) {
+ memcpy(buf, &data_[0], count);
+ data_.erase(0, count);
+ *bytes_read = count;
+ return true;
+ } else if (list_complete_) {
+ // EOF
+ return true;
+ }
+ return false;
+}
+
} // namespace net
« no previous file with comments | « net/url_request/url_request_file_dir_job.h ('k') | net/url_request/url_request_file_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698