diff --git a/fml/platform/darwin/cf_utils.h b/fml/platform/darwin/cf_utils.h index 0dc984ee89baf..02fd3229d7c66 100644 --- a/fml/platform/darwin/cf_utils.h +++ b/fml/platform/darwin/cf_utils.h @@ -16,6 +16,7 @@ class CFRef { public: CFRef() : instance_(nullptr) {} + // NOLINTNEXTLINE(google-explicit-constructor) CFRef(T instance) : instance_(instance) {} CFRef(const CFRef& other) : instance_(other.instance_) { @@ -54,9 +55,10 @@ class CFRef { return instance; } + // NOLINTNEXTLINE(google-explicit-constructor) operator T() const { return instance_; } - operator bool() const { return instance_ != nullptr; } + explicit operator bool() const { return instance_ != nullptr; } private: T instance_; diff --git a/fml/platform/darwin/scoped_block.h b/fml/platform/darwin/scoped_block.h index d4a7e670517da..2608d1ef3149e 100644 --- a/fml/platform/darwin/scoped_block.h +++ b/fml/platform/darwin/scoped_block.h @@ -67,6 +67,7 @@ class ScopedBlock { bool operator!=(B that) const { return block_ != that; } + // NOLINTNEXTLINE(google-explicit-constructor) operator B() const { return block_; } B get() const { return block_; } diff --git a/fml/platform/darwin/scoped_nsobject.h b/fml/platform/darwin/scoped_nsobject.h index 34d966c8a3e8b..9f910e44f31ed 100644 --- a/fml/platform/darwin/scoped_nsobject.h +++ b/fml/platform/darwin/scoped_nsobject.h @@ -45,6 +45,7 @@ class scoped_nsprotocol { scoped_nsprotocol(const scoped_nsprotocol& that) : object_([that.object_ retain]) {} template + // NOLINTNEXTLINE(google-explicit-constructor) scoped_nsprotocol(const scoped_nsprotocol& that) : object_([that.get() retain]) {} ~scoped_nsprotocol() { [object_ release]; } @@ -66,7 +67,7 @@ class scoped_nsprotocol { bool operator==(NST that) const { return object_ == that; } bool operator!=(NST that) const { return object_ != that; } - operator NST() const { return object_; } + operator NST() const { return object_; } // NOLINT(google-explicit-constructor) NST get() const { return object_; } @@ -116,6 +117,7 @@ class scoped_nsobject : public scoped_nsprotocol { scoped_nsobject(const scoped_nsobject& that) : scoped_nsprotocol(that) {} template + // NOLINTNEXTLINE(google-explicit-constructor) scoped_nsobject(const scoped_nsobject& that) : scoped_nsprotocol(that) {} scoped_nsobject& operator=(const scoped_nsobject& that) { @@ -133,6 +135,7 @@ class scoped_nsobject : public scoped_nsprotocol { scoped_nsobject(const scoped_nsobject& that) : scoped_nsprotocol(that) {} template + // NOLINTNEXTLINE(google-explicit-constructor) scoped_nsobject(const scoped_nsobject& that) : scoped_nsprotocol(that) {} scoped_nsobject& operator=(const scoped_nsobject& that) { diff --git a/shell/platform/common/accessibility_bridge.h b/shell/platform/common/accessibility_bridge.h index 7a2b0a6c95d69..b9ef87719eb2a 100644 --- a/shell/platform/common/accessibility_bridge.h +++ b/shell/platform/common/accessibility_bridge.h @@ -106,7 +106,8 @@ class AccessibilityBridge /// @param[in] user_data A custom pointer to the data of your /// choice. This pointer can be retrieve later /// through GetUserData(). - AccessibilityBridge(std::unique_ptr delegate); + explicit AccessibilityBridge( + std::unique_ptr delegate); ~AccessibilityBridge(); //------------------------------------------------------------------------------ diff --git a/shell/platform/common/text_editing_delta.h b/shell/platform/common/text_editing_delta.h index 61c9875bc92e6..e66e891f7db18 100644 --- a/shell/platform/common/text_editing_delta.h +++ b/shell/platform/common/text_editing_delta.h @@ -23,9 +23,9 @@ struct TextEditingDelta { TextRange range, const std::string& text); - TextEditingDelta(const std::u16string& text); + explicit TextEditingDelta(const std::u16string& text); - TextEditingDelta(const std::string& text); + explicit TextEditingDelta(const std::string& text); virtual ~TextEditingDelta() = default; diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index e4b0aedac2055..f20bb26ef47d4 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -40,7 +40,7 @@ namespace flutter { class VsyncWaiterIOS final : public VsyncWaiter { public: - VsyncWaiterIOS(flutter::TaskRunners task_runners); + explicit VsyncWaiterIOS(flutter::TaskRunners task_runners); ~VsyncWaiterIOS() override; diff --git a/shell/platform/darwin/ios/ios_switchable_gl_context.h b/shell/platform/darwin/ios/ios_switchable_gl_context.h index 24bceb3e60249..df84f78accd4a 100644 --- a/shell/platform/darwin/ios/ios_switchable_gl_context.h +++ b/shell/platform/darwin/ios/ios_switchable_gl_context.h @@ -26,7 +26,7 @@ namespace flutter { /// |GLContextSwitch| and should be destroyed when The |GLContectSwitch| destroys. class IOSSwitchableGLContext final : public SwitchableGLContext { public: - IOSSwitchableGLContext(EAGLContext* context); + explicit IOSSwitchableGLContext(EAGLContext* context); bool SetCurrent() override; diff --git a/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h b/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h index aca395edacf48..141e27509dd44 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h +++ b/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h @@ -19,7 +19,7 @@ namespace flutter { // Platform views are not yet supported. class FlutterCompositor { public: - FlutterCompositor(FlutterViewController* view_controller); + explicit FlutterCompositor(FlutterViewController* view_controller); virtual ~FlutterCompositor() = default;