chore: fix more chromium-style errors in windows code (#13487)

Finding more chromium-style linting errors as I build more of the windows code :)
This commit is contained in:
Jeremy Apthorp 2018-06-28 14:20:11 -07:00 committed by GitHub
parent 003a92e099
commit d6af3bfcd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 16 deletions

View file

@ -71,7 +71,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
#ifdef _DEBUG
// Don't display assert dialog boxes in CI test runs
static const auto kCI = "ELECTRON_CI";
static const char* kCI = "ELECTRON_CI";
bool is_ci = IsEnvSet(kCI);
if (!is_ci) {
for (int i = 0; i < arguments.argc; ++i) {

View file

@ -20,7 +20,8 @@ URLRequestAsyncAsarJob::URLRequestAsyncAsarJob(
void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
std::string file_path;
if (options->is_dict()) {
auto path_value = options->FindKeyOfType("path", base::Value::Type::STRING);
auto* path_value =
options->FindKeyOfType("path", base::Value::Type::STRING);
if (path_value)
file_path = path_value->GetString();
} else if (options->is_string()) {

View file

@ -10,6 +10,14 @@ namespace atom {
namespace util {
Promise::Promise(v8::Isolate* isolate) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
isolate_ = isolate;
resolver_.Reset(isolate, v8::Promise::Resolver::New(isolate));
}
Promise::~Promise() = default;
v8::Maybe<bool> Promise::RejectWithErrorMessage(const std::string& string) {
v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate(), string.c_str());

View file

@ -16,12 +16,8 @@ namespace util {
class Promise {
public:
explicit Promise(v8::Isolate* isolate) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
isolate_ = isolate;
resolver_.Reset(isolate, v8::Promise::Resolver::New(isolate));
}
~Promise() {}
explicit Promise(v8::Isolate* isolate);
~Promise();
v8::Isolate* isolate() const { return isolate_; }

View file

@ -23,13 +23,15 @@ class ColorChooserDialog
ColorChooserDialog(views::ColorChooserListener* listener,
SkColor initial_color,
gfx::NativeWindow owning_window);
virtual ~ColorChooserDialog();
// BaseShellDialog:
virtual bool IsRunning(gfx::NativeWindow owning_window) const override;
virtual void ListenerDestroyed() override;
bool IsRunning(gfx::NativeWindow owning_window) const override;
void ListenerDestroyed() override;
private:
~ColorChooserDialog() override;
friend class base::RefCountedThreadSafe<ColorChooserDialog>;
struct ExecuteOpenParams {
ExecuteOpenParams(SkColor color, RunState run_state, HWND owner);
SkColor color;

View file

@ -22,15 +22,15 @@ class ColorChooserWin : public content::ColorChooser,
SkColor initial_color);
ColorChooserWin(content::WebContents* web_contents, SkColor initial_color);
~ColorChooserWin();
~ColorChooserWin() override;
// content::ColorChooser overrides:
virtual void End() override;
virtual void SetSelectedColor(SkColor color) override {}
void End() override;
void SetSelectedColor(SkColor color) override {}
// views::ColorChooserListener overrides:
virtual void OnColorChosen(SkColor color);
virtual void OnColorChooserDialogClosed();
void OnColorChosen(SkColor color) override;
void OnColorChooserDialogClosed() override;
private:
static ColorChooserWin* current_color_chooser_;