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

Side by Side Diff: ipc/ipc_sync_channel_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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_sync_channel.cc ('k') | ipc/ipc_sync_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_sync_channel.h" 5 #include "ipc/ipc_sync_channel.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 944
945 //------------------------------------------------------------------------------ 945 //------------------------------------------------------------------------------
946 946
947 class TestSyncMessageFilter : public SyncMessageFilter { 947 class TestSyncMessageFilter : public SyncMessageFilter {
948 public: 948 public:
949 TestSyncMessageFilter( 949 TestSyncMessageFilter(
950 base::WaitableEvent* shutdown_event, 950 base::WaitableEvent* shutdown_event,
951 Worker* worker, 951 Worker* worker,
952 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 952 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
953 : SyncMessageFilter(shutdown_event), 953 : SyncMessageFilter(shutdown_event, false),
954 worker_(worker), 954 worker_(worker),
955 task_runner_(task_runner) {} 955 task_runner_(task_runner) {}
956 956
957 void OnFilterAdded(Sender* sender) override { 957 void OnFilterAdded(Sender* sender) override {
958 SyncMessageFilter::OnFilterAdded(sender); 958 SyncMessageFilter::OnFilterAdded(sender);
959 task_runner_->PostTask( 959 task_runner_->PostTask(
960 FROM_HERE, 960 FROM_HERE,
961 base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this)); 961 base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this));
962 } 962 }
963 963
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 } 1800 }
1801 1801
1802 // Windows needs to send an out-of-band secret to verify the client end of the 1802 // Windows needs to send an out-of-band secret to verify the client end of the
1803 // channel. Test that we still connect correctly in that case. 1803 // channel. Test that we still connect correctly in that case.
1804 TEST_F(IPCSyncChannelTest, Verified) { 1804 TEST_F(IPCSyncChannelTest, Verified) {
1805 Verified(); 1805 Verified();
1806 } 1806 }
1807 1807
1808 } // namespace 1808 } // namespace
1809 } // namespace IPC 1809 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_sync_channel.cc ('k') | ipc/ipc_sync_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698