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

Unified Diff: content/child/shared_memory_data_consumer_handle.h

Issue 2177243002: Use per-frame TaskRunner instead of thread's default in DataConsumerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_consumer_handle_unique_ptr
Patch Set: update Created 4 years, 5 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 0a98b760aa7d492b4bce56346173ec25dbed55a4..b64ad2b7d37aedbd4279923c713f9e7b447ee209 100644
--- a/content/child/shared_memory_data_consumer_handle.h
+++ b/content/child/shared_memory_data_consumer_handle.h
@@ -16,6 +16,10 @@
#include "content/public/child/request_peer.h"
#include "third_party/WebKit/public/platform/WebDataConsumerHandle.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace content {
// This class is a WebDataConsumerHandle that accepts RequestPeer::ReceivedData.
@@ -50,7 +54,8 @@ class CONTENT_EXPORT SharedMemoryDataConsumerHandle final
class ReaderImpl final : public Reader {
public:
- ReaderImpl(scoped_refptr<Context> context, Client* client);
+ ReaderImpl(scoped_refptr<Context> context, Client* client,
+ scoped_refptr<base::SingleThreadTaskRunner> reader_task_runner);
~ReaderImpl() override;
Result read(void* data,
size_t size,
@@ -81,7 +86,11 @@ class CONTENT_EXPORT SharedMemoryDataConsumerHandle final
std::unique_ptr<Writer>* writer);
~SharedMemoryDataConsumerHandle() override;
- std::unique_ptr<Reader> obtainReader(Client* client) override;
+ // Unlike to other Reader, |reader_task_runner| here is nullable, so that
+ // the test code don't need to create blink::WebTaskRunner.
+ std::unique_ptr<Reader> obtainReader(
+ Client* client,
+ std::unique_ptr<blink::WebTaskRunner> reader_task_runner) override;
private:
const char* debugName() const override;

Powered by Google App Engine
This is Rietveld 408576698