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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual void OnChannelOpened(const IPC::ChannelHandle& handle); | 51 virtual void OnChannelOpened(const IPC::ChannelHandle& handle); |
52 virtual void OnError(); | 52 virtual void OnError(); |
53 | 53 |
54 // IPC::Channel::Listener methods. | 54 // IPC::Channel::Listener methods. |
55 virtual bool OnMessageReceived(const IPC::Message& message); | 55 virtual bool OnMessageReceived(const IPC::Message& message); |
56 virtual void OnChannelError(); | 56 virtual void OnChannelError(); |
57 | 57 |
58 private: | 58 private: |
59 friend class base::RefCountedThreadSafe<PluginDataRemover>; | 59 friend class base::RefCountedThreadSafe<PluginDataRemover>; |
60 friend class PluginDataRemoverTest; | 60 friend class PluginDataRemoverTest; |
61 ~PluginDataRemover(); | 61 virtual ~PluginDataRemover(); |
62 | 62 |
63 // Signals that we are finished with removing data (successful or not). This | 63 // Signals that we are finished with removing data (successful or not). This |
64 // method is safe to call multiple times. | 64 // method is safe to call multiple times. |
65 void SignalDone(); | 65 void SignalDone(); |
66 // Connects the client side of a newly opened plug-in channel. | 66 // Connects the client side of a newly opened plug-in channel. |
67 void ConnectToChannel(const IPC::ChannelHandle& handle); | 67 void ConnectToChannel(const IPC::ChannelHandle& handle); |
68 // Handles the PluginHostMsg_ClearSiteDataResult message. | 68 // Handles the PluginHostMsg_ClearSiteDataResult message. |
69 void OnClearSiteDataResult(bool success); | 69 void OnClearSiteDataResult(bool success); |
70 // Called when a timeout happens in order not to block the client | 70 // Called when a timeout happens in order not to block the client |
71 // indefinitely. | 71 // indefinitely. |
72 void OnTimeout(); | 72 void OnTimeout(); |
73 | 73 |
74 std::string mime_type_; | 74 std::string mime_type_; |
75 bool is_removing_; | 75 bool is_removing_; |
76 // The point in time when we start removing data. | 76 // The point in time when we start removing data. |
77 base::Time remove_start_time_; | 77 base::Time remove_start_time_; |
78 // The point in time from which on we remove data. | 78 // The point in time from which on we remove data. |
79 base::Time begin_time_; | 79 base::Time begin_time_; |
80 scoped_ptr<base::WaitableEvent> event_; | 80 scoped_ptr<base::WaitableEvent> event_; |
81 // We own the channel, but it's used on the IO thread, so it needs to be | 81 // We own the channel, but it's used on the IO thread, so it needs to be |
82 // deleted there. It's NULL until we have opened a connection to the plug-in | 82 // deleted there. It's NULL until we have opened a connection to the plug-in |
83 // process. | 83 // process. |
84 IPC::Channel* channel_; | 84 IPC::Channel* channel_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(PluginDataRemover); | 86 DISALLOW_COPY_AND_ASSIGN(PluginDataRemover); |
87 }; | 87 }; |
88 | 88 |
89 #endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ | 89 #endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_ |
OLD | NEW |