Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: jni/JniCallbacks.h

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Left Patch Set: Created April 11, 2014, 1:31 p.m.
Right Patch Set: Even more review issues fixed. Created April 28, 2014, 10:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « jni/Debug.h ('k') | jni/JniCallbacks.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 24 matching lines...) Expand all
35 return javaVM; 35 return javaVM;
36 } 36 }
37 37
38 jobject GetCallbackObject() const 38 jobject GetCallbackObject() const
39 { 39 {
40 return callbackObject->Get(); 40 return callbackObject->Get();
41 } 41 }
42 42
43 private: 43 private:
44 JavaVM* javaVM; 44 JavaVM* javaVM;
45 JniGlobalReference<jobject>::Ptr callbackObject; 45 const JniGlobalReference<jobject>::Ptr callbackObject;
46 JniGlobalReference<jclass>::Ptr exceptionLoggerClass; 46 const JniGlobalReference<jclass>::Ptr exceptionLoggerClass;
47 }; 47 };
48 48
49 class JniEventCallback : public JniCallbackBase 49 class JniEventCallback : public JniCallbackBase
50 { 50 {
51 public: 51 public:
52 JniEventCallback(JNIEnv* env, jobject callbackObject); 52 JniEventCallback(JNIEnv* env, jobject callbackObject);
53 void Callback(AdblockPlus::JsValueList& params); 53 void Callback(AdblockPlus::JsValueList& params);
54 }; 54 };
55 55
56 class JniUpdaterCallback : public JniCallbackBase 56 class JniUpdaterCallback : public JniCallbackBase
57 { 57 {
58 public: 58 public:
59 JniUpdaterCallback(JNIEnv* env, jobject callbackObject); 59 JniUpdaterCallback(JNIEnv* env, jobject callbackObject);
60 void Callback(const std::string& arg); 60 void Callback(const std::string& arg);
61 }; 61 };
62 62
63 class JniFilterChangeCallback : public JniCallbackBase 63 class JniFilterChangeCallback : public JniCallbackBase
64 { 64 {
65 public: 65 public:
66 JniFilterChangeCallback(JNIEnv* env, jobject callbackObject); 66 JniFilterChangeCallback(JNIEnv* env, jobject callbackObject);
67 void Callback(const std::string& arg, const AdblockPlus::JsValuePtr jsValue); 67 void Callback(const std::string& arg, const AdblockPlus::JsValuePtr jsValue);
68 68
69 private: 69 private:
70 JniGlobalReference<jclass>::Ptr jsValueClass; 70 const JniGlobalReference<jclass>::Ptr jsValueClass;
Felix Dahlke 2014/04/16 15:24:25 You seem to make everything const that can be, so
René Jeschke 2014/04/16 17:51:47 Done.
71 }; 71 };
72 72
73 class JniLogSystemCallback : public JniCallbackBase, public AdblockPlus::LogSyst em 73 class JniLogSystemCallback : public JniCallbackBase, public AdblockPlus::LogSyst em
74 { 74 {
75 public: 75 public:
76 JniLogSystemCallback(JNIEnv* env, jobject callbackObject); 76 JniLogSystemCallback(JNIEnv* env, jobject callbackObject);
77 void operator()(AdblockPlus::LogSystem::LogLevel logLevel, const std::string& message, const std::string& source); 77 void operator()(AdblockPlus::LogSystem::LogLevel logLevel, const std::string& message, const std::string& source);
78 78
79 private: 79 private:
80 JniGlobalReference<jclass>::Ptr logLevelClass; 80 const JniGlobalReference<jclass>::Ptr logLevelClass;
81 }; 81 };
82 82
83 class JniWebRequest : public JniCallbackBase, public AdblockPlus::WebRequest 83 class JniWebRequest : public JniCallbackBase, public AdblockPlus::WebRequest
84 { 84 {
85 public: 85 public:
86 JniWebRequest(JNIEnv* env, jobject callbackObject); 86 JniWebRequest(JNIEnv* env, jobject callbackObject);
87 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea derList& requestHeaders) const; 87 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea derList& requestHeaders) const;
88 88
89 private: 89 private:
90 jobject NewTuple(JNIEnv* env, const std::string& a, const std::string& b) cons t; 90 jobject NewTuple(JNIEnv* env, const std::string& a, const std::string& b) cons t;
91 91
92 JniGlobalReference<jclass>::Ptr tupleClass; 92 const JniGlobalReference<jclass>::Ptr tupleClass;
93 JniGlobalReference<jclass>::Ptr serverResponseClass; 93 const JniGlobalReference<jclass>::Ptr serverResponseClass;
94 }; 94 };
95 95
96 #endif /* JNICALLBACKS_H */ 96 #endif /* JNICALLBACKS_H */
LEFTRIGHT

Powered by Google App Engine
This is Rietveld