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

Side by Side Diff: third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve more msvc linkage woes Created 5 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/edk/test/scoped_ipc_support.h"
6
7 #include "base/message_loop/message_loop.h"
8 #include "mojo/edk/embedder/embedder.h"
9
10 namespace mojo {
11 namespace test {
12
13 ScopedIPCSupport::ScopedIPCSupport(
14 scoped_refptr<base::TaskRunner> io_thread_task_runner)
15 : io_thread_task_runner_(io_thread_task_runner),
16 event_(true, false) { // Manual reset.
17 // Note: Run delegate methods on the I/O thread.
18 embedder::InitIPCSupport(embedder::ProcessType::NONE, io_thread_task_runner,
19 this, io_thread_task_runner,
20 embedder::ScopedPlatformHandle());
21 }
22
23 ScopedIPCSupport::~ScopedIPCSupport() {
24 if (base::MessageLoop::current() &&
25 base::MessageLoop::current()->task_runner() == io_thread_task_runner_) {
26 embedder::ShutdownIPCSupportOnIOThread();
27 } else {
28 embedder::ShutdownIPCSupport();
29 event_.Wait();
30 }
31 }
32
33 void ScopedIPCSupport::OnShutdownComplete() {
34 event_.Signal();
35 }
36
37 } // namespace test
38 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698