This CL makes AddRef() and Release() const member methods and the refcount integer mutable. This is reasonable, because they only manage the lifetime of the object, and this is also how it's done in Chromium.
The purpose is to be able to capture a const pointer in a scoped_refptr, which is currenty impossible. The practial problem this CL solves is this:
void Foo::Bar() const {}
rtc::Callback0<void> Foo::MakeClosure() const {
return rtc::Bind(&Foo::Bar, this);
}
We currently capture |this| as const Foo*. With this CL, |this| will be captured as scoped_refptr<const Foo>.
A test is also added in bind_unittest to check this behaviour.
BUG=webrtc:5065
R=perkj@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1403683004 .
Cr-Commit-Position: refs/heads/master@{#10253}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1335923002
Cr-Commit-Position: refs/heads/master@{#9964}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
* DISALLOW_ASSIGN -> RTC_DISALLOW_ASSIGN
* DISALLOW_COPY_AND_ASSIGN -> RTC_DISALLOW_COPY_AND_ASSIGN
* DISALLOW_IMPLICIT_CONSTRUCTORS -> RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
Related CL: https://codereview.webrtc.org/1335923002/
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1345433002
Cr-Commit-Position: refs/heads/master@{#9953}
base/logging.h dumped to stderr by default in debug mode, but webrtc
"trace" (via system_wrappers/../logging.h) has that feature disabled by
default. This makes the two consistent.
Bonus: log the filename:line in base/logging.h, which exists in the
system_wrappers variant.
TEST=neteq_impl.cc logs (which use base/logging.h) no longer appear in
debug mode, unless --logs=true is passed. Filenames appear correctly.
Review URL: https://codereview.webrtc.org/1331503002
Cr-Commit-Position: refs/heads/master@{#9868}
This cl removes a lot of unused functionality in SystemInfo and reduces dependencies.
There's duplicate functionality in this class and WebRTC's CpuInfo class, so I'm consolidating the two implementations.
The CpuInfo interface will still exist since it's being used from Chrome to initialize the core count before the sandbox is engaged.
With this change, the SystemInfo class will get the benefit too of this initialization.
NOTRY=true
(using no try due to a dead android try bot)
Review URL: https://codereview.webrtc.org/1286163003
Cr-Commit-Position: refs/heads/master@{#9743}
Using explicit atomic operations permits TSan to understand them and
prevents false positives.
Downgrading the atomic Load to acquire semantics. This reduces the
number of memory barriers inserted from two down to one at most.
Also renaming Load/Store to AcquireLoad/ReleaseStore.
BUG=chromium:512382
R=dvyukov@chromium.org, glider@chromium.orgTBR=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1246073002
Cr-Commit-Position: refs/heads/master@{#9613}
Clang warns if there are missing braces around a subobject
initializer. The most common idiom that triggers this is:
STRUCT s = {0};
if the first field of STRUCT is itself a struct. This can
be more simply written as:
STRUCT s = {};
which also prevents the warning from firing.
Other instances of the warning have been fixed by adding
braces where appropriate.
BUG=505297
TBR=jiayl@webrtc.org
Review URL: https://codereview.webrtc.org/1216353002
Cr-Commit-Position: refs/heads/master@{#9529}
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)
BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1172163004
Cr-Commit-Position: refs/heads/master@{#9420}
Add pylintrc file based on
https://code.google.com/p/chromium/codesearch#chromium/src/tools/perf/pylintrc
bit tightened up quite a bit (the one in depot_tools is far
more relaxed).
Remove a few excluded directories from pylint check and fixed/
suppressed all warnings generated.
Add GN format check + formatted all GN files using 'gn format'.
Cleanup redundant rules in tools/PRESUBMIT.py
TESTED=Ran 'git cl presubmit -vv', fixed the PyLint violations.
Ran it again with a modification in webrtc/build/webrtc.gni, formatted
all the GN files and ran it again.
R=henrika@webrtc.org, phoglund@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/50069004
Cr-Commit-Position: refs/heads/master@{#9274}
Removes FixedSizeLockFreeQueue which isn't used anymore. This enabled
moving rtc::AtomicOps to webrtc/base/atomicops.h where they should be.
BUG=4330
R=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/51789004
Cr-Commit-Position: refs/heads/master@{#9120}
In days of yore, move.h contained complicated macros for approximating
move-only behavior in C++03. But since we live in the future now, and
can rely on C++11 features---including real move semantics!---it makes
more sense to just write the handful of required lines by hand in each
move-only class.
(We only live in the near future, though, not in some sci-fi
intergalactic civilization singularity type future, so we have to
define Pass() methods for these classes since we're not allowed to use
std::move().)
R=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/45099004
Cr-Commit-Position: refs/heads/master@{#9060}
Now that android_webview_build is no longer supported, remove build
conditionals referencing it and also remove the extra level of
indirection used to reference the cpufeatures target.
BUG=chromium:440793
R=henrika@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/44119005
Patch from Richard Coles <torne@chromium.org>.
Cr-Commit-Position: refs/heads/master@{#8963}
This reverts commit cf3c83e76c273309558c86fda915410f65b7a899.
Reverting EventWrapper split did not fix the issue, re-landing.
BUG=chromium:470013
TBR=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/49629004
Cr-Commit-Position: refs/heads/master@{#8946}
This reverts commit 9509fbfc301dd5412804ce5731afedc81480f2f8.
This is to debug a Chromium issue that WebRTC hangs if there is > 1 PeerConnection active in the browser on Win XP.
BUG=
TBR=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43019004
Cr-Commit-Position: refs/heads/master@{#8912}
I'm splitting the timer functions in EventWrapper into a separate interface.
- Users of the timer functions have different needs than users of a generic event
- Providing a default implementation for EventWrapper that simply uses rtc::Event.
This means that clients of WebRTC that don't use the relatively few classes, typically rendering classes, that depend on the event timer functionality, also don't pull in dependencies on multimedia timers.
R=mflodman@webrtc.org, mflodman
BUG=
Review URL: https://webrtc-codereview.appspot.com/48599004
Cr-Commit-Position: refs/heads/master@{#8833}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8833 4adac7df-926f-26a2-2b94-8c16560cd09d
pthread_cond_{timedwait,wait} are allowed to spuriously wake up as if
they were signaled. To prevent this being interpreted as a "real"
signaling of the event (ThreadWrapper for instance depends on it being
an actual signal) we need to check whether the event was actually
signalled or not.
BUG=4413
R=andresp@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/49369004
Cr-Commit-Position: refs/heads/master@{#8752}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8752 4adac7df-926f-26a2-2b94-8c16560cd09d
Removes ThreadPosix::InitParams and a corresponding wait for an event.
This unblocks ThreadPosix::Start which had to wait for thread scheduling
for an event to trigger on the spawned thread, giving faster Start()
calls.
BUG=4413
R=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43699004
Cr-Commit-Position: refs/heads/master@{#8709}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8709 4adac7df-926f-26a2-2b94-8c16560cd09d
Clang version changed 223108:230914
Details: e144d30..6fdb142/tools/clang/scripts/update.sh
Removes the OVERRIDE macro defined in:
* webrtc/base/common.h
* webrtc/typedefs.h
The majority of the source changes were done by running this in src/:
perl -0pi -e "s/virtual\s([^({;]*(\([^({;]*\)[^({;]*))(OVERRIDE|override)/\1override/sg" `find {talk,webrtc} -name "*.h" -o -name "*.cc*" -o -name "*.mm*"`
which converted all:
virtual Foo() OVERRIDE
functions to:
Foo() override
Then I manually edited:
* talk/media/webrtc/fakewebrtccommon.h
* webrtc/test/fake_common.h
Remaining uses of OVERRIDE was fixed by search+replace.
Manual edits were done to fix virtual destructors that were
overriding inherited ones.
Finally a build error related to the pure virtual definitions of
Read, Write and Rewind in common_types.h required a bit of
refactoring in:
* webrtc/common_types.cc
* webrtc/common_types.h
* webrtc/system_wrappers/interface/file_wrapper.h
* webrtc/system_wrappers/source/file_impl.cc
This roll should make it possible for us to finally re-enable deadlock
detection for TSan on the buildbots.
BUG=4106
R=pbos@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/41069004
Cr-Commit-Position: refs/heads/master@{#8596}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8596 4adac7df-926f-26a2-2b94-8c16560cd09d
Mostly, it's about moving constructors and descructors to the .cc
files, so that they won't be inlined everywhere.
The reason this CL is so big is that a lot of code was using
common_types.h without declaring a dependency on webrtc_common, which
broke the build once common_types.h started to depend on
common_types.cc.
BUG=163
R=kjellander@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/26089004
Cr-Commit-Position: refs/heads/master@{#8516}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8516 4adac7df-926f-26a2-2b94-8c16560cd09d