Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "ipc/ipc_sender.h" | |
| 12 | |
| 13 namespace chromeos { | |
| 14 namespace launcher_search_provider { | |
| 15 | |
| 16 // A utility class which sends error message to developer console. | |
| 17 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.
| |
| 18 public: | |
| 19 ErrorReporter(IPC::Sender* sender, const int routing_id); | |
| 20 | |
| 21 // Shows |message| as warning in the developer console of the extension. | |
| 22 virtual void Warn(const std::string& message); | |
| 23 | |
| 24 protected: | |
| 25 virtual ~ErrorReporter(); | |
| 26 | |
| 27 private: | |
| 28 friend class base::RefCounted<ErrorReporter>; | |
| 29 | |
| 30 // Not owned. | |
| 31 IPC::Sender* sender_; | |
| 32 | |
| 33 const int routing_id_; | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); | |
| 36 }; | |
| 37 | |
| 38 } // namespace launcher_search_provider | |
| 39 } // namespace chromeos | |
| 40 | |
| 41 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ | |
| OLD | NEW |