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

Side by Side Diff: google_apis/drive/base_requests.h

Issue 127463002: google_apis: Fix use-after-free of URLFetcher* in ResponseWriter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | google_apis/drive/base_requests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This file provides base classes used to issue HTTP requests for Google 5 // This file provides base classes used to issue HTTP requests for Google
6 // APIs. 6 // APIs.
7 7
8 #ifndef GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_ 8 #ifndef GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_
9 #define GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_ 9 #define GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // If file_path is not empty, the response will be saved with file_writer_, 95 // If file_path is not empty, the response will be saved with file_writer_,
96 // otherwise it will be saved to data_. 96 // otherwise it will be saved to data_.
97 ResponseWriter(net::URLFetcher* url_fetcher, 97 ResponseWriter(net::URLFetcher* url_fetcher,
98 base::SequencedTaskRunner* file_task_runner, 98 base::SequencedTaskRunner* file_task_runner,
99 const base::FilePath& file_path, 99 const base::FilePath& file_path,
100 const GetContentCallback& get_content_callback); 100 const GetContentCallback& get_content_callback);
101 virtual ~ResponseWriter(); 101 virtual ~ResponseWriter();
102 102
103 const std::string& data() const { return data_; } 103 const std::string& data() const { return data_; }
104 104
105 // Detaches this object from url_fetcher_.
106 void Detach();
107
105 // Disowns the output file. 108 // Disowns the output file.
106 void DisownFile(); 109 void DisownFile();
107 110
108 // URLFetcherResponseWriter overrides: 111 // URLFetcherResponseWriter overrides:
109 virtual int Initialize(const net::CompletionCallback& callback) OVERRIDE; 112 virtual int Initialize(const net::CompletionCallback& callback) OVERRIDE;
110 virtual int Write(net::IOBuffer* buffer, 113 virtual int Write(net::IOBuffer* buffer,
111 int num_bytes, 114 int num_bytes,
112 const net::CompletionCallback& callback) OVERRIDE; 115 const net::CompletionCallback& callback) OVERRIDE;
113 virtual int Finish(const net::CompletionCallback& callback) OVERRIDE; 116 virtual int Finish(const net::CompletionCallback& callback) OVERRIDE;
114 117
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 const ProgressCallback progress_callback_; 530 const ProgressCallback progress_callback_;
528 const GURL download_url_; 531 const GURL download_url_;
529 const base::FilePath output_file_path_; 532 const base::FilePath output_file_path_;
530 533
531 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequestBase); 534 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequestBase);
532 }; 535 };
533 536
534 } // namespace google_apis 537 } // namespace google_apis
535 538
536 #endif // GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_ 539 #endif // GOOGLE_APIS_DRIVE_BASE_REQUESTS_H_
OLDNEW
« no previous file with comments | « no previous file | google_apis/drive/base_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698