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 "chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
" | 5 #include "chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h
" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ptr_util.h" |
9 #include "components/metrics/leak_detector/protobuf_to_mojo_converter.h" | 10 #include "components/metrics/leak_detector/protobuf_to_mojo_converter.h" |
10 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
11 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
12 | 13 |
13 namespace metrics { | 14 namespace metrics { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 // All instances of LeakDetectorRemoteController will need to reference a single | 18 // All instances of LeakDetectorRemoteController will need to reference a single |
18 // LocalController instance, referenced by this pointer. All remote LeakDetector | 19 // LocalController instance, referenced by this pointer. All remote LeakDetector |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // static | 85 // static |
85 void LeakDetectorRemoteController::SetLocalControllerInstance( | 86 void LeakDetectorRemoteController::SetLocalControllerInstance( |
86 LocalController* controller) { | 87 LocalController* controller) { |
87 // This must be on the same thread as the Mojo-based functions of this class, | 88 // This must be on the same thread as the Mojo-based functions of this class, |
88 // to avoid race conditions on |g_local_controller|. | 89 // to avoid race conditions on |g_local_controller|. |
89 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 90 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
90 g_local_controller = controller; | 91 g_local_controller = controller; |
91 } | 92 } |
92 | 93 |
93 } // namespace metrics | 94 } // namespace metrics |
OLD | NEW |