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

Unified Diff: android_webview/native/aw_contents_io_thread_client_impl.cc

Issue 2485513003: Rename JavaObjectWeakGlobalRef::is_empty to avoid misuse. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | android_webview/native/popup_touch_handle_drawable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents_io_thread_client_impl.cc
diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/native/aw_contents_io_thread_client_impl.cc
index 1d9a655beb4028ba36f4d66d629ae6a7a069540b..63965db2074f4dfdf8844bde3d4ea9f9f660d1a1 100644
--- a/android_webview/native/aw_contents_io_thread_client_impl.cc
+++ b/android_webview/native/aw_contents_io_thread_client_impl.cc
@@ -273,13 +273,12 @@ void AwContentsIoThreadClientImpl::SetServiceWorkerIoThreadClient(
// static
std::unique_ptr<AwContentsIoThreadClient>
AwContentsIoThreadClient::GetServiceWorkerIoThreadClient() {
- if (g_sw_instance_.Get().is_empty())
- return std::unique_ptr<AwContentsIoThreadClient>();
-
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> java_delegate = g_sw_instance_.Get().get(env);
- DCHECK(!java_delegate.is_null());
+ if (java_delegate.is_null())
timvolodine 2016/11/07 17:13:01 to be more precise, I was looking here and compari
boliu 2016/11/07 17:23:33 They are not equivalent. is_empty (now is_initial
boliu 2016/11/07 17:25:29 darn it, got that backwards it's possible for get
timvolodine 2016/11/07 20:16:15 Just to follow-up: we chatted here a bit about thi
+ return std::unique_ptr<AwContentsIoThreadClient>();
+
return std::unique_ptr<AwContentsIoThreadClient>(
new AwContentsIoThreadClientImpl(false, java_delegate));
}
« no previous file with comments | « no previous file | android_webview/native/popup_touch_handle_drawable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698