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

Side by Side Diff: content/browser/android/java/gin_java_method_invocation_helper_unittest.cc

Issue 1527183004: Remove usage of ScopedJavaLocalRef as a class field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/android/java/gin_java_method_invocation_helper.h" 5 #include "content/browser/android/java/gin_java_method_invocation_helper.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "content/browser/android/java/jni_helper.h" 8 #include "content/browser/android/java/jni_helper.h"
9 #include "content/common/android/gin_java_bridge_value.h" 9 #include "content/common/android/gin_java_bridge_value.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 25 matching lines...) Expand all
36 36
37 bool IsObjectGetClassMethod(const JavaMethod* method) override { 37 bool IsObjectGetClassMethod(const JavaMethod* method) override {
38 return false; 38 return false;
39 } 39 }
40 40
41 const base::android::JavaRef<jclass>& GetSafeAnnotationClass() override { 41 const base::android::JavaRef<jclass>& GetSafeAnnotationClass() override {
42 return safe_annotation_class_; 42 return safe_annotation_class_;
43 } 43 }
44 44
45 private: 45 private:
46 base::android::ScopedJavaLocalRef<jclass> safe_annotation_class_; 46 base::android::ScopedJavaGlobalRef<jclass> safe_annotation_class_;
47 47
48 DISALLOW_COPY_AND_ASSIGN(NullObjectDelegate); 48 DISALLOW_COPY_AND_ASSIGN(NullObjectDelegate);
49 }; 49 };
50 50
51 class NullDispatcherDelegate 51 class NullDispatcherDelegate
52 : public GinJavaMethodInvocationHelper::DispatcherDelegate { 52 : public GinJavaMethodInvocationHelper::DispatcherDelegate {
53 public: 53 public:
54 NullDispatcherDelegate() {} 54 NullDispatcherDelegate() {}
55 55
56 ~NullDispatcherDelegate() override {} 56 ~NullDispatcherDelegate() override {}
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 helper->Invoke(); 326 helper->Invoke();
327 EXPECT_TRUE(object_delegate->find_method_called()); 327 EXPECT_TRUE(object_delegate->find_method_called());
328 EXPECT_TRUE(object_delegate->get_class_called()); 328 EXPECT_TRUE(object_delegate->get_class_called());
329 EXPECT_TRUE(helper->HoldsPrimitiveResult()); 329 EXPECT_TRUE(helper->HoldsPrimitiveResult());
330 EXPECT_TRUE(helper->GetPrimitiveResult().empty()); 330 EXPECT_TRUE(helper->GetPrimitiveResult().empty());
331 EXPECT_EQ(kGinJavaBridgeAccessToObjectGetClassIsBlocked, 331 EXPECT_EQ(kGinJavaBridgeAccessToObjectGetClassIsBlocked,
332 helper->GetInvocationError()); 332 helper->GetInvocationError());
333 } 333 }
334 334
335 } // namespace content 335 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698