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