OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/shell/public/cpp/shell_connection_ref.h" | 5 #include "services/shell/public/cpp/shell_connection_ref.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 | 11 |
12 namespace shell { | 12 namespace shell { |
13 | 13 |
14 class ShellConnectionRefImpl : public ShellConnectionRef { | 14 class ShellConnectionRefImpl : public ShellConnectionRef { |
15 public: | 15 public: |
16 ShellConnectionRefImpl( | 16 ShellConnectionRefImpl( |
17 ShellConnectionRefFactory* factory, | 17 ShellConnectionRefFactory* factory, |
18 scoped_refptr<base::SingleThreadTaskRunner> shell_client_task_runner) | 18 scoped_refptr<base::SingleThreadTaskRunner> shell_client_task_runner) |
19 : factory_(factory), | 19 : factory_(factory), |
20 shell_client_task_runner_(shell_client_task_runner) {} | 20 shell_client_task_runner_(shell_client_task_runner) {} |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void ShellConnectionRefFactory::AddRef() { | 90 void ShellConnectionRefFactory::AddRef() { |
91 ++ref_count_; | 91 ++ref_count_; |
92 } | 92 } |
93 | 93 |
94 void ShellConnectionRefFactory::Release() { | 94 void ShellConnectionRefFactory::Release() { |
95 if (!--ref_count_) | 95 if (!--ref_count_) |
96 quit_closure_.Run(); | 96 quit_closure_.Run(); |
97 } | 97 } |
98 | 98 |
99 } // namespace shell | 99 } // namespace shell |
OLD | NEW |