Skip to content

Commit

Permalink
Add 'explicit' to Android embedder constructors (#29830)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmagman authored Nov 19, 2021
1 parent 9e49ffb commit d581efc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions fml/platform/android/scoped_java_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class ScopedJavaGlobalRef : public JavaRef<T> {
public:
ScopedJavaGlobalRef() {}

// NOLINTNEXTLINE(google-explicit-constructor)
explicit ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) {
this->Reset(other);
}
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/android_image_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace flutter {

class AndroidImageGenerator : public ImageGenerator {
private:
AndroidImageGenerator(sk_sp<SkData> buffer);
explicit AndroidImageGenerator(sk_sp<SkData> buffer);

public:
~AndroidImageGenerator();
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/apk_asset_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ AssetResolver::AssetResolverType APKAssetProvider::GetType() const {

class APKAssetMapping : public fml::Mapping {
public:
APKAssetMapping(AAsset* asset) : asset_(asset) {}
explicit APKAssetMapping(AAsset* asset) : asset_(asset) {}

~APKAssetMapping() override { AAsset_close(asset_); }

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/flutter_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FlutterMain {
const flutter::Settings settings_;
DartServiceIsolate::CallbackHandle observatory_uri_callback_;

FlutterMain(flutter::Settings settings);
explicit FlutterMain(flutter::Settings settings);

static void Init(JNIEnv* env,
jclass clazz,
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/platform_message_handler_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace flutter {
class PlatformMessageHandlerAndroid : public PlatformMessageHandler {
public:
PlatformMessageHandlerAndroid(
explicit PlatformMessageHandlerAndroid(
const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade);
void HandlePlatformMessage(std::unique_ptr<PlatformMessage> message) override;
void InvokePlatformMessageResponseCallback(
Expand Down
3 changes: 2 additions & 1 deletion shell/platform/android/platform_view_android_jni_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ namespace flutter {
///
class PlatformViewAndroidJNIImpl final : public PlatformViewAndroidJNI {
public:
PlatformViewAndroidJNIImpl(fml::jni::JavaObjectWeakGlobalRef java_object);
explicit PlatformViewAndroidJNIImpl(
fml::jni::JavaObjectWeakGlobalRef java_object);

~PlatformViewAndroidJNIImpl() override;

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/vsync_waiter_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class VsyncWaiterAndroid final : public VsyncWaiter {
public:
static bool Register(JNIEnv* env);

VsyncWaiterAndroid(flutter::TaskRunners task_runners);
explicit VsyncWaiterAndroid(flutter::TaskRunners task_runners);

~VsyncWaiterAndroid() override;

Expand Down

0 comments on commit d581efc

Please sign in to comment.