Chromium Code Reviews| Index: components/rappor/log_uploader.h |
| diff --git a/components/rappor/log_uploader.h b/components/rappor/log_uploader.h |
| index 30a129a5b3fcc0c877c0fe4c7306402198fa4687..24e7bcb4be7925c4ed499b16c90f8440974c86ba 100644 |
| --- a/components/rappor/log_uploader.h |
| +++ b/components/rappor/log_uploader.h |
| @@ -2,12 +2,16 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +// Change for readability |
|
ktl
2014/03/21 13:40:02
Don't forget to remove these.
Steven Holte
2014/03/21 19:52:25
Done.
|
| + |
| #ifndef COMPONENTS_RAPPOR_LOG_UPLOADER_H_ |
| #define COMPONENTS_RAPPOR_LOG_UPLOADER_H_ |
| #include <queue> |
| #include <string> |
| +#include "base/compiler_specific.h" |
| +#include "base/macros.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/time/time.h" |
| #include "base/timer/timer.h" |
| @@ -21,16 +25,22 @@ class URLFetcher; |
| namespace rappor { |
| -// Handles uploading logs to an external server. |
| +// Uploads logs from RapporService. Logs are passed in via QueueLog(), stored |
| +// internally, and uploaded one at a time. A queued log will be uploaded at a |
| +// fixed interval after the successful upload of the previous logs. If an |
| +// upload fails, the uploader will keep retrying the upload with an exponential |
| +// backoff interval. |
| class LogUploader : public net::URLFetcherDelegate { |
| public: |
| - // Constructor takes the server_url that logs should be uploaded to, the |
| - // mime_type of the uploaded data, and request_context to create uploads |
| + // Constructor takes the |server_url| that logs should be uploaded to, the |
| + // |mime_type| of the uploaded data, and |request_context| to create uploads |
| // with. |
| LogUploader(const GURL& server_url, |
| const std::string& mime_type, |
| net::URLRequestContextGetter* request_context); |
| + // If the object is destroyed (or the program terminates) while logs are |
| + // queued, the logs are lost. |
| virtual ~LogUploader(); |
| // Adds an entry to the queue of logs to be uploaded to the server. The |
| @@ -39,7 +49,7 @@ class LogUploader : public net::URLFetcherDelegate { |
| void QueueLog(const std::string& log); |
| protected: |
| - // Check if an upload has been scheduled. |
| + // Checks if an upload has been scheduled. |
| virtual bool IsUploadScheduled() const; |
| // Schedules a future call to StartScheduledUpload if one isn't already |
| @@ -54,8 +64,8 @@ class LogUploader : public net::URLFetcherDelegate { |
| static base::TimeDelta BackOffUploadInterval(base::TimeDelta); |
| private: |
| - // Implementation of net::URLFetcherDelegate. Called after transmission |
| - // completes (either successfully or with failure). |
| + // Implements net::URLFetcherDelegate. Called after transmission completes |
| + // (whether successful or not). |
| virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| // Called when the upload is completed. |