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

Unified Diff: content/child/indexed_db/indexed_db_dispatcher_unittest.cc

Issue 1262253004: Let IPC::SyncMessageFilter take advantage of thread-safe Send. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minus some code Created 5 years, 4 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 | « content/child/child_thread_impl.cc ('k') | content/child/indexed_db/webidbcursor_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/indexed_db/indexed_db_dispatcher_unittest.cc
diff --git a/content/child/indexed_db/indexed_db_dispatcher_unittest.cc b/content/child/indexed_db/indexed_db_dispatcher_unittest.cc
index 7e146e7b00b46bf37464f241f493bd99346f3510..6e72d7bf30b634c74d5929aad8fd69b8966b4433 100644
--- a/content/child/indexed_db/indexed_db_dispatcher_unittest.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher_unittest.cc
@@ -60,22 +60,27 @@ class MockDispatcher : public IndexedDBDispatcher {
DISALLOW_COPY_AND_ASSIGN(MockDispatcher);
};
+class MockSyncMessageFilter : public IPC::SyncMessageFilter {
+ public:
+ MockSyncMessageFilter()
+ : SyncMessageFilter(nullptr, false /* is_channel_send_thread_safe */) {}
+
+ private:
+ ~MockSyncMessageFilter() override {}
+};
+
} // namespace
class IndexedDBDispatcherTest : public testing::Test {
public:
IndexedDBDispatcherTest()
- : task_runner_(base::ThreadTaskRunnerHandle::Get()),
- sync_message_filter_(new IPC::SyncMessageFilter(NULL)),
- thread_safe_sender_(new ThreadSafeSender(task_runner_.get(),
- sync_message_filter_.get())) {}
+ : thread_safe_sender_(new ThreadSafeSender(
+ base::ThreadTaskRunnerHandle::Get(), new MockSyncMessageFilter)) {}
void TearDown() override { blink::WebHeap::collectAllGarbageForTesting(); }
protected:
base::MessageLoop message_loop_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
private:
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | content/child/indexed_db/webidbcursor_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698