Commit d70dc5ae authored by limasdf's avatar limasdf Committed by Commit bot

Cleanup: cpplint from /extensions

 * Fix wrong header guard.
 * Remove or add explicit constructor
 * Remove unwanted semicolon

BUG=None

Review URL: https://codereview.chromium.org/563263002

Cr-Commit-Position: refs/heads/master@{#294700}
parent d693c730
...@@ -22,7 +22,7 @@ typedef std::deque<const ExtensionError*> ErrorList; ...@@ -22,7 +22,7 @@ typedef std::deque<const ExtensionError*> ErrorList;
// destruction. // destruction.
class ErrorMap { class ErrorMap {
public: public:
explicit ErrorMap(); ErrorMap();
~ErrorMap(); ~ErrorMap();
// Return the list of all errors associated with the given extension. // Return the list of all errors associated with the given extension.
...@@ -48,7 +48,7 @@ class ErrorMap { ...@@ -48,7 +48,7 @@ class ErrorMap {
// that Extension. // that Extension.
class ExtensionEntry { class ExtensionEntry {
public: public:
explicit ExtensionEntry(); ExtensionEntry();
~ExtensionEntry(); ~ExtensionEntry();
// Delete all errors associated with this extension. // Delete all errors associated with this extension.
......
...@@ -12,4 +12,4 @@ GrantedFileEntry::GrantedFileEntry() { ...@@ -12,4 +12,4 @@ GrantedFileEntry::GrantedFileEntry() {
GrantedFileEntry::~GrantedFileEntry() { GrantedFileEntry::~GrantedFileEntry() {
} }
} // namespace extension } // namespace extensions
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef EXTENSIONS_BROWSER_MOCK_EXTENSIONS_SYSTEM_H_ #ifndef EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_
#define EXTENSIONS_BROWSER_MOCK_EXTENSIONS_SYSTEM_H_ #define EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_registry_factory.h" #include "extensions/browser/extension_registry_factory.h"
...@@ -92,4 +92,4 @@ class MockExtensionSystemFactory : public ExtensionSystemProvider { ...@@ -92,4 +92,4 @@ class MockExtensionSystemFactory : public ExtensionSystemProvider {
} // namespace extensions } // namespace extensions
#endif // EXTENSIONS_BROWSER_MOCK_EXTENSIONS_SYSTEM_H_ #endif // EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTION_OBSERVER_H_ #ifndef EXTENSIONS_BROWSER_SCRIPT_EXECUTION_OBSERVER_H_
#define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTION_OBSERVER_H_ #define EXTENSIONS_BROWSER_SCRIPT_EXECUTION_OBSERVER_H_
#include <map> #include <map>
#include <set> #include <set>
...@@ -41,4 +41,4 @@ class ScriptExecutionObserver { ...@@ -41,4 +41,4 @@ class ScriptExecutionObserver {
} // namespace extensions } // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTION_OBSERVER_H_ #endif // EXTENSIONS_BROWSER_SCRIPT_EXECUTION_OBSERVER_H_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ #ifndef EXTENSIONS_BROWSER_SCRIPT_EXECUTOR_H_
#define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ #define EXTENSIONS_BROWSER_SCRIPT_EXECUTOR_H_
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/observer_list.h" #include "base/observer_list.h"
...@@ -110,4 +110,4 @@ class ScriptExecutor { ...@@ -110,4 +110,4 @@ class ScriptExecutor {
} // namespace extensions } // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ #endif // EXTENSIONS_BROWSER_SCRIPT_EXECUTOR_H_
...@@ -11,7 +11,8 @@ namespace extensions { ...@@ -11,7 +11,8 @@ namespace extensions {
class TestExtensionRegistryObserver::Waiter { class TestExtensionRegistryObserver::Waiter {
public: public:
Waiter(const std::string& extension_id) : observed_(false), runner_(NULL) {} explicit Waiter(const std::string& extension_id)
: observed_(false), runner_(NULL) {}
void Wait() { void Wait() {
if (observed_) if (observed_)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef EXENSIONS_BROWSER_TEST_RUNTIME_API_DELEGATE_H_ #ifndef EXTENSIONS_BROWSER_TEST_RUNTIME_API_DELEGATE_H_
#define EXENSIONS_BROWSER_TEST_RUNTIME_API_DELEGATE_H_ #define EXTENSIONS_BROWSER_TEST_RUNTIME_API_DELEGATE_H_
#include "base/macros.h" #include "base/macros.h"
#include "extensions/browser/api/runtime/runtime_api_delegate.h" #include "extensions/browser/api/runtime/runtime_api_delegate.h"
...@@ -33,4 +33,4 @@ class TestRuntimeAPIDelegate : public RuntimeAPIDelegate { ...@@ -33,4 +33,4 @@ class TestRuntimeAPIDelegate : public RuntimeAPIDelegate {
} // namespace extensions } // namespace extensions
#endif // EXENSIONS_BROWSER_TEST_RUNTIME_API_DELEGATE_H_ #endif // EXTENSIONS_BROWSER_TEST_RUNTIME_API_DELEGATE_H_
...@@ -24,6 +24,6 @@ enum UninstallReason { ...@@ -24,6 +24,6 @@ enum UninstallReason {
UNINSTALL_REASON_INTERNAL_MANAGEMENT // Internal extensions (see usages) UNINSTALL_REASON_INTERNAL_MANAGEMENT // Internal extensions (see usages)
}; };
} // extensions } // namespace extensions
#endif // EXTENSIONS_BROWSER_UNINSTALL_REASON_H_ #endif // EXTENSIONS_BROWSER_UNINSTALL_REASON_H_
...@@ -55,8 +55,6 @@ class VerifiedContents { ...@@ -55,8 +55,6 @@ class VerifiedContents {
bool valid_signature() { return valid_signature_; } bool valid_signature() { return valid_signature_; }
private: private:
DISALLOW_COPY_AND_ASSIGN(VerifiedContents);
// Returns the base64url-decoded "payload" field from the json at |path|, if // Returns the base64url-decoded "payload" field from the json at |path|, if
// the signature was valid (or ignore_invalid_signature was set to true). // the signature was valid (or ignore_invalid_signature was set to true).
bool GetPayload(const base::FilePath& path, bool GetPayload(const base::FilePath& path,
...@@ -87,6 +85,8 @@ class VerifiedContents { ...@@ -87,6 +85,8 @@ class VerifiedContents {
// The expected treehash root hashes for each file. // The expected treehash root hashes for each file.
std::map<base::FilePath, std::string> root_hashes_; std::map<base::FilePath, std::string> root_hashes_;
DISALLOW_COPY_AND_ASSIGN(VerifiedContents);
}; };
} // namespace extensions } // namespace extensions
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
class UpdateManifest { class UpdateManifest {
public: public:
// An update manifest looks like this: // An update manifest looks like this:
// //
// <?xml version="1.0" encoding="UTF-8"?> // <?xml version="1.0" encoding="UTF-8"?>
......
...@@ -54,7 +54,7 @@ TEST(ExtensionURLPatternTest, ParseInvalid) { ...@@ -54,7 +54,7 @@ TEST(ExtensionURLPatternTest, ParseInvalid) {
pattern.Parse(null_host)) pattern.Parse(null_host))
<< null_host; << null_host;
} }
}; }
TEST(ExtensionURLPatternTest, Ports) { TEST(ExtensionURLPatternTest, Ports) {
const struct { const struct {
...@@ -91,7 +91,7 @@ TEST(ExtensionURLPatternTest, Ports) { ...@@ -91,7 +91,7 @@ TEST(ExtensionURLPatternTest, Ports) {
EXPECT_EQ(kTestPatterns[i].expected_port, pattern.port()) EXPECT_EQ(kTestPatterns[i].expected_port, pattern.port())
<< "Got unexpected port for URL pattern: " << kTestPatterns[i].pattern; << "Got unexpected port for URL pattern: " << kTestPatterns[i].pattern;
} }
}; }
// all pages for a given scheme // all pages for a given scheme
TEST(ExtensionURLPatternTest, Match1) { TEST(ExtensionURLPatternTest, Match1) {
...@@ -184,7 +184,7 @@ TEST(ExtensionURLPatternTest, Match7) { ...@@ -184,7 +184,7 @@ TEST(ExtensionURLPatternTest, Match7) {
EXPECT_EQ("/*", pattern.path()); EXPECT_EQ("/*", pattern.path());
// Subdomain matching is never done if the argument has an IP address host. // Subdomain matching is never done if the argument has an IP address host.
EXPECT_FALSE(pattern.MatchesURL(GURL("http://127.0.0.1"))); EXPECT_FALSE(pattern.MatchesURL(GURL("http://127.0.0.1")));
}; }
// unicode // unicode
TEST(ExtensionURLPatternTest, Match8) { TEST(ExtensionURLPatternTest, Match8) {
...@@ -202,7 +202,7 @@ TEST(ExtensionURLPatternTest, Match8) { ...@@ -202,7 +202,7 @@ TEST(ExtensionURLPatternTest, Match8) {
GURL("http://abc.\xe1\x80\xbf/a\xc2\x81\xe1xyz"))); GURL("http://abc.\xe1\x80\xbf/a\xc2\x81\xe1xyz")));
EXPECT_TRUE(pattern.MatchesURL( EXPECT_TRUE(pattern.MatchesURL(
GURL("http://\xe1\x80\xbf/a\xc2\x81\xe1\xe1"))); GURL("http://\xe1\x80\xbf/a\xc2\x81\xe1\xe1")));
}; }
// chrome:// // chrome://
TEST(ExtensionURLPatternTest, Match9) { TEST(ExtensionURLPatternTest, Match9) {
...@@ -216,7 +216,7 @@ TEST(ExtensionURLPatternTest, Match9) { ...@@ -216,7 +216,7 @@ TEST(ExtensionURLPatternTest, Match9) {
EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com"))); EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com")));
EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/https://google.com"))); EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/https://google.com")));
EXPECT_FALSE(pattern.MatchesURL(GURL("chrome://history"))); EXPECT_FALSE(pattern.MatchesURL(GURL("chrome://history")));
}; }
// *:// // *://
TEST(ExtensionURLPatternTest, Match10) { TEST(ExtensionURLPatternTest, Match10) {
...@@ -234,7 +234,7 @@ TEST(ExtensionURLPatternTest, Match10) { ...@@ -234,7 +234,7 @@ TEST(ExtensionURLPatternTest, Match10) {
EXPECT_FALSE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com"))); EXPECT_FALSE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com")));
EXPECT_FALSE(pattern.MatchesURL(GURL("file:///foo/bar"))); EXPECT_FALSE(pattern.MatchesURL(GURL("file:///foo/bar")));
EXPECT_FALSE(pattern.MatchesURL(GURL("file://localhost/foo/bar"))); EXPECT_FALSE(pattern.MatchesURL(GURL("file://localhost/foo/bar")));
}; }
// <all_urls> // <all_urls>
TEST(ExtensionURLPatternTest, Match11) { TEST(ExtensionURLPatternTest, Match11) {
...@@ -266,7 +266,7 @@ TEST(ExtensionURLPatternTest, Match11) { ...@@ -266,7 +266,7 @@ TEST(ExtensionURLPatternTest, Match11) {
EXPECT_EQ(pattern.scheme(), pattern2.scheme()); EXPECT_EQ(pattern.scheme(), pattern2.scheme());
EXPECT_EQ(pattern.port(), pattern2.port()); EXPECT_EQ(pattern.port(), pattern2.port());
EXPECT_EQ(pattern.GetAsString(), pattern2.GetAsString()); EXPECT_EQ(pattern.GetAsString(), pattern2.GetAsString());
}; }
// SCHEME_ALL matches all schemes. // SCHEME_ALL matches all schemes.
TEST(ExtensionURLPatternTest, Match12) { TEST(ExtensionURLPatternTest, Match12) {
...@@ -293,7 +293,7 @@ TEST(ExtensionURLPatternTest, Match12) { ...@@ -293,7 +293,7 @@ TEST(ExtensionURLPatternTest, Match12) {
EXPECT_TRUE(pattern.MatchesURL(GURL("about:version"))); EXPECT_TRUE(pattern.MatchesURL(GURL("about:version")));
EXPECT_TRUE(pattern.MatchesURL( EXPECT_TRUE(pattern.MatchesURL(
GURL("data:text/html;charset=utf-8,<html>asdf</html>"))); GURL("data:text/html;charset=utf-8,<html>asdf</html>")));
}; }
static const struct MatchPatterns { static const struct MatchPatterns {
const char* pattern; const char* pattern;
...@@ -323,7 +323,7 @@ TEST(ExtensionURLPatternTest, Match13) { ...@@ -323,7 +323,7 @@ TEST(ExtensionURLPatternTest, Match13) {
URLPattern pattern(URLPattern::SCHEME_ALL); URLPattern pattern(URLPattern::SCHEME_ALL);
EXPECT_EQ(URLPattern::PARSE_SUCCESS, pattern.Parse("data:*")); EXPECT_EQ(URLPattern::PARSE_SUCCESS, pattern.Parse("data:*"));
EXPECT_FALSE(pattern.MatchesURL(GURL("about:blank"))); EXPECT_FALSE(pattern.MatchesURL(GURL("about:blank")));
}; }
// file scheme with empty hostname // file scheme with empty hostname
TEST(ExtensionURLPatternTest, Match14) { TEST(ExtensionURLPatternTest, Match14) {
...@@ -430,7 +430,7 @@ TEST(ExtensionURLPatternTest, Match19) { ...@@ -430,7 +430,7 @@ TEST(ExtensionURLPatternTest, Match19) {
EXPECT_FALSE(pattern.MatchesURL(GURL("chrome-extension://foobar"))); EXPECT_FALSE(pattern.MatchesURL(GURL("chrome-extension://foobar")));
EXPECT_TRUE(pattern.MatchesURL( EXPECT_TRUE(pattern.MatchesURL(
GURL("filesystem:chrome-extension://ftw/t/file.txt"))); GURL("filesystem:chrome-extension://ftw/t/file.txt")));
}; }
static const struct GetAsStringPatterns { static const struct GetAsStringPatterns {
const char* pattern; const char* pattern;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef EXTENSIONS_RENDERER_DEFAULT_DISPATCHER_DELEGATE_H #ifndef EXTENSIONS_RENDERER_DEFAULT_DISPATCHER_DELEGATE_H_
#define EXTENSIONS_RENDERER_DEFAULT_DISPATCHER_DELEGATE_H #define EXTENSIONS_RENDERER_DEFAULT_DISPATCHER_DELEGATE_H_
#include "extensions/renderer/dispatcher_delegate.h" #include "extensions/renderer/dispatcher_delegate.h"
...@@ -26,4 +26,4 @@ class DefaultDispatcherDelegate : public DispatcherDelegate { ...@@ -26,4 +26,4 @@ class DefaultDispatcherDelegate : public DispatcherDelegate {
} // namespace extensions } // namespace extensions
#endif // EXTENSIONS_RENDERER_DEFAULT_DISPATCHER_DELEGATE_H #endif // EXTENSIONS_RENDERER_DEFAULT_DISPATCHER_DELEGATE_H_
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef EXTENSIONS_RENDERER_DISPATCHER_DELEGATE_H #ifndef EXTENSIONS_RENDERER_DISPATCHER_DELEGATE_H_
#define EXTENSIONS_RENDERER_DISPATCHER_DELEGATE_H #define EXTENSIONS_RENDERER_DISPATCHER_DELEGATE_H_
#include <set> #include <set>
#include <string> #include <string>
...@@ -91,4 +91,4 @@ class DispatcherDelegate { ...@@ -91,4 +91,4 @@ class DispatcherDelegate {
} // namespace extensions } // namespace extensions
#endif // EXTENSIONS_RENDERER_DISPATCHER_DELEGATE_H #endif // EXTENSIONS_RENDERER_DISPATCHER_DELEGATE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment