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:
parent
183a043216
commit
d663b4eaee
120 changed files with 204 additions and 17 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "brightray/browser/browser_client.h"
|
||||
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/path_service.h"
|
||||
#include "brightray/browser/browser_context.h"
|
||||
#include "brightray/browser/browser_main_parts.h"
|
||||
|
@ -26,7 +27,8 @@ BrowserClient* g_browser_client;
|
|||
base::LazyInstance<std::string>::DestructorAtExit
|
||||
g_io_thread_application_locale = LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
std::string g_application_locale;
|
||||
base::NoDestructor<std::string> g_application_locale;
|
||||
|
||||
|
||||
void SetApplicationLocaleOnIOThread(const std::string& locale) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
|
@ -45,7 +47,7 @@ void BrowserClient::SetApplicationLocale(const std::string& locale) {
|
|||
base::BindOnce(&SetApplicationLocaleOnIOThread, locale))) {
|
||||
g_io_thread_application_locale.Get() = locale;
|
||||
}
|
||||
g_application_locale = locale;
|
||||
*g_application_locale = locale;
|
||||
}
|
||||
|
||||
BrowserClient* BrowserClient::Get() {
|
||||
|
@ -127,7 +129,7 @@ content::DevToolsManagerDelegate* BrowserClient::GetDevToolsManagerDelegate() {
|
|||
std::string BrowserClient::GetApplicationLocale() {
|
||||
if (BrowserThread::CurrentlyOn(BrowserThread::IO))
|
||||
return g_io_thread_application_locale.Get();
|
||||
return g_application_locale;
|
||||
return *g_application_locale;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_
|
||||
#define BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
#include "brightray/browser/browser_context.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_util.h"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#define BRIGHTRAY_BROWSER_BROWSER_CONTEXT_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <sys/stat.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include <glib.h> // for g_setenv()
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "brightray/browser/devtools_manager_delegate.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/bind.h"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE-CHROMIUM file.
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "brightray/browser/inspectable_web_contents_impl.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_IMPL_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "brightray/browser/media/media_stream_devices_controller.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "brightray/browser/media/media_capture_devices_dispatcher.h"
|
||||
#include "content/public/browser/desktop_media_id.h"
|
||||
#include "content/public/common/media_stream_request.h"
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#ifndef BRIGHTRAY_BROWSER_NET_LOG_H_
|
||||
#define BRIGHTRAY_BROWSER_NET_LOG_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "net/log/net_log.h"
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include "brightray/browser/url_request_context_getter.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
|
||||
#define BRIGHTRAY_BROWSER_URL_REQUEST_CONTEXT_GETTER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef BRIGHTRAY_BROWSER_VIEWS_INSPECTABLE_WEB_CONTENTS_VIEW_VIEWS_H_
|
||||
#define BRIGHTRAY_BROWSER_VIEWS_INSPECTABLE_WEB_CONTENTS_VIEW_VIEWS_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "brightray/browser/inspectable_web_contents_view.h"
|
||||
#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "brightray/browser/views/views_delegate.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
|
||||
#include "ui/views/widget/native_widget_aura.h"
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "brightray/browser/win/notification_presenter_win.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <uxtheme.h>
|
||||
#include <windowsx.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "brightray/browser/win/win32_desktop_notifications/common.h"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef BRIGHTRAY_BROWSER_ZOOM_LEVEL_DELEGATE_H_
|
||||
#define BRIGHTRAY_BROWSER_ZOOM_LEVEL_DELEGATE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue