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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager_android.cc

Issue 1820473003: Only the root BrowserAccessibilityManager should destroy the java obj. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_create_bam
Patch Set: Created 4 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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/accessibility/browser_accessibility_manager_android.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 Initialize(initial_tree); 145 Initialize(initial_tree);
146 SetContentViewCore(content_view_core); 146 SetContentViewCore(content_view_core);
147 } 147 }
148 148
149 BrowserAccessibilityManagerAndroid::~BrowserAccessibilityManagerAndroid() { 149 BrowserAccessibilityManagerAndroid::~BrowserAccessibilityManagerAndroid() {
150 JNIEnv* env = AttachCurrentThread(); 150 JNIEnv* env = AttachCurrentThread();
151 ScopedJavaLocalRef<jobject> obj = GetJavaRefFromRootManager(); 151 ScopedJavaLocalRef<jobject> obj = GetJavaRefFromRootManager();
152 if (obj.is_null()) 152 if (obj.is_null())
153 return; 153 return;
154 154
155 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(env, obj.obj()); 155 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(
156 env, obj.obj(),reinterpret_cast<intptr_t>(this));
156 } 157 }
157 158
158 // static 159 // static
159 ui::AXTreeUpdate 160 ui::AXTreeUpdate
160 BrowserAccessibilityManagerAndroid::GetEmptyDocument() { 161 BrowserAccessibilityManagerAndroid::GetEmptyDocument() {
161 ui::AXNodeData empty_document; 162 ui::AXNodeData empty_document;
162 empty_document.id = 0; 163 empty_document.id = 0;
163 empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA; 164 empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
164 empty_document.state = 1 << ui::AX_STATE_READ_ONLY; 165 empty_document.state = 1 << ui::AX_STATE_READ_ONLY;
165 166
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 943
943 JNIEnv* env = AttachCurrentThread(); 944 JNIEnv* env = AttachCurrentThread();
944 return root_manager->java_ref().get(env); 945 return root_manager->java_ref().get(env);
945 } 946 }
946 947
947 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 948 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
948 return RegisterNativesImpl(env); 949 return RegisterNativesImpl(env);
949 } 950 }
950 951
951 } // namespace content 952 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698