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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java

Issue 1890343003: aw: Use functor callback for lifetime management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix UAF for realz Created 4 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package com.android.webview.chromium; 5 package com.android.webview.chromium;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.app.assist.AssistStructure.ViewNode; 9 import android.app.assist.AssistStructure.ViewNode;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 2241
2242 @Override 2242 @Override
2243 public PrintDocumentAdapter createPrintDocumentAdapter(String documentName) { 2243 public PrintDocumentAdapter createPrintDocumentAdapter(String documentName) {
2244 checkThread(); 2244 checkThread();
2245 return new AwPrintDocumentAdapter(mAwContents.getPdfExporter(), document Name); 2245 return new AwPrintDocumentAdapter(mAwContents.getPdfExporter(), document Name);
2246 } 2246 }
2247 2247
2248 // AwContents.NativeGLDelegate implementation ------------------------------ -------- 2248 // AwContents.NativeGLDelegate implementation ------------------------------ --------
2249 private class WebViewNativeGLDelegate implements AwContents.NativeGLDelegate { 2249 private class WebViewNativeGLDelegate implements AwContents.NativeGLDelegate {
2250 @Override 2250 @Override
2251 public boolean setDrawGLFunctionDetachedCallback(View view, Runnable cal lback) { 2251 public boolean supportsDrawGLFunctorReleasedCallback() {
2252 return false; // Not supported yet. 2252 return DrawGLFunctor.supportsDrawGLFunctorReleasedCallback();
2253 } 2253 }
2254 2254
2255 @Override 2255 @Override
2256 public boolean requestDrawGL(Canvas canvas, boolean waitForCompletion, V iew containerView) { 2256 public boolean requestDrawGL(Canvas canvas, boolean waitForCompletion, V iew containerView,
2257 Runnable releasedCallback) {
2257 if (mGLfunctor == null) { 2258 if (mGLfunctor == null) {
2258 mGLfunctor = new DrawGLFunctor( 2259 mGLfunctor = new DrawGLFunctor(
2259 mAwContents.getAwDrawGLViewContext(), mFactory.getWebVie wDelegate()); 2260 mAwContents.getAwDrawGLViewContext(), mFactory.getWebVie wDelegate());
2260 } 2261 }
2261 return mGLfunctor.requestDrawGL(canvas, containerView, waitForComple tion); 2262 return mGLfunctor.requestDrawGL(
2263 canvas, containerView, waitForCompletion, releasedCallback);
2262 } 2264 }
2263 2265
2264 @Override 2266 @Override
2265 public void detachGLFunctor() { 2267 public void detachGLFunctor() {
2266 if (mGLfunctor != null) { 2268 if (mGLfunctor != null) {
2267 mGLfunctor.detach(); 2269 mGLfunctor.detach();
2268 } 2270 }
2269 } 2271 }
2270 } 2272 }
2271 2273
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 mAwContents.extractSmartClipData(x, y, width, height); 2366 mAwContents.extractSmartClipData(x, y, width, height);
2365 } 2367 }
2366 2368
2367 // Implements SmartClipProvider 2369 // Implements SmartClipProvider
2368 @Override 2370 @Override
2369 public void setSmartClipResultHandler(final Handler resultHandler) { 2371 public void setSmartClipResultHandler(final Handler resultHandler) {
2370 checkThread(); 2372 checkThread();
2371 mAwContents.setSmartClipResultHandler(resultHandler); 2373 mAwContents.setSmartClipResultHandler(resultHandler);
2372 } 2374 }
2373 } 2375 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698