Skip to content

Commit

Permalink
Fixing WebRTC after moving from src/webrtc to src/
Browse files Browse the repository at this point in the history
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
[email protected]


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <[email protected]>
Reviewed-by: Henrik Kjellander <[email protected]>
Commit-Queue: Mirko Bonadei <[email protected]>
Cr-Commit-Position: refs/heads/master@{#19846}
  • Loading branch information
MirkoBonadei authored and Commit Bot committed Sep 15, 2017
1 parent bb54720 commit 92ea95e
Show file tree
Hide file tree
Showing 3,635 changed files with 19,738 additions and 19,691 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
/tools_webrtc/video_quality_toolchain/mac/zxing
/tools_webrtc/video_quality_toolchain/win/*.dll
/tools_webrtc/video_quality_toolchain/win/*.exe
/webrtc/rtc_tools/testing/*.zip
/webrtc/rtc_tools/testing/*.gz
/webrtc/rtc_tools/testing/golang/*/*.gz
/webrtc/rtc_tools/testing/golang/*/*.zip
/rtc_tools/testing/*.zip
/rtc_tools/testing/*.gz
/rtc_tools/testing/golang/*/*.gz
/rtc_tools/testing/golang/*/*.zip
/x86-generic_out/
/xcodebuild
24 changes: 23 additions & 1 deletion .gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,29 @@ secondary_source = "//build/secondary/"
# matching these patterns (see "gn help label_pattern" for format) will have
# their includes checked for proper dependencies when you run either
# "gn check" or "gn gen --check".
check_targets = [ "//webrtc/*" ]
check_targets = [
"//api/*",
"//audio/*",
"//backup/*",
"//call/*",
"//common_audio/*",
"//common_video/*",
"//examples/*",
"//logging/*",
"//media/*",
"//modules/*",
"//ortc/*",
"//p2p/*",
"//pc/*",
"//rtc_base/*",
"//rtc_tools/*",
"//sdk/*",
"//stats/*",
"//system_wrappers/*",
"//test/*",
"//video/*",
"//voice_engine/*",
]

# These are the list of GN files that run exec_script. This whitelist exists
# to force additional review for new uses of exec_script, which is strongly
Expand Down
30 changes: 15 additions & 15 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ if (rtc_include_tests) {

# TODO(pbos): Rename test suite, this is no longer "just" for video targets.
video_engine_tests_resources = [
"../resources/foreman_cif_short.yuv",
"../resources/voice_engine/audio_long16.pcm",
"resources/foreman_cif_short.yuv",
"resources/voice_engine/audio_long16.pcm",
]

if (is_ios) {
Expand Down Expand Up @@ -475,19 +475,19 @@ if (rtc_include_tests) {
}

webrtc_perf_tests_resources = [
"../resources/audio_coding/speech_mono_16kHz.pcm",
"../resources/audio_coding/speech_mono_32_48kHz.pcm",
"../resources/audio_coding/testfile32kHz.pcm",
"../resources/ConferenceMotion_1280_720_50.yuv",
"../resources/difficult_photo_1850_1110.yuv",
"../resources/foreman_cif.yuv",
"../resources/google-wifi-3mbps.rx",
"../resources/paris_qcif.yuv",
"../resources/photo_1850_1110.yuv",
"../resources/presentation_1850_1110.yuv",
"../resources/verizon4g-downlink.rx",
"../resources/voice_engine/audio_long16.pcm",
"../resources/web_screenshot_1850_1110.yuv",
"resources/audio_coding/speech_mono_16kHz.pcm",
"resources/audio_coding/speech_mono_32_48kHz.pcm",
"resources/audio_coding/testfile32kHz.pcm",
"resources/ConferenceMotion_1280_720_50.yuv",
"resources/difficult_photo_1850_1110.yuv",
"resources/foreman_cif.yuv",
"resources/google-wifi-3mbps.rx",
"resources/paris_qcif.yuv",
"resources/photo_1850_1110.yuv",
"resources/presentation_1850_1110.yuv",
"resources/verizon4g-downlink.rx",
"resources/voice_engine/audio_long16.pcm",
"resources/web_screenshot_1850_1110.yuv",
]

if (is_ios) {
Expand Down
26 changes: 13 additions & 13 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ deps_os = {
'src/third_party/ub-uiautomator/lib':
Var('chromium_git') + '/chromium/third_party/ub-uiautomator.git' + '@' + '00270549ce3161ae72ceb24712618ea28b4f9434',
# Gradle 3.5.0. Used for testing Android Studio project generation for WebRTC.
'src/webrtc/examples/androidtests/third_party/gradle':
'src/examples/androidtests/third_party/gradle':
Var('chromium_git') + '/external/github.com/gradle/gradle.git' + '@' +
'941559e020f6c357ebb08d5c67acdb858a3defc2',
},
Expand Down Expand Up @@ -554,26 +554,26 @@ include_rules = [
"+libyuv",
"-webrtc", # Has to be disabled; otherwise all dirs below will be allowed.
# Individual headers that will be moved out of here, see webrtc:4243.
"+webrtc/call/rtp_config.h",
"+webrtc/common_types.h",
"+webrtc/transport.h",
"+webrtc/typedefs.h",
"+webrtc/voice_engine_configurations.h",
"+call/rtp_config.h",
"+common_types.h",
"+transport.h",
"+typedefs.h",
"+voice_engine_configurations.h",

"+WebRTC",
"+webrtc/api",
"+webrtc/modules/include",
"+webrtc/rtc_base",
"+webrtc/test",
"+webrtc/rtc_tools",
"+api",
"+modules/include",
"+rtc_base",
"+test",
"+rtc_tools",
]

# The below rules will be removed when webrtc:4243 is fixed.
specific_include_rules = {
"video_receive_stream\.h": [
"+webrtc/call/video_receive_stream.h",
"+call/video_receive_stream.h",
],
"video_send_stream\.h": [
"+webrtc/call/video_send_stream.h",
"+call/video_send_stream.h",
],
}
139 changes: 82 additions & 57 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@

# Files and directories that are *skipped* by cpplint in the presubmit script.
CPPLINT_BLACKLIST = [
'api/video_codecs/video_decoder.h',
'common_types.cc',
'common_types.h',
'examples/objc',
'media',
'modules/audio_coding',
'modules/audio_conference_mixer',
'modules/audio_device',
'modules/audio_processing',
'modules/desktop_capture',
'modules/include/module_common_types.h',
'modules/media_file',
'modules/utility',
'modules/video_capture',
'p2p',
'pc',
'rtc_base',
'sdk/android/src/jni',
'sdk/objc',
'system_wrappers',
'test',
'tools_webrtc',
'webrtc/api/video_codecs/video_decoder.h',
'webrtc/examples/objc',
'webrtc/media',
'webrtc/modules/audio_coding',
'webrtc/modules/audio_conference_mixer',
'webrtc/modules/audio_device',
'webrtc/modules/audio_processing',
'webrtc/modules/desktop_capture',
'webrtc/modules/include/module_common_types.h',
'webrtc/modules/media_file',
'webrtc/modules/utility',
'webrtc/modules/video_capture',
'webrtc/p2p',
'webrtc/pc',
'webrtc/rtc_base',
'webrtc/sdk/android/src/jni',
'webrtc/sdk/objc',
'webrtc/system_wrappers',
'webrtc/test',
'webrtc/voice_engine',
'webrtc/common_types.h',
'webrtc/common_types.cc',
'voice_engine',
]

# These filters will always be removed, even if the caller specifies a filter
Expand All @@ -62,34 +62,33 @@
# [email protected] (internal list).
# 4. (later) The deprecated APIs are removed.
NATIVE_API_DIRS = (
'webrtc',
'webrtc/api',
'webrtc/media',
'webrtc/modules/audio_device/include',
'webrtc/pc',
'api',
'media',
'modules/audio_device/include',
'pc',
)
# These directories should not be used but are maintained only to avoid breaking
# some legacy downstream code.
LEGACY_API_DIRS = (
'webrtc/common_audio/include',
'webrtc/modules/audio_coding/include',
'webrtc/modules/audio_conference_mixer/include',
'webrtc/modules/audio_processing/include',
'webrtc/modules/bitrate_controller/include',
'webrtc/modules/congestion_controller/include',
'webrtc/modules/include',
'webrtc/modules/remote_bitrate_estimator/include',
'webrtc/modules/rtp_rtcp/include',
'webrtc/modules/rtp_rtcp/source',
'webrtc/modules/utility/include',
'webrtc/modules/video_coding/codecs/h264/include',
'webrtc/modules/video_coding/codecs/i420/include',
'webrtc/modules/video_coding/codecs/vp8/include',
'webrtc/modules/video_coding/codecs/vp9/include',
'webrtc/modules/video_coding/include',
'webrtc/rtc_base',
'webrtc/system_wrappers/include',
'webrtc/voice_engine/include',
'common_audio/include',
'modules/audio_coding/include',
'modules/audio_conference_mixer/include',
'modules/audio_processing/include',
'modules/bitrate_controller/include',
'modules/congestion_controller/include',
'modules/include',
'modules/remote_bitrate_estimator/include',
'modules/rtp_rtcp/include',
'modules/rtp_rtcp/source',
'modules/utility/include',
'modules/video_coding/codecs/h264/include',
'modules/video_coding/codecs/i420/include',
'modules/video_coding/codecs/vp8/include',
'modules/video_coding/codecs/vp9/include',
'modules/video_coding/include',
'rtc_base',
'system_wrappers/include',
'voice_engine/include',
)
API_DIRS = NATIVE_API_DIRS[:] + LEGACY_API_DIRS[:]

Expand Down Expand Up @@ -331,8 +330,7 @@ def CheckNoPackageBoundaryViolations(input_api, gn_files, output_api):
cwd = input_api.PresubmitLocalPath()
script_path = os.path.join('tools_webrtc', 'presubmit_checks_lib',
'check_package_boundaries.py')
webrtc_path = os.path.join('webrtc')
command = [sys.executable, script_path, webrtc_path]
command = [sys.executable, script_path]
command += [gn_file.LocalPath() for gn_file in gn_files]
returncode, _, stderr = _RunCommand(command, cwd)
if returncode:
Expand All @@ -347,8 +345,7 @@ def CheckGnChanges(input_api, output_api):

gn_files = []
for f in input_api.AffectedSourceFiles(source_file_filter):
if f.LocalPath().startswith('webrtc'):
gn_files.append(f)
gn_files.append(f)

result = []
if gn_files:
Expand Down Expand Up @@ -494,9 +491,9 @@ def Join(*args):

test_directories = [
input_api.PresubmitLocalPath(),
Join('webrtc', 'rtc_tools', 'py_event_log_analyzer'),
Join('webrtc', 'rtc_tools'),
Join('webrtc', 'audio', 'test', 'unittests'),
Join('rtc_tools', 'py_event_log_analyzer'),
Join('rtc_tools'),
Join('audio', 'test', 'unittests'),
] + [
root for root, _, files in os.walk(Join('tools_webrtc'))
if any(f.endswith('_test.py') for f in files)
Expand All @@ -517,7 +514,7 @@ def CheckUsageOfGoogleProtobufNamespace(input_api, output_api):
"""Checks that the namespace google::protobuf has not been used."""
files = []
pattern = input_api.re.compile(r'google::protobuf')
proto_utils_path = os.path.join('webrtc', 'rtc_base', 'protobuf_utils.h')
proto_utils_path = os.path.join('rtc_base', 'protobuf_utils.h')
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
if f.LocalPath() in [proto_utils_path, 'PRESUBMIT.py']:
continue
Expand All @@ -533,6 +530,28 @@ def CheckUsageOfGoogleProtobufNamespace(input_api, output_api):
return []


def _LicenseHeader(input_api):
"""Returns the license header regexp."""
# Accept any year number from 2003 to the current year
current_year = int(input_api.time.strftime('%Y'))
allowed_years = (str(s) for s in reversed(xrange(2003, current_year + 1)))
years_re = '(' + '|'.join(allowed_years) + ')'
license_header = (
r'.*? Copyright( \(c\))? %(year)s The WebRTC [Pp]roject [Aa]uthors\. '
r'All [Rr]ights [Rr]eserved\.\n'
r'.*?\n'
r'.*? Use of this source code is governed by a BSD-style license\n'
r'.*? that can be found in the LICENSE file in the root of the source\n'
r'.*? tree\. An additional intellectual property rights grant can be '
r'found\n'
r'.*? in the file PATENTS\. All contributing project authors may\n'
r'.*? be found in the AUTHORS file in the root of the source tree\.\n'
) % {
'year': years_re,
}
return license_header


def CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
Expand All @@ -541,11 +560,12 @@ def CommonChecks(input_api, output_api):
black_list = input_api.DEFAULT_BLACK_LIST + (
r".*\bobjc[\\\/].*",
r".*objc\.[hcm]+$",
r"webrtc\/build\/ios\/SDK\/.*",
)
source_file_filter = lambda x: input_api.FilterSourceFile(x, None, black_list)
results.extend(CheckApprovedFilesLintClean(
input_api, output_api, source_file_filter))
results.extend(input_api.canned_checks.CheckLicense(
input_api, output_api, _LicenseHeader(input_api)))
results.extend(input_api.canned_checks.RunPylint(input_api, output_api,
black_list=(r'^base[\\\/].*\.py$',
r'^build[\\\/].*\.py$',
Expand Down Expand Up @@ -599,8 +619,13 @@ def CommonChecks(input_api, output_api):
results.extend(CheckJSONParseErrors(input_api, output_api))
results.extend(RunPythonTests(input_api, output_api))
results.extend(CheckUsageOfGoogleProtobufNamespace(input_api, output_api))
results.extend(CheckOrphanHeaders(input_api, output_api))
results.extend(CheckNewLineAtTheEndOfProtoFiles(input_api, output_api))
# TODO(mbonadei): re-enable after the migration from src/webrtc to src/
# in order to avoid to trigger an error for each orphan header (we are
# moving all of them).
# results.extend(CheckOrphanHeaders(input_api, output_api))
# TODO(mbonadei): check before re-enable because it seems it is reporting
# some false positives.
# results.extend(CheckNewLineAtTheEndOfProtoFiles(input_api, output_api))
return results


Expand Down
Loading

0 comments on commit 92ea95e

Please sign in to comment.