Make CEF compliant with Google/Chromium style (issue #473).

- Add a new check_style tool based on Google's cpplint that can be used to verify compliance of pending changes and specific files/directories.
- Update existing CEF source code to be compliant with the style requirements.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@463 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-01-09 23:46:23 +00:00
parent 9cc61f448b
commit 1073577d03
558 changed files with 9002 additions and 10977 deletions

View File

@ -9,16 +9,13 @@
namespace {
class CefCommandLineImpl : public CefCommandLine
{
public:
class CefCommandLineImpl : public CefCommandLine {
public:
CefCommandLineImpl()
: command_line_(CommandLine::NO_PROGRAM)
{
: command_line_(CommandLine::NO_PROGRAM) {
}
virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE
{
virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE {
#if !defined(OS_WIN)
AutoLock lock_scope(this);
command_line_.InitFromArgv(argc, argv);
@ -27,8 +24,7 @@ public:
#endif
}
virtual void InitFromString(const CefString& command_line) OVERRIDE
{
virtual void InitFromString(const CefString& command_line) OVERRIDE {
#if defined(OS_WIN)
AutoLock lock_scope(this);
command_line_.ParseFromString(command_line);
@ -37,44 +33,37 @@ public:
#endif
}
virtual CefString GetCommandLineString() OVERRIDE
{
virtual CefString GetCommandLineString() OVERRIDE {
AutoLock lock_scope(this);
return command_line_.GetCommandLineString();
}
virtual CefString GetProgram() OVERRIDE
{
virtual CefString GetProgram() OVERRIDE {
AutoLock lock_scope(this);
return command_line_.GetProgram().value();
}
virtual void SetProgram(const CefString& program) OVERRIDE
{
virtual void SetProgram(const CefString& program) OVERRIDE {
AutoLock lock_scope(this);
command_line_.SetProgram(FilePath(program));
}
virtual bool HasSwitches() OVERRIDE
{
virtual bool HasSwitches() OVERRIDE {
AutoLock lock_scope(this);
return (command_line_.GetSwitches().size() > 0);
}
virtual bool HasSwitch(const CefString& name) OVERRIDE
{
virtual bool HasSwitch(const CefString& name) OVERRIDE {
AutoLock lock_scope(this);
return command_line_.HasSwitch(name);
}
virtual CefString GetSwitchValue(const CefString& name) OVERRIDE
{
virtual CefString GetSwitchValue(const CefString& name) OVERRIDE {
AutoLock lock_scope(this);
return command_line_.GetSwitchValueNative(name);
}
virtual void GetSwitches(SwitchMap& switches) OVERRIDE
{
virtual void GetSwitches(SwitchMap& switches) OVERRIDE {
AutoLock lock_scope(this);
const CommandLine::SwitchMap& map = command_line_.GetSwitches();
CommandLine::SwitchMap::const_iterator it = map.begin();
@ -82,27 +71,23 @@ public:
switches.insert(std::make_pair(it->first, it->second));
}
virtual void AppendSwitch(const CefString& name) OVERRIDE
{
virtual void AppendSwitch(const CefString& name) OVERRIDE {
AutoLock lock_scope(this);
command_line_.AppendSwitch(name);
}
virtual void AppendSwitchWithValue(const CefString& name,
const CefString& value) OVERRIDE
{
const CefString& value) OVERRIDE {
AutoLock lock_scope(this);
command_line_.AppendSwitchNative(name, value);
}
virtual bool HasArguments() OVERRIDE
{
virtual bool HasArguments() OVERRIDE {
AutoLock lock_scope(this);
return (command_line_.GetArgs().size() > 0);
}
virtual void GetArguments(ArgumentList& arguments) OVERRIDE
{
virtual void GetArguments(ArgumentList& arguments) OVERRIDE {
AutoLock lock_scope(this);
const CommandLine::StringVector& vec = command_line_.GetArgs();
CommandLine::StringVector::const_iterator it = vec.begin();
@ -110,23 +95,21 @@ public:
arguments.push_back(*it);
}
virtual void AppendArgument(const CefString& argument) OVERRIDE
{
virtual void AppendArgument(const CefString& argument) OVERRIDE {
AutoLock lock_scope(this);
command_line_.AppendArgNative(argument);
}
private:
private:
CommandLine command_line_;
IMPLEMENT_REFCOUNTING(CefCommandLineImpl);
IMPLEMENT_LOCKING(CefCommandLineImpl);
};
} // namespace
} // namespace
// static
CefRefPtr<CefCommandLine> CefCommandLine::CreateCommandLine()
{
CefRefPtr<CefCommandLine> CefCommandLine::CreateCommandLine() {
return new CefCommandLineImpl();
}