summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/safe_browsing/database_manager.cc16
-rw-r--r--chrome/browser/safe_browsing/database_manager.h13
-rw-r--r--chrome/browser/safe_browsing/test_database_manager.cc5
-rw-r--r--chrome/browser/safe_browsing/test_database_manager.h1
4 files changed, 34 insertions, 1 deletions
diff --git a/chrome/browser/safe_browsing/database_manager.cc b/chrome/browser/safe_browsing/database_manager.cc
new file mode 100644
index 0000000..b7274f6
--- /dev/null
+++ b/chrome/browser/safe_browsing/database_manager.cc
@@ -0,0 +1,16 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/safe_browsing/database_manager.h"
+
+#include "url/gurl.h"
+
+namespace safe_browsing {
+
+void SafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url,
+ Client* client) {
+ // TODO(kcarattini): Implement this.
+}
+
+} // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/database_manager.h b/chrome/browser/safe_browsing/database_manager.h
index cb9260b..3e11d65 100644
--- a/chrome/browser/safe_browsing/database_manager.h
+++ b/chrome/browser/safe_browsing/database_manager.h
@@ -22,7 +22,7 @@
namespace safe_browsing {
-// Interface to either the locally-managed or a remotely-managed database.
+// Base class to either the locally-managed or a remotely-managed database.
class SafeBrowsingDatabaseManager
: public base::RefCountedThreadSafe<SafeBrowsingDatabaseManager> {
public:
@@ -45,6 +45,10 @@ class SafeBrowsingDatabaseManager
// Called when the result of checking a set of extensions is known.
virtual void OnCheckExtensionsResult(
const std::set<std::string>& threats) {}
+
+ // Called when the result of checking the API blacklist is known.
+ virtual void OnCheckApiBlacklistUrlResult(const GURL& url,
+ const std::string& metadata) {}
};
@@ -124,6 +128,13 @@ class SafeBrowsingDatabaseManager
// longer needed. Also called after the result has been handled.
virtual void CancelCheck(Client* client) = 0;
+ // Called on the IO thread to check if the given url has blacklisted APIs.
+ // "client" is called asynchronously with the result when it is ready.
+ // This method has the same implementation for both the local and remote
+ // database managers since it pings Safe Browsing servers directly without
+ // accessing the database at all.
+ virtual void CheckApiBlacklistUrl(const GURL& url, Client* client);
+
// Called to initialize objects that are used on the io_thread. This may be
// called multiple times during the life of the DatabaseManager. Must be
// called on IO thread.
diff --git a/chrome/browser/safe_browsing/test_database_manager.cc b/chrome/browser/safe_browsing/test_database_manager.cc
index d708fca..cc1335e 100644
--- a/chrome/browser/safe_browsing/test_database_manager.cc
+++ b/chrome/browser/safe_browsing/test_database_manager.cc
@@ -107,6 +107,11 @@ void TestSafeBrowsingDatabaseManager::CancelCheck(Client* client) {
NOTIMPLEMENTED();
}
+void TestSafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url,
+ Client* client) {
+ NOTIMPLEMENTED();
+}
+
void TestSafeBrowsingDatabaseManager::StartOnIOThread() {
}
diff --git a/chrome/browser/safe_browsing/test_database_manager.h b/chrome/browser/safe_browsing/test_database_manager.h
index 400a485..c6a60d1 100644
--- a/chrome/browser/safe_browsing/test_database_manager.h
+++ b/chrome/browser/safe_browsing/test_database_manager.h
@@ -39,6 +39,7 @@ class TestSafeBrowsingDatabaseManager
bool IsMalwareKillSwitchOn() override;
bool IsCsdWhitelistKillSwitchOn() override;
void CancelCheck(Client* client) override;
+ void CheckApiBlacklistUrl(const GURL& url, Client* client) override;
void StartOnIOThread() override;
void StopOnIOThread(bool shutdown) override;