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

Unified Diff: chrome/browser/chromeos/drive/drive_url_request_job.h

Issue 13065007: Fix data overwriting issue on ReadFromDownloadData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years, 9 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 | « no previous file | chrome/browser/chromeos/drive/drive_url_request_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_url_request_job.h
diff --git a/chrome/browser/chromeos/drive/drive_url_request_job.h b/chrome/browser/chromeos/drive/drive_url_request_job.h
index 7862e77953495b54cef4de72b0ee43475437c28d..34dbd7a8f7bb8b648d87807f6bff6b7466e001b2 100644
--- a/chrome/browser/chromeos/drive/drive_url_request_job.h
+++ b/chrome/browser/chromeos/drive/drive_url_request_job.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "base/string_piece.h"
#include "chrome/browser/chromeos/drive/drive_file_error.h"
@@ -35,6 +36,10 @@ class DriveFileSystemInterface;
// requests for drive resources and DriveFileSytem. It exposes content URLs
// formatted as drive://<resource-id>.
// The methods should be run on IO thread.
+// This class seems to have some timing issue and to handle edge cases somehow
+// wrongly. Also, probably because of the requirement change, the code path
+// is getting complicated.
+// TODO(hidehiko): Clean the code up and handles edge cases correctly.
class DriveURLRequestJob : public net::URLRequestJob {
public:
@@ -131,8 +136,7 @@ class DriveURLRequestJob : public net::URLRequestJob {
bool streaming_download_;
scoped_refptr<net::IOBuffer> read_buf_;
base::StringPiece read_buf_remaining_;
- std::string download_buf_;
- base::StringPiece download_buf_remaining_;
+ ScopedVector<std::string> pending_downloaded_data_;
// This should remain the last member so it'll be destroyed first and
// invalidate its weak pointers before other members are destroyed.
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698