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 #ifdef _DEBUG
// Don't display assert dialog boxes in CI test runs // 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); bool is_ci = IsEnvSet(kCI);
if (!is_ci) { if (!is_ci) {
for (int i = 0; i < arguments.argc; ++i) { 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) { void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
std::string file_path; std::string file_path;
if (options->is_dict()) { 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) if (path_value)
file_path = path_value->GetString(); file_path = path_value->GetString();
} else if (options->is_string()) { } else if (options->is_string()) {

View file

@ -10,6 +10,14 @@ namespace atom {
namespace util { 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::Maybe<bool> Promise::RejectWithErrorMessage(const std::string& string) {
v8::Local<v8::String> error_message = v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate(), string.c_str()); v8::String::NewFromUtf8(isolate(), string.c_str());

View file

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

View file

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

View file

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