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

Side by Side Diff: chrome/browser/android/webapps/webapp_registry.cc

Issue 2237943002: Remove now-unnecessary .obj() in Java method calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@switch-context
Patch Set: Rebase *again* :( Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/webapps/webapp_registry.h" 5 #include "chrome/browser/android/webapps/webapp_registry.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/context_utils.h" 9 #include "base/android/context_utils.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 13 matching lines...) Expand all
24 // destroy this closure from Java, eliminating the need for 24 // destroy this closure from Java, eliminating the need for
25 // OnWebappsUnregistered() and OnClearedWebappHistory() callbacks. 25 // OnWebappsUnregistered() and OnClearedWebappHistory() callbacks.
26 uintptr_t callback_pointer = reinterpret_cast<uintptr_t>( 26 uintptr_t callback_pointer = reinterpret_cast<uintptr_t>(
27 new base::Closure(callback)); 27 new base::Closure(callback));
28 28
29 // We will destroy |filter_bridge| from its Java counterpart before calling 29 // We will destroy |filter_bridge| from its Java counterpart before calling
30 // back OnWebappsUnregistered(). 30 // back OnWebappsUnregistered().
31 UrlFilterBridge* filter_bridge = new UrlFilterBridge(url_filter); 31 UrlFilterBridge* filter_bridge = new UrlFilterBridge(url_filter);
32 32
33 Java_WebappRegistry_unregisterWebappsForUrls( 33 Java_WebappRegistry_unregisterWebappsForUrls(
34 env, 34 env, base::android::GetApplicationContext(), filter_bridge->j_bridge(),
35 base::android::GetApplicationContext(),
36 filter_bridge->j_bridge().obj(),
37 callback_pointer); 35 callback_pointer);
38 } 36 }
39 37
40 void WebappRegistry::ClearWebappHistory(const base::Closure& callback) { 38 void WebappRegistry::ClearWebappHistory(const base::Closure& callback) {
41 JNIEnv* env = base::android::AttachCurrentThread(); 39 JNIEnv* env = base::android::AttachCurrentThread();
42 uintptr_t callback_pointer = reinterpret_cast<uintptr_t>( 40 uintptr_t callback_pointer = reinterpret_cast<uintptr_t>(
43 new base::Closure(callback)); 41 new base::Closure(callback));
44 42
45 Java_WebappRegistry_clearWebappHistory( 43 Java_WebappRegistry_clearWebappHistory(
46 env, 44 env,
(...skipping 16 matching lines...) Expand all
63 jlong jcallback) { 61 jlong jcallback) {
64 base::Closure* callback = reinterpret_cast<base::Closure*>(jcallback); 62 base::Closure* callback = reinterpret_cast<base::Closure*>(jcallback);
65 callback->Run(); 63 callback->Run();
66 delete callback; 64 delete callback;
67 } 65 }
68 66
69 // static 67 // static
70 bool WebappRegistry::RegisterWebappRegistry(JNIEnv* env) { 68 bool WebappRegistry::RegisterWebappRegistry(JNIEnv* env) {
71 return RegisterNativesImpl(env); 69 return RegisterNativesImpl(env);
72 } 70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698