Chromium Code Reviews| Index: chrome/browser/chromeos/launcher_search_provider/error_reporter.h |
| diff --git a/chrome/browser/chromeos/launcher_search_provider/error_reporter.h b/chrome/browser/chromeos/launcher_search_provider/error_reporter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..98b1e14cf0cc690e7132f838fee4df7828e84c54 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/launcher_search_provider/error_reporter.h |
| @@ -0,0 +1,41 @@ |
| +// 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. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "ipc/ipc_sender.h" |
| + |
| +namespace chromeos { |
| +namespace launcher_search_provider { |
| + |
| +// A utility class which sends error message to developer console. |
| +class ErrorReporter : public base::RefCounted<ErrorReporter> { |
|
satorux1
2015/05/03 23:51:24
Why does it have to be a ref counted object? Ref c
Matt Giuca
2015/05/05 04:25:30
There was a use-after-free in the older patch set.
yawano
2015/05/07 02:27:17
This wasn't ref counted object before.
The reason
Matt Giuca
2015/05/07 03:24:03
I see. Right, you can't directly copy an object th
yawano
2015/05/07 06:24:55
Done. Thank you for the idea.
|
| + public: |
| + ErrorReporter(IPC::Sender* sender, const int routing_id); |
| + |
| + // Shows |message| as warning in the developer console of the extension. |
| + virtual void Warn(const std::string& message); |
| + |
| + protected: |
| + virtual ~ErrorReporter(); |
| + |
| + private: |
| + friend class base::RefCounted<ErrorReporter>; |
| + |
| + // Not owned. |
| + IPC::Sender* sender_; |
| + |
| + const int routing_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ErrorReporter); |
| +}; |
| + |
| +} // namespace launcher_search_provider |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ |