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

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
« no previous file with comments | « no previous file | content/child/shared_memory_data_consumer_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cd6e34ed0df562d94d38ae56bcadd16e179557fa 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"
@@ -57,9 +58,19 @@ class CONTENT_EXPORT SharedMemoryDataConsumerHandle final
scoped_refptr<Context> context_;
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();
« no previous file with comments | « no previous file | content/child/shared_memory_data_consumer_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698