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

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

Issue 1141573003: Fix BrowserAccessibilityManager initialization race. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | 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 <cmath> 7 #include <cmath>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 BrowserAccessibilityManager::ToBrowserAccessibilityManagerAndroid() { 64 BrowserAccessibilityManager::ToBrowserAccessibilityManagerAndroid() {
65 return static_cast<BrowserAccessibilityManagerAndroid*>(this); 65 return static_cast<BrowserAccessibilityManagerAndroid*>(this);
66 } 66 }
67 67
68 BrowserAccessibilityManagerAndroid::BrowserAccessibilityManagerAndroid( 68 BrowserAccessibilityManagerAndroid::BrowserAccessibilityManagerAndroid(
69 ScopedJavaLocalRef<jobject> content_view_core, 69 ScopedJavaLocalRef<jobject> content_view_core,
70 const ui::AXTreeUpdate& initial_tree, 70 const ui::AXTreeUpdate& initial_tree,
71 BrowserAccessibilityDelegate* delegate, 71 BrowserAccessibilityDelegate* delegate,
72 BrowserAccessibilityFactory* factory) 72 BrowserAccessibilityFactory* factory)
73 : BrowserAccessibilityManager(delegate, factory) { 73 : BrowserAccessibilityManager(delegate, factory) {
74 Initialize(initial_tree);
74 SetContentViewCore(content_view_core); 75 SetContentViewCore(content_view_core);
75 Initialize(initial_tree);
76 } 76 }
77 77
78 BrowserAccessibilityManagerAndroid::~BrowserAccessibilityManagerAndroid() { 78 BrowserAccessibilityManagerAndroid::~BrowserAccessibilityManagerAndroid() {
79 JNIEnv* env = AttachCurrentThread(); 79 JNIEnv* env = AttachCurrentThread();
80 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 80 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
81 if (obj.is_null()) 81 if (obj.is_null())
82 return; 82 return;
83 83
84 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(env, obj.obj()); 84 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(env, obj.obj());
85 } 85 }
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { 745 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() {
746 // The Java layer handles the root scroll offset. 746 // The Java layer handles the root scroll offset.
747 return false; 747 return false;
748 } 748 }
749 749
750 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 750 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
751 return RegisterNativesImpl(env); 751 return RegisterNativesImpl(env);
752 } 752 }
753 753
754 } // namespace content 754 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698