fix: fix gn cpplint warnings (#14583)

* chore: fix cpplint 'include_what_you_use' warnings

Typically by including <memory>, <utility> etc.

* chore: fix 'static/global string constant' warning

Use C style strings instead of std::string.

Style guide forbids non-trivial static / global variables. https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

/home/charles/electron/electron-gn/src/electron/script/cpplint.js

* refactor: remove global string variables.

Fix 'global string variables are not permitted' linter warnings
by using the base::NoDestructor<> wrapper to make it explicit that
these variables are never destroyed.

The style guide's take on globals with nontrivial destructors:
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

* fix: initializer error introduced in last commit

* fix: remove WIP file that was included by accident

* fix: include order

* fix: include order

* fix: include order

* fix: include order, again
This commit is contained in:
Charles Kerr 2018-09-12 19:25:56 -05:00 committed by GitHub
parent 183a043216
commit d663b4eaee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
120 changed files with 204 additions and 17 deletions

View file

@ -7,6 +7,7 @@
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

View file

@ -4,6 +4,8 @@
#include "atom/browser/api/atom_api_browser_window.h"
#include <memory>
#include "atom/browser/browser.h"
#include "atom/browser/unresponsive_suppressor.h"
#include "atom/browser/web_contents_preferences.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_API_ATOM_API_BROWSER_WINDOW_H_
#define ATOM_BROWSER_API_ATOM_API_BROWSER_WINDOW_H_
#include <memory>
#include <string>
#include <vector>

View file

@ -4,6 +4,9 @@
#include "atom/browser/api/atom_api_cookies.h"
#include <memory>
#include <utility>
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/request_context_delegate.h"
#include "atom/common/native_mate_converters/callback.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_API_ATOM_API_COOKIES_H_
#define ATOM_BROWSER_API_ATOM_API_COOKIES_H_
#include <memory>
#include <string>
#include "atom/browser/api/trackable_object.h"

View file

@ -4,7 +4,9 @@
#include "atom/browser/api/atom_api_debugger.h"
#include <memory>
#include <string>
#include <utility>
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/value_converter.h"

View file

@ -4,6 +4,8 @@
#include "atom/browser/api/atom_api_desktop_capturer.h"
#include <memory>
#include <utility>
#include <vector>
using base::PlatformThreadRef;

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_API_ATOM_API_DESKTOP_CAPTURER_H_
#define ATOM_BROWSER_API_ATOM_API_DESKTOP_CAPTURER_H_
#include <memory>
#include <string>
#include "atom/browser/api/event_emitter.h"

View file

@ -4,6 +4,8 @@
#include "atom/browser/api/atom_api_menu_views.h"
#include <memory>
#include "atom/browser/native_window_views.h"
#include "atom/browser/unresponsive_suppressor.h"
#include "ui/display/screen.h"

View file

@ -6,6 +6,7 @@
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#include <map>
#include <memory>
#include "atom/browser/api/atom_api_menu.h"
#include "base/memory/weak_ptr.h"

View file

@ -3,6 +3,9 @@
// found in the LICENSE file.
#include "atom/browser/api/atom_api_net_log.h"
#include <utility>
#include "atom/browser/atom_browser_client.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/file_path_converter.h"

View file

@ -6,7 +6,9 @@
#define ATOM_BROWSER_API_ATOM_API_PROTOCOL_H_
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "atom/browser/api/trackable_object.h"

View file

@ -5,7 +5,9 @@
#include "atom/browser/api/atom_api_session.h"
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "atom/browser/api/atom_api_cookies.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_
#define ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_
#include <memory>
#include <string>
#include "atom/browser/api/event_emitter.h"

View file

@ -4,8 +4,10 @@
#include "atom/browser/api/atom_api_web_contents.h"
#include <memory>
#include <set>
#include <string>
#include <utility>
#include "atom/browser/api/atom_api_browser_window.h"
#include "atom/browser/api/atom_api_debugger.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_
#define ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_
#include <memory>
#include <string>
#include <vector>

View file

@ -5,6 +5,7 @@
#include "atom/browser/api/atom_api_web_request.h"
#include <string>
#include <utility>
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/net/atom_network_delegate.h"

View file

@ -1,9 +1,12 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <string>
#include "atom/browser/api/event_subscriber.h"
#include <string>
#include <utility>
#include "atom/common/native_mate_converters/callback.h"
namespace {

View file

@ -6,7 +6,9 @@
#define ATOM_BROWSER_API_EVENT_SUBSCRIBER_H_
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "atom/common/api/event_emitter_caller.h"
#include "base/synchronization/lock.h"

View file

@ -4,6 +4,8 @@
#include "atom/browser/api/trackable_object.h"
#include <memory>
#include "atom/browser/atom_browser_main_parts.h"
#include "base/bind.h"
#include "base/supports_user_data.h"