| Index: content/test/test_thread_safe_sender.h
|
| diff --git a/content/test/test_thread_safe_sender.h b/content/test/test_thread_safe_sender.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8232371be3355c27cde0981cd21644fa9e34ca59
|
| --- /dev/null
|
| +++ b/content/test/test_thread_safe_sender.h
|
| @@ -0,0 +1,51 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_TEST_TEST_THREAD_SAFE_SENDER_H_
|
| +#define CONTENT_TEST_TEST_THREAD_SAFE_SENDER_H_
|
| +
|
| +#include "base/memory/ref_counted.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "content/child/thread_safe_sender.h"
|
| +
|
| +namespace IPC {
|
| +class SyncChannel;
|
| +}
|
| +
|
| +namespace base {
|
| +class SingleThreadTaskRunner;
|
| +class Thread;
|
| +class WaitableEvent;
|
| +}
|
| +
|
| +namespace content {
|
| +
|
| +// This provides an implementation of ThreadSafeSender to be used from unit
|
| +// tests. This creates its on IO thread and IPC::SyncChannel and controls their
|
| +// lifetime.
|
| +class TestThreadSafeSender : public ThreadSafeSender {
|
| + public:
|
| + static scoped_refptr<ThreadSafeSender> Create(
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
|
| +
|
| + private:
|
| + friend class base::RefCountedThreadSafe<ThreadSafeSender>;
|
| +
|
| + TestThreadSafeSender(
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
|
| + scoped_ptr<base::Thread> io_thread,
|
| + scoped_ptr<base::WaitableEvent> shutdown_event,
|
| + scoped_ptr<IPC::SyncChannel> sync_channel);
|
| + ~TestThreadSafeSender() override;
|
| +
|
| + scoped_ptr<base::Thread> io_thread_;
|
| + scoped_ptr<base::WaitableEvent> shutdown_event_;
|
| + scoped_ptr<IPC::SyncChannel> sync_channel_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TestThreadSafeSender);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_TEST_TEST_THREAD_SAFE_SENDER_H_
|
|
|