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

Side by Side Diff: components/web_restrictions/browser/mock_web_restrictions_client.h

Issue 1684153002: Web restrictions component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compilation errors. Created 4 years, 10 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_WEB_RESTRICTIONS_BROWSER_MOCK_WEB_RESTRICTIONS_CLIENT_H_
6 #define COMPONENTS_WEB_RESTRICTIONS_BROWSER_MOCK_WEB_RESTRICTIONS_CLIENT_H_
7
8 #include "base/macros.h"
9 #include "jni/MockWebRestrictionsClient_jni.h"
10
11 namespace web_restrictions {
12
13 // This is a wrapper for the Java MockWebRestrictionsClient.
14 class MockWebRestrictionsClient {
15 public:
16 MockWebRestrictionsClient()
17 : env_(base::android::AttachCurrentThread()) {
18 RegisterNativesImpl(env_);
Bernhard Bauer 2016/02/22 12:39:17 This would register the JNI methods every time thi
aberent 2016/02/23 13:52:37 Done.
19 Java_MockWebRestrictionsClient_registerAsMockForTesting(env_);
20 }
21
22 ~MockWebRestrictionsClient() {
23 Java_MockWebRestrictionsClient_unregisterAsMockForTesting(env_);
24 }
25
26 private:
27 JNIEnv* env_;
Bernhard Bauer 2016/02/22 12:39:16 It's bad form to hold on to a JNIEnv object. Just
aberent 2016/02/23 13:52:37 Done.
28 };
29
30 } // namespace web_restrictions
31 #endif // COMPONENTS_WEB_RESTRICTIONS_BROWSER_MOCK_WEB_RESTRICTIONS_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698