Chromium Code Reviews| Index: content/browser/android/content_view_core_impl.cc |
| diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
| index bb670513fbebd5a21d3aadb8713c97ebd330b306..f9d5fba572dd33b63126c2e266a2da99fbd0e783 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -348,6 +348,12 @@ void ContentViewCoreImpl::Hide() { |
| } |
| void ContentViewCoreImpl::OnTabCrashed() { |
| + JNIEnv* env = AttachCurrentThread(); |
| + ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| + if (obj.is_null()) |
| + return; |
| + Java_ContentViewCore_resetVSyncNotification(env, obj.obj()); |
| + |
| // if tab_crashed_ is already true, just return. e.g. if two tabs share the |
| // render process, this will be called for each tab when the render process |
| // crashed. If user reload one tab, a new render process is created. It can be |
| @@ -358,10 +364,6 @@ void ContentViewCoreImpl::OnTabCrashed() { |
| if (tab_crashed_) |
| return; |
| tab_crashed_ = true; |
| - JNIEnv* env = AttachCurrentThread(); |
| - ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| - if (obj.is_null()) |
| - return; |
| Java_ContentViewCore_onTabCrash(env, obj.obj()); |
| } |
| @@ -677,6 +679,15 @@ void ContentViewCoreImpl::LoadUrl( |
| tab_crashed_ = false; |
| } |
| +void ContentViewCoreImpl::SetVSyncNotificationEnabled(bool enabled) { |
| + JNIEnv* env = AttachCurrentThread(); |
| + ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| + if (obj.is_null()) |
| + return; |
| + Java_ContentViewCore_setVSyncNotificationEnabled( |
| + env, obj.obj(), static_cast<jboolean>(enabled)); |
| +} |
| + |
| ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { |
| return window_android_; |
| } |
| @@ -1180,6 +1191,18 @@ void ContentViewCoreImpl::UpdateVSyncParameters(JNIEnv* env, jobject /* obj */, |
| base::TimeDelta::FromMicroseconds(interval_micros)); |
| } |
| +void ContentViewCoreImpl::SendVSync(JNIEnv* env, jobject /* obj */, |
| + jlong frame_time_micros) { |
| + RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| + if (!view) |
| + return; |
| + |
| + RenderWidgetHostImpl* host = RenderWidgetHostImpl::From( |
| + view->GetRenderWidgetHost()); |
| + |
| + host->SendVSync(base::TimeTicks::FromInternalValue(frame_time_micros)); |
|
no sievers
2013/04/08 17:58:06
Hmm I can't find the definition for this function.
|
| +} |
| + |
| jboolean ContentViewCoreImpl::PopulateBitmapFromCompositor(JNIEnv* env, |
| jobject obj, |
| jobject jbitmap) { |