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

Side by Side Diff: mojo/android/system/watcher_impl.cc

Issue 2623263005: Tag some of Mojo heap allocations for the heap profiler. (Closed)
Patch Set: Synced Created 3 years, 10 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 | « media/remoting/demuxer_stream_adapter.cc ('k') | mojo/common/data_pipe_drainer.cc » ('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 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 "mojo/android/system/watcher_impl.h" 5 #include "mojo/android/system/watcher_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/android/base_jni_registrar.h" 10 #include "base/android/base_jni_registrar.h"
(...skipping 10 matching lines...) Expand all
21 namespace mojo { 21 namespace mojo {
22 namespace android { 22 namespace android {
23 23
24 using base::android::JavaParamRef; 24 using base::android::JavaParamRef;
25 25
26 namespace { 26 namespace {
27 27
28 class WatcherWithMessageLoopObserver 28 class WatcherWithMessageLoopObserver
29 : public base::MessageLoop::DestructionObserver { 29 : public base::MessageLoop::DestructionObserver {
30 public: 30 public:
31 WatcherWithMessageLoopObserver() {} 31 WatcherWithMessageLoopObserver() : watcher_(FROM_HERE) {}
32 32
33 ~WatcherWithMessageLoopObserver() override { StopObservingIfNecessary(); } 33 ~WatcherWithMessageLoopObserver() override { StopObservingIfNecessary(); }
34 34
35 jint Start(JNIEnv* env, 35 jint Start(JNIEnv* env,
36 const JavaParamRef<jobject>& jcaller, 36 const JavaParamRef<jobject>& jcaller,
37 jint mojo_handle, 37 jint mojo_handle,
38 jint signals) { 38 jint signals) {
39 if (!is_observing_) { 39 if (!is_observing_) {
40 is_observing_ = true; 40 is_observing_ = true;
41 base::MessageLoop::current()->AddDestructionObserver(this); 41 base::MessageLoop::current()->AddDestructionObserver(this);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 jlong watcher_ptr) { 126 jlong watcher_ptr) {
127 delete reinterpret_cast<WatcherWithMessageLoopObserver*>(watcher_ptr); 127 delete reinterpret_cast<WatcherWithMessageLoopObserver*>(watcher_ptr);
128 } 128 }
129 129
130 bool RegisterWatcherImpl(JNIEnv* env) { 130 bool RegisterWatcherImpl(JNIEnv* env) {
131 return RegisterNativesImpl(env); 131 return RegisterNativesImpl(env);
132 } 132 }
133 133
134 } // namespace android 134 } // namespace android
135 } // namespace mojo 135 } // namespace mojo
OLDNEW
« no previous file with comments | « media/remoting/demuxer_stream_adapter.cc ('k') | mojo/common/data_pipe_drainer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698