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

Unified Diff: content/child/shared_memory_data_consumer_handle.h

Issue 1186053004: Cancel loading when body stream reader is detached. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@error-ipc-data-consumer
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/child/shared_memory_data_consumer_handle.h
diff --git a/content/child/shared_memory_data_consumer_handle.h b/content/child/shared_memory_data_consumer_handle.h
index 6d74178f5cda317e5fdc1e0c6e85e5d92756ad25..869aed2f95ed6ada82092ca545b2099d3cb91a7a 100644
--- a/content/child/shared_memory_data_consumer_handle.h
+++ b/content/child/shared_memory_data_consumer_handle.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_
#define CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
@@ -59,8 +60,18 @@ class CONTENT_EXPORT SharedMemoryDataConsumerHandle final
DISALLOW_COPY_AND_ASSIGN(ReaderImpl);
};
+ // Creates a handle and a writer associated with the handle. The created
+ // writer should be used on the calling thread.
SharedMemoryDataConsumerHandle(BackpressureMode mode,
scoped_ptr<Writer>* writer);
+ // |on_reader_detached| will be called aynchronously on the calling thread
+ // when the reader (including the handle) is detached (i.e. both the handle
+ // and the reader are destructed). The callback will be reset in the internal
+ // context when the writer is detached, i.e. |Close| or |Fail| is called,
+ // and the callback will never be called.
+ SharedMemoryDataConsumerHandle(BackpressureMode mode,
+ const base::Closure& on_reader_detached,
+ scoped_ptr<Writer>* writer);
virtual ~SharedMemoryDataConsumerHandle();
scoped_ptr<Reader> ObtainReader(Client* client);

Powered by Google App Engine
This is Rietveld 408576698