OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ |
6 #define CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // The plug-in whose data should be removed (usually Flash) is specified via | 28 // The plug-in whose data should be removed (usually Flash) is specified via |
29 // its MIME type. This method sets a different MIME type in order to call a | 29 // its MIME type. This method sets a different MIME type in order to call a |
30 // different plug-in (for example in tests). | 30 // different plug-in (for example in tests). |
31 void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; } | 31 void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; } |
32 | 32 |
33 // Starts removing plug-in data stored since |begin_time|. | 33 // Starts removing plug-in data stored since |begin_time|. |
34 base::WaitableEvent* StartRemoving(base::Time begin_time); | 34 base::WaitableEvent* StartRemoving(base::Time begin_time); |
35 | 35 |
36 // Returns whether there is a plug-in installed that supports removing | 36 // Returns whether there is a plug-in installed that supports removing |
37 // LSO data. Because this method possibly has to load the plug-in list, it | 37 // LSO data. This method will use cached plugin data. Call |
38 // should only be called on the FILE thread. | 38 // PluginService::GetPlugins() if the latest data is needed. |
39 static bool IsSupported(PluginPrefs* plugin_prefs); | 39 static bool IsSupported(PluginPrefs* plugin_prefs); |
40 | 40 |
41 // Indicates whether we are still in the process of removing plug-in data. | 41 // Indicates whether we are still in the process of removing plug-in data. |
42 bool is_removing() const { return is_removing_; } | 42 bool is_removing() const { return is_removing_; } |
43 | 43 |
44 // Wait until removing has finished. When the browser is still running (i.e. | 44 // Wait until removing has finished. When the browser is still running (i.e. |
45 // not during shutdown), you should use a WaitableEventWatcher in combination | 45 // not during shutdown), you should use a WaitableEventWatcher in combination |
46 // with the WaitableEvent returned by StartRemoving. | 46 // with the WaitableEvent returned by StartRemoving. |
47 void Wait(); | 47 void Wait(); |
48 | 48 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 scoped_ptr<base::WaitableEvent> event_; | 87 scoped_ptr<base::WaitableEvent> event_; |
88 // We own the channel, but it's used on the IO thread, so it needs to be | 88 // We own the channel, but it's used on the IO thread, so it needs to be |
89 // deleted there. It's NULL until we have opened a connection to the plug-in | 89 // deleted there. It's NULL until we have opened a connection to the plug-in |
90 // process. | 90 // process. |
91 IPC::Channel* channel_; | 91 IPC::Channel* channel_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(PluginDataRemover); | 93 DISALLOW_COPY_AND_ASSIGN(PluginDataRemover); |
94 }; | 94 }; |
95 | 95 |
96 #endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ | 96 #endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ |
OLD | NEW |