Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7026)

Unified Diff: chrome/browser/safe_browsing/srt_fetcher_win.h

Issue 2844113002: Revert of Adds error handling support for the SwReporter launcher. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/srt_fetcher_win.h
diff --git a/chrome/browser/safe_browsing/srt_fetcher_win.h b/chrome/browser/safe_browsing/srt_fetcher_win.h
index 26400ce1b6a8279779727ca995994b10e03974ef..2d1ca858de6bbcbdeb014a1d7f3507f3e7f74af9 100644
--- a/chrome/browser/safe_browsing/srt_fetcher_win.h
+++ b/chrome/browser/safe_browsing/srt_fetcher_win.h
@@ -16,7 +16,6 @@
#include "base/process/launch.h"
#include "base/process/process.h"
#include "base/time/time.h"
-#include "components/chrome_cleaner/public/interfaces/chrome_prompt.mojom.h"
namespace base {
class FilePath;
@@ -28,10 +27,8 @@
namespace safe_browsing {
-class ChromePromptImpl;
-
// A special exit code identifying a failure to run the reporter.
-const int kReporterNotLaunchedExitCode = INT_MAX;
+const int kReporterFailureExitCode = INT_MAX;
// The number of days to wait before triggering another reporter run.
const int kDaysBetweenSuccessfulSwReporterRuns = 7;
@@ -106,45 +103,25 @@
// run the cleaner, rather than checking if they've run it at all.
bool UserHasRunCleaner();
-// A delegate used by tests to implement test doubles (e.g., stubs, fakes, or
-// mocks).
+// Mocks and callbacks for the unit tests.
class SwReporterTestingDelegate {
public:
virtual ~SwReporterTestingDelegate() {}
- // Invoked by tests in places of base::LaunchProcess.
- // See chrome_cleaner::mojom::ChromePromptRequest().
+ // Test mock for launching the reporter.
virtual base::Process LaunchReporter(
const SwReporterInvocation& invocation,
const base::LaunchOptions& launch_options) = 0;
- // Invoked by tests in place of the actual prompting logic.
- // See MaybeFetchSRT().
+ // Test mock for showing the prompt.
virtual void TriggerPrompt(Browser* browser,
const std::string& reporter_version) = 0;
- // Invoked by tests to override the current time.
- // See Now() in srt_fetcher_win.cc.
+ // Returns the test's idea of the current time.
virtual base::Time Now() const = 0;
// A task runner used to spawn the reporter process (which blocks).
- // See ReporterRunner::ScheduleNextInvocation().
virtual base::TaskRunner* BlockingTaskRunner() const = 0;
-
- // Returns a ChromePromptImpl object that keeps track of specific
- // actions during tests. Replaces the object returned by
- // SwReporterProcess::CreateChromePromptImpl().
- // See SwReporterProcess::LaunchConnectedReporterProcess().
- virtual std::unique_ptr<ChromePromptImpl> CreateChromePromptImpl(
- chrome_cleaner::mojom::ChromePromptRequest request) = 0;
-
- // Connection closed callback defined by tests in place of the default
- // error handler. See SRTFetcherTest::CreateChromePromptImpl().
- virtual void OnConnectionClosed() = 0;
-
- // Bad message handler callback defined by tests in place of the default
- // error handler. See SwReporterProcess::LaunchConnectedReporterProcess().
- virtual void OnConnectionError(const std::string& message) = 0;
};
// Set a delegate for testing. The implementation will not take ownership of
« no previous file with comments | « chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc ('k') | chrome/browser/safe_browsing/srt_fetcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698