summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sessions/session_backend.h')
-rw-r--r--chrome/browser/sessions/session_backend.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/sessions/session_backend.h b/chrome/browser/sessions/session_backend.h
index 496a3ec..bfd446f 100644
--- a/chrome/browser/sessions/session_backend.h
+++ b/chrome/browser/sessions/session_backend.h
@@ -81,8 +81,12 @@ class SessionBackend : public base::RefCountedThreadSafe<SessionBackend> {
void MoveCurrentSessionToLastSession();
private:
- // Recreates the current file such that it only contains the header and
- // NO commands.
+ // If current_session_file_ is open, it is truncated so that it is essentially
+ // empty (only contains the header). If current_session_file_ isn't open, it
+ // is is opened and the header is written to it. After this
+ // current_session_file_ contains no commands.
+ // NOTE: current_session_file_ may be NULL if the file couldn't be opened or
+ // the header couldn't be written.
void ResetFile();
// Opens the current file and writes the header. On success a handle to
@@ -93,6 +97,13 @@ class SessionBackend : public base::RefCountedThreadSafe<SessionBackend> {
bool AppendCommandsToFile(net::FileStream* file,
const std::vector<SessionCommand*>& commands);
+ // Returns the size of the header. The header is the first bytes written to
+ // the file, and is used to identify the file as one written by us.
+ int32 sizeof_header() const {
+ int32 header[2];
+ return sizeof(header);
+ }
+
const BaseSessionService::SessionType type_;
// Returns the path to the last file.