Skip to content

Commit c4ea33d

Browse files
authored
chore: add ELECTRON_ prefix to C++ include guards (electron#31925)
1 parent 0865267 commit c4ea33d

File tree

358 files changed

+1080
-1079
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+1080
-1079
lines changed

docs/development/creating-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ In your `api_name.h` file:
5050

5151
```cpp title='api_name.h'
5252

53-
#ifndef SHELL_BROWSER_API_ELECTRON_API_{API_NAME}_H_
54-
#define SHELL_BROWSER_API_ELECTRON_API_{API_NAME}_H_
53+
#ifndef ELECTRON_SHELL_BROWSER_API_ELECTRON_API_{API_NAME}_H_
54+
#define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_{API_NAME}_H_
5555

5656
#include "gin/handle.h"
5757
#include "gin/wrappable.h"

script/lint.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const klaw = require('klaw');
99
const minimist = require('minimist');
1010
const path = require('path');
1111

12-
const SOURCE_ROOT = path.normalize(path.dirname(__dirname));
13-
const DEPOT_TOOLS = path.resolve(SOURCE_ROOT, '..', 'third_party', 'depot_tools');
12+
const ELECTRON_ROOT = path.normalize(path.dirname(__dirname));
13+
const SOURCE_ROOT = path.resolve(ELECTRON_ROOT, '..');
14+
const DEPOT_TOOLS = path.resolve(SOURCE_ROOT, 'third_party', 'depot_tools');
1415

1516
const IGNORELIST = new Set([
1617
['shell', 'browser', 'resources', 'win', 'resource.h'],
@@ -19,7 +20,7 @@ const IGNORELIST = new Set([
1920
['spec', 'ts-smoke', 'electron', 'main.ts'],
2021
['spec', 'ts-smoke', 'electron', 'renderer.ts'],
2122
['spec', 'ts-smoke', 'runner.js']
22-
].map(tokens => path.join(SOURCE_ROOT, ...tokens)));
23+
].map(tokens => path.join(ELECTRON_ROOT, ...tokens)));
2324

2425
const IS_WINDOWS = process.platform === 'win32';
2526

@@ -101,7 +102,7 @@ const LINTERS = [{
101102
run: (opts, filenames) => {
102103
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc');
103104
const args = ['--rcfile=' + rcfile, ...filenames];
104-
const env = Object.assign({ PYTHONPATH: path.join(SOURCE_ROOT, 'script') }, process.env);
105+
const env = Object.assign({ PYTHONPATH: path.join(ELECTRON_ROOT, 'script') }, process.env);
105106
spawnAndCheckExitCode('pylint', args, { env });
106107
}
107108
}, {
@@ -142,7 +143,7 @@ const LINTERS = [{
142143
run: (opts, filenames) => {
143144
const allOk = filenames.map(filename => {
144145
const env = Object.assign({
145-
CHROMIUM_BUILDTOOLS_PATH: path.resolve(SOURCE_ROOT, '..', 'buildtools'),
146+
CHROMIUM_BUILDTOOLS_PATH: path.resolve(ELECTRON_ROOT, '..', 'buildtools'),
146147
DEPOT_TOOLS_WIN_TOOLCHAIN: '0'
147148
}, process.env);
148149
// Users may not have depot_tools in PATH.
@@ -277,7 +278,7 @@ async function findFiles (args, linter) {
277278

278279
// build the includelist
279280
if (args.changed) {
280-
includelist = await findChangedFiles(SOURCE_ROOT);
281+
includelist = await findChangedFiles(ELECTRON_ROOT);
281282
if (!includelist.size) {
282283
return [];
283284
}
@@ -287,12 +288,12 @@ async function findFiles (args, linter) {
287288

288289
// accumulate the raw list of files
289290
for (const root of linter.roots) {
290-
const files = await findMatchingFiles(path.join(SOURCE_ROOT, root), linter.test);
291+
const files = await findMatchingFiles(path.join(ELECTRON_ROOT, root), linter.test);
291292
filenames.push(...files);
292293
}
293294

294295
for (const ignoreRoot of (linter.ignoreRoots) || []) {
295-
const ignorePath = path.join(SOURCE_ROOT, ignoreRoot);
296+
const ignorePath = path.join(ELECTRON_ROOT, ignoreRoot);
296297
if (!fs.existsSync(ignorePath)) continue;
297298

298299
const ignoreFiles = new Set(await findMatchingFiles(ignorePath, linter.test));
@@ -310,7 +311,7 @@ async function findFiles (args, linter) {
310311
// it's important that filenames be relative otherwise clang-format will
311312
// produce patches with absolute paths in them, which `git apply` will refuse
312313
// to apply.
313-
return filenames.map(x => path.relative(SOURCE_ROOT, x));
314+
return filenames.map(x => path.relative(ELECTRON_ROOT, x));
314315
}
315316

316317
async function main () {

shell/app/command_line_args.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by the MIT license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_COMMAND_LINE_ARGS_H_
6-
#define SHELL_APP_COMMAND_LINE_ARGS_H_
5+
#ifndef ELECTRON_SHELL_APP_COMMAND_LINE_ARGS_H_
6+
#define ELECTRON_SHELL_APP_COMMAND_LINE_ARGS_H_
77

88
#include "base/command_line.h"
99

@@ -14,4 +14,4 @@ bool IsSandboxEnabled(base::CommandLine* command_line);
1414

1515
} // namespace electron
1616

17-
#endif // SHELL_APP_COMMAND_LINE_ARGS_H_
17+
#endif // ELECTRON_SHELL_APP_COMMAND_LINE_ARGS_H_

shell/app/electron_content_client.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by the MIT license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_ELECTRON_CONTENT_CLIENT_H_
6-
#define SHELL_APP_ELECTRON_CONTENT_CLIENT_H_
5+
#ifndef ELECTRON_SHELL_APP_ELECTRON_CONTENT_CLIENT_H_
6+
#define ELECTRON_SHELL_APP_ELECTRON_CONTENT_CLIENT_H_
77

88
#include <vector>
99

@@ -38,4 +38,4 @@ class ElectronContentClient : public content::ContentClient {
3838

3939
} // namespace electron
4040

41-
#endif // SHELL_APP_ELECTRON_CONTENT_CLIENT_H_
41+
#endif // ELECTRON_SHELL_APP_ELECTRON_CONTENT_CLIENT_H_

shell/app/electron_crash_reporter_client.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_
6-
#define SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_
5+
#ifndef ELECTRON_SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_
6+
#define ELECTRON_SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_
77

88
#include <map>
99
#include <string>
@@ -91,4 +91,4 @@ class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
9191
~ElectronCrashReporterClient() override;
9292
};
9393

94-
#endif // SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_
94+
#endif // ELECTRON_SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_

shell/app/electron_library_main.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by the MIT license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_ELECTRON_LIBRARY_MAIN_H_
6-
#define SHELL_APP_ELECTRON_LIBRARY_MAIN_H_
5+
#ifndef ELECTRON_SHELL_APP_ELECTRON_LIBRARY_MAIN_H_
6+
#define ELECTRON_SHELL_APP_ELECTRON_LIBRARY_MAIN_H_
77

88
#include "build/build_config.h"
99
#include "electron/buildflags/buildflags.h"
@@ -20,4 +20,4 @@ __attribute__((visibility("default"))) int ElectronInitializeICUandStartNode(
2020
}
2121
#endif // OS_MAC
2222

23-
#endif // SHELL_APP_ELECTRON_LIBRARY_MAIN_H_
23+
#endif // ELECTRON_SHELL_APP_ELECTRON_LIBRARY_MAIN_H_

shell/app/electron_main.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// Use of this source code is governed by the MIT license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_ELECTRON_MAIN_H_
6-
#define SHELL_APP_ELECTRON_MAIN_H_
5+
#ifndef ELECTRON_SHELL_APP_ELECTRON_MAIN_H_
6+
#define ELECTRON_SHELL_APP_ELECTRON_MAIN_H_
77

88
#include "content/public/app/content_main.h"
99

10-
#endif // SHELL_APP_ELECTRON_MAIN_H_
10+
#endif // ELECTRON_SHELL_APP_ELECTRON_MAIN_H_

shell/app/electron_main_delegate.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by the MIT license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
6-
#define SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
5+
#ifndef ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
6+
#define ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
77

88
#include <memory>
99
#include <string>
@@ -66,4 +66,4 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
6666

6767
} // namespace electron
6868

69-
#endif // SHELL_APP_ELECTRON_MAIN_DELEGATE_H_
69+
#endif // ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_H_

shell/app/electron_main_delegate_mac.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_
6-
#define SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_
5+
#ifndef ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_
6+
#define ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_
77

88
namespace electron {
99

@@ -12,4 +12,4 @@ void RegisterAtomCrApp();
1212

1313
} // namespace electron
1414

15-
#endif // SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_
15+
#endif // ELECTRON_SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_

shell/app/node_main.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Use of this source code is governed by the MIT license that can be
33
// found in the LICENSE file.
44

5-
#ifndef SHELL_APP_NODE_MAIN_H_
6-
#define SHELL_APP_NODE_MAIN_H_
5+
#ifndef ELECTRON_SHELL_APP_NODE_MAIN_H_
6+
#define ELECTRON_SHELL_APP_NODE_MAIN_H_
77

88
namespace electron {
99

1010
int NodeMain(int argc, char* argv[]);
1111

1212
} // namespace electron
1313

14-
#endif // SHELL_APP_NODE_MAIN_H_
14+
#endif // ELECTRON_SHELL_APP_NODE_MAIN_H_

0 commit comments

Comments
 (0)