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

Unified Diff: ios/web/public/test/crw_test_js_injection_receiver.mm

Issue 1423483004: Updated TODO(shreyasv) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/public/test/crw_test_js_injection_receiver.mm
diff --git a/ios/web/public/test/crw_test_js_injection_receiver.mm b/ios/web/public/test/crw_test_js_injection_receiver.mm
index 692dd96d9602d2bc0fca82af8d15383d7810fb89..4ef9db7b01a2190b8ddeb4a332ba17cba6c539a1 100644
--- a/ios/web/public/test/crw_test_js_injection_receiver.mm
+++ b/ios/web/public/test/crw_test_js_injection_receiver.mm
@@ -6,6 +6,7 @@
#import <UIKit/UIKit.h>
+#include "base/ios/weak_nsobject.h"
#import "base/mac/scoped_nsobject.h"
#import "ios/web/public/web_state/js/crw_js_injection_evaluator.h"
@@ -27,11 +28,11 @@
- (void)evaluateJavaScript:(NSString*)script
stringResultHandler:(web::JavaScriptCompletion)handler {
+ base::WeakNSObject<CRWTestUIWebViewEvaluator> weakEvaluator(self);
dispatch_async(dispatch_get_main_queue(), ^{
- // TODO(shreyasv): Change to weaknsobject once weaknsobject is moved to
- // ios/base.
+ UIWebView* webView = weakEvaluator ? weakEvaluator.get()->_webView : nil;
NSString* result =
- [_webView stringByEvaluatingJavaScriptFromString:script];
+ [webView stringByEvaluatingJavaScriptFromString:script];
if (handler)
handler(result, nil);
});
« no previous file with comments | « ios/web/crw_browsing_data_store.mm ('k') | ios/web/public/test/response_providers/data_response_provider.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698