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

Unified Diff: Source/modules/fetch/DataConsumerHandleTestUtil.h

Issue 1315743003: [part 1] Make classes and structures in modules/ fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/modules/fetch/CompositeDataConsumerHandle.h ('k') | Source/modules/fetch/DataConsumerHandleUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/DataConsumerHandleTestUtil.h
diff --git a/Source/modules/fetch/DataConsumerHandleTestUtil.h b/Source/modules/fetch/DataConsumerHandleTestUtil.h
index ea20c447d63939231f699d1006a71a59f7fff80c..559d41db19f750413852d39e429311e5df2da826 100644
--- a/Source/modules/fetch/DataConsumerHandleTestUtil.h
+++ b/Source/modules/fetch/DataConsumerHandleTestUtil.h
@@ -34,8 +34,10 @@
namespace blink {
class DataConsumerHandleTestUtil {
+ STATIC_ONLY(DataConsumerHandleTestUtil);
public:
class NoopClient final : public WebDataConsumerHandle::Client {
+ DISALLOW_ALLOCATION();
public:
void didGetReadable() override { }
};
@@ -44,6 +46,7 @@ public:
// additional objects based on the given policy. The constructor and the
// destructor blocks during the setup and the teardown.
class Thread final {
+ WTF_MAKE_FAST_ALLOCATED(Thread);
public:
// Initialization policy of a thread.
enum InitializationPolicy {
@@ -154,6 +157,7 @@ public:
// The reading/updating threads are alive while ThreadHolder is alive.
class ThreadHolder {
+ DISALLOW_ALLOCATION();
public:
ThreadHolder(ThreadingTestBase* test)
: m_context(test->m_context)
@@ -177,6 +181,7 @@ public:
};
class ReaderImpl final : public WebDataConsumerHandle::Reader {
+ WTF_MAKE_FAST_ALLOCATED(ReaderImpl);
public:
ReaderImpl(const String& name, PassRefPtr<Context> context) : m_name(name.isolatedCopy()), m_context(context)
{
@@ -195,6 +200,7 @@ public:
RefPtr<Context> m_context;
};
class DataConsumerHandle final : public WebDataConsumerHandle {
+ WTF_MAKE_FAST_ALLOCATED(DataConsumerHandle);
public:
static PassOwnPtr<WebDataConsumerHandle> create(const String& name, PassRefPtr<Context> context)
{
@@ -356,6 +362,7 @@ public:
};
class Command final {
+ ALLOW_ONLY_INLINE_ALLOCATION();
public:
enum Name {
Data,
@@ -381,6 +388,7 @@ public:
// ReplayingHandle stores commands via |add| and replays the stored commends when read.
class ReplayingHandle final : public WebDataConsumerHandle {
+ WTF_MAKE_FAST_ALLOCATED(ReplayingHandle);
public:
static PassOwnPtr<ReplayingHandle> create() { return adoptPtr(new ReplayingHandle()); }
~ReplayingHandle();
@@ -435,6 +443,7 @@ public:
};
class HandleReadResult final {
+ WTF_MAKE_FAST_ALLOCATED(HandleReadResult);
public:
HandleReadResult(WebDataConsumerHandle::Result result, const Vector<char>& data) : m_result(result), m_data(data) { }
WebDataConsumerHandle::Result result() const { return m_result; }
@@ -449,6 +458,7 @@ public:
// Reader::read on the thread on which it is created. When reading is done
// or failed, it calls the given callback with the result.
class HandleReader final : public WebDataConsumerHandle::Client {
+ WTF_MAKE_FAST_ALLOCATED(HandleReader);
public:
using OnFinishedReading = WTF::Function<void(PassOwnPtr<HandleReadResult>)>;
@@ -466,6 +476,7 @@ public:
// HandleTwoPhaseReader does the same as HandleReader, but it uses
// |beginRead| / |endRead| instead of |read|.
class HandleTwoPhaseReader final : public WebDataConsumerHandle::Client {
+ WTF_MAKE_FAST_ALLOCATED(HandleTwoPhaseReader);
public:
using OnFinishedReading = WTF::Function<void(PassOwnPtr<HandleReadResult>)>;
@@ -484,6 +495,7 @@ public:
// where T is one of HandleReader and HandleTwophaseReader.
template <typename T>
class HandleReaderRunner final {
+ STACK_ALLOCATED();
public:
explicit HandleReaderRunner(PassOwnPtr<WebDataConsumerHandle> handle)
: m_thread(adoptPtr(new Thread("reading thread")))
« no previous file with comments | « Source/modules/fetch/CompositeDataConsumerHandle.h ('k') | Source/modules/fetch/DataConsumerHandleUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698