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

Unified Diff: chrome/browser/sessions/session_backend.h

Issue 39275: Fixes possible crash in SessionBackend. I believe what's happening... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/sessions/session_backend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_backend.h
===================================================================
--- chrome/browser/sessions/session_backend.h (revision 11244)
+++ chrome/browser/sessions/session_backend.h (working copy)
@@ -81,8 +81,12 @@
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 @@
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.
« no previous file with comments | « no previous file | chrome/browser/sessions/session_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698