[email protected] | f786717 | 2012-07-11 07:04:07 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | d8e68201 | 2011-11-17 18:31:54 | [diff] [blame] | 5 | #ifndef CONTENT_BROWSER_PLUGIN_DATA_REMOVER_IMPL_H_ |
6 | #define CONTENT_BROWSER_PLUGIN_DATA_REMOVER_IMPL_H_ | ||||
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 7 | |
[email protected] | bb95acab | 2011-11-16 22:22:27 | [diff] [blame] | 8 | #include <string> |
9 | |||||
[email protected] | 15bbfc5 | 2011-11-17 19:22:59 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
avi | b734894 | 2015-12-25 20:57:10 | [diff] [blame] | 11 | #include "base/macros.h" |
[email protected] | 76b70f9 | 2011-11-21 19:31:14 | [diff] [blame] | 12 | #include "base/memory/ref_counted.h" |
[email protected] | a43858f | 2013-06-28 15:18:37 | [diff] [blame] | 13 | #include "base/time/time.h" |
[email protected] | d8e68201 | 2011-11-17 18:31:54 | [diff] [blame] | 14 | #include "content/public/browser/plugin_data_remover.h" |
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 15 | |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 16 | namespace content { |
17 | |||||
18 | class CONTENT_EXPORT PluginDataRemoverImpl : public PluginDataRemover { | ||||
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 19 | public: |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 20 | explicit PluginDataRemoverImpl(BrowserContext* browser_context); |
dcheng | c2282aa | 2014-10-21 12:07:58 | [diff] [blame] | 21 | ~PluginDataRemoverImpl() override; |
[email protected] | d8e68201 | 2011-11-17 18:31:54 | [diff] [blame] | 22 | |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 23 | // PluginDataRemover implementation: |
dcheng | c2282aa | 2014-10-21 12:07:58 | [diff] [blame] | 24 | base::WaitableEvent* StartRemoving(base::Time begin_time) override; |
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 25 | |
tommycli | e86b298 | 2015-03-16 20:16:45 | [diff] [blame] | 26 | // The plugin whose data should be removed (usually Flash) is specified via |
[email protected] | b4a27e0 | 2011-04-04 19:12:22 | [diff] [blame] | 27 | // its MIME type. This method sets a different MIME type in order to call a |
tommycli | e86b298 | 2015-03-16 20:16:45 | [diff] [blame] | 28 | // different plugin (for example in tests). |
[email protected] | c7d58d6 | 2011-01-21 10:27:18 | [diff] [blame] | 29 | void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; } |
30 | |||||
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 31 | private: |
[email protected] | 76b70f9 | 2011-11-21 19:31:14 | [diff] [blame] | 32 | class Context; |
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 33 | |
[email protected] | c7d58d6 | 2011-01-21 10:27:18 | [diff] [blame] | 34 | std::string mime_type_; |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 35 | |
36 | // The browser context for the profile. | ||||
37 | BrowserContext* browser_context_; | ||||
[email protected] | b4a27e0 | 2011-04-04 19:12:22 | [diff] [blame] | 38 | |
[email protected] | 76b70f9 | 2011-11-21 19:31:14 | [diff] [blame] | 39 | // This allows this object to be deleted on the UI thread while it's still |
40 | // being used on the IO thread. | ||||
41 | scoped_refptr<Context> context_; | ||||
[email protected] | d8e68201 | 2011-11-17 18:31:54 | [diff] [blame] | 42 | |
43 | DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverImpl); | ||||
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 44 | }; |
45 | |||||
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 46 | } // namespace content |
47 | |||||
[email protected] | d8e68201 | 2011-11-17 18:31:54 | [diff] [blame] | 48 | #endif // CONTENT_BROWSER_PLUGIN_DATA_REMOVER_IMPL_H_ |