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

Unified Diff: net/base/file_stream_context.h

Issue 920123002: Fix a crash in the FileStream::Context::Read code path where we were invoking a NULL callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 10 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 | net/base/file_stream_context_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream_context.h
diff --git a/net/base/file_stream_context.h b/net/base/file_stream_context.h
index 8d037bcf4fb369f8d9e8ab4c9697ff47d175d384..cb1b7aa02d5400cc5b3668150a666203898dcafc 100644
--- a/net/base/file_stream_context.h
+++ b/net/base/file_stream_context.h
@@ -164,6 +164,9 @@ class FileStream::Context {
// Invokes the user callback.
void InvokeUserCallback();
+ // Deletes an orphaned context.
+ void DeleteOrphanedContext();
+
// The ReadFile call on Windows can execute synchonously at times.
// http://support.microsoft.com/kb/156932. This ends up blocking the calling
// thread which is undesirable. To avoid this we execute the ReadFile call
@@ -189,11 +192,13 @@ class FileStream::Context {
// This callback executes on the main calling thread. It informs the caller
// about the result of the ReadFile call.
+ // The |read_file_ret| parameter contains the return value of the ReadFile
+ // call.
// The |bytes_read| contains the number of bytes read from the file, if
// ReadFile succeeds.
// The |os_error| parameter contains the value of the last error returned by
// the ReadFile API.
- void ReadAsyncResult(DWORD bytes_read, DWORD os_error);
+ void ReadAsyncResult(BOOL read_file_ret, DWORD bytes_read, DWORD os_error);
#elif defined(OS_POSIX)
// ReadFileImpl() is a simple wrapper around read() that handles EINTR
« no previous file with comments | « no previous file | net/base/file_stream_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698