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

@ -5,6 +5,7 @@
#include "atom/browser/net/asar/url_request_asar_job.h"
#include <string>
#include <utility>
#include <vector>
#include "atom/common/asar/archive.h"

View file

@ -4,6 +4,8 @@
#include "atom/browser/net/atom_cert_verifier.h"
#include <utility>
#include "atom/browser/browser.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "base/containers/linked_list.h"

View file

@ -4,6 +4,7 @@
#include "atom/browser/net/atom_network_delegate.h"
#include <memory>
#include <utility>
#include "atom/browser/api/atom_api_web_contents.h"

View file

@ -6,6 +6,7 @@
#define ATOM_BROWSER_NET_ATOM_NETWORK_DELEGATE_H_
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>

View file

@ -4,7 +4,11 @@
// found in the LICENSE file.
#include "atom/browser/net/atom_url_request.h"
#include <string>
#include <memory>
#include <utility>
#include "atom/browser/api/atom_api_url_request.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/net/atom_url_request_job_factory.h"

View file

@ -7,7 +7,9 @@
#define ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_
#include <string>
#include <memory>
#include <vector>
#include "atom/browser/api/atom_api_url_request.h"
#include "atom/browser/atom_browser_context.h"
#include "base/memory/ref_counted.h"

View file

@ -4,6 +4,8 @@
#include "atom/browser/net/js_asker.h"
#include <memory>
#include <utility>
#include <vector>
#include "atom/common/native_mate_converters/callback.h"

View file

@ -5,6 +5,9 @@
#ifndef ATOM_BROWSER_NET_JS_ASKER_H_
#define ATOM_BROWSER_NET_JS_ASKER_H_
#include <memory>
#include <utility>
#include "atom/common/native_mate_converters/net_converter.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"

View file

@ -4,6 +4,7 @@
#include "atom/browser/net/url_request_async_asar_job.h"
#include <memory>
#include <string>
#include "atom/common/atom_constants.h"

View file

@ -5,6 +5,8 @@
#ifndef ATOM_BROWSER_NET_URL_REQUEST_ASYNC_ASAR_JOB_H_
#define ATOM_BROWSER_NET_URL_REQUEST_ASYNC_ASAR_JOB_H_
#include <memory>
#include "atom/browser/net/asar/url_request_asar_job.h"
#include "atom/browser/net/js_asker.h"

View file

@ -4,6 +4,7 @@
#include "atom/browser/net/url_request_buffer_job.h"
#include <memory>
#include <string>
#include "atom/common/atom_constants.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_NET_URL_REQUEST_BUFFER_JOB_H_
#define ATOM_BROWSER_NET_URL_REQUEST_BUFFER_JOB_H_
#include <memory>
#include <string>
#include "atom/browser/net/js_asker.h"

View file

@ -5,6 +5,7 @@
#include "atom/browser/net/url_request_fetch_job.h"
#include <algorithm>
#include <memory>
#include <string>
#include "atom/browser/api/atom_api_session.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_NET_URL_REQUEST_FETCH_JOB_H_
#define ATOM_BROWSER_NET_URL_REQUEST_FETCH_JOB_H_
#include <memory>
#include <string>
#include "atom/browser/net/js_asker.h"

View file

@ -2,11 +2,14 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/net/url_request_stream_job.h"
#include <algorithm>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include "atom/browser/net/url_request_stream_job.h"
#include "atom/common/api/event_emitter_caller.h"
#include "atom/common/atom_constants.h"
#include "atom/common/native_mate_converters/net_converter.h"

View file

@ -6,6 +6,7 @@
#define ATOM_BROWSER_NET_URL_REQUEST_STREAM_JOB_H_
#include <deque>
#include <memory>
#include <string>
#include "atom/browser/api/event_subscriber.h"

View file

@ -4,6 +4,7 @@
#include "atom/browser/net/url_request_string_job.h"
#include <memory>
#include <string>
#include "atom/common/atom_constants.h"

View file

@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_NET_URL_REQUEST_STRING_JOB_H_
#define ATOM_BROWSER_NET_URL_REQUEST_STRING_JOB_H_
#include <memory>
#include <string>
#include "atom/browser/net/js_asker.h"