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

Side by Side Diff: chrome/common/metrics/metrics_log_manager.h

Issue 10546044: [Metrics] Re-try failed protocol buffer uploads as well as failed XML uploads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert DiscardStagedLog() visibility change Created 8 years, 6 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 | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/common/metrics/metrics_log_manager.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 #ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ 5 #ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
6 #define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ 6 #define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // Populates staged_log_text() with the next stored log to send. 64 // Populates staged_log_text() with the next stored log to send.
65 // Should only be called if has_unsent_logs() is true. 65 // Should only be called if has_unsent_logs() is true.
66 void StageNextLogForUpload(); 66 void StageNextLogForUpload();
67 67
68 // Returns true if there is a log that needs to be, or is being, uploaded. 68 // Returns true if there is a log that needs to be, or is being, uploaded.
69 bool has_staged_log() const; 69 bool has_staged_log() const;
70 70
71 // Returns true if there is a protobuf log that needs to be uploaded. 71 // Returns true if there is a protobuf log that needs to be uploaded.
72 // In the case that an XML upload needs to be re-issued due to a previous 72 // In the case that an XML upload needs to be re-issued due to a previous
73 // failure, has_staged_log() will return true while this returns false. 73 // failure, has_staged_log() can return true while this returns false.
74 bool has_staged_log_proto() const; 74 bool has_staged_log_proto() const;
75 75
76 // Returns true if there is an xml log that needs to be uploaded.
77 // In the case that a protobuf upload needs to be re-issued due to a previous
78 // failure, has_staged_log() can return true while this returns false.
79 bool has_staged_log_xml() const;
80
76 // The text of the staged log, in compressed XML or protobuf format. Empty if 81 // The text of the staged log, in compressed XML or protobuf format. Empty if
77 // there is no staged log, or if compression of the staged log failed. 82 // there is no staged log, or if compression of the staged log failed.
78 const SerializedLog& staged_log_text() const { 83 const SerializedLog& staged_log_text() const {
79 return staged_log_text_; 84 return staged_log_text_;
80 } 85 }
81 86
82 // Discards the staged log (both the XML and the protobuf data). 87 // Discards the staged log (both the XML and the protobuf data).
83 void DiscardStagedLog(); 88 void DiscardStagedLog();
84 89
85 // Discards the protobuf data in the staged log. 90 // Discards the protobuf data in the staged log.
86 // This is useful to prevent needlessly re-issuing successful protobuf uploads 91 // This is useful to prevent needlessly re-issuing successful protobuf uploads
87 // due to XML upload failures. 92 // due to XML upload failures.
88 void DiscardStagedLogProto(); 93 void DiscardStagedLogProto();
89 94
95 // Discards the XML data in the staged log.
96 // This is useful to prevent needlessly re-issuing successful XML uploads
97 // due to protobuf upload failures.
98 void DiscardStagedLogXml();
99
90 // Closes and discards |current_log|. 100 // Closes and discards |current_log|.
91 void DiscardCurrentLog(); 101 void DiscardCurrentLog();
92 102
93 // Sets current_log to NULL, but saves the current log for future use with 103 // Sets current_log to NULL, but saves the current log for future use with
94 // ResumePausedLog(). Only one log may be paused at a time. 104 // ResumePausedLog(). Only one log may be paused at a time.
95 // TODO(stuartmorgan): Pause/resume support is really a workaround for a 105 // TODO(stuartmorgan): Pause/resume support is really a workaround for a
96 // design issue in initial log writing; that should be fixed, and pause/resume 106 // design issue in initial log writing; that should be fixed, and pause/resume
97 // removed. 107 // removed.
98 void PauseCurrentLog(); 108 void PauseCurrentLog();
99 109
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // This is necessary because during an upload there are two logs (staged 212 // This is necessary because during an upload there are two logs (staged
203 // and current) and a client might store them in either order, so it's 213 // and current) and a client might store them in either order, so it's
204 // not necessarily the case that the provisional store is the last store. 214 // not necessarily the case that the provisional store is the last store.
205 int last_provisional_store_index_; 215 int last_provisional_store_index_;
206 LogType last_provisional_store_type_; 216 LogType last_provisional_store_type_;
207 217
208 DISALLOW_COPY_AND_ASSIGN(MetricsLogManager); 218 DISALLOW_COPY_AND_ASSIGN(MetricsLogManager);
209 }; 219 };
210 220
211 #endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ 221 #endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/common/metrics/metrics_log_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698