| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/plugin_data_remover_impl.h" | 5 #include "content/browser/plugin_data_remover_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // Signals that we are finished with removing data (successful or not). This | 227 // Signals that we are finished with removing data (successful or not). This |
| 228 // method is safe to call multiple times. | 228 // method is safe to call multiple times. |
| 229 void SignalDone() { | 229 void SignalDone() { |
| 230 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 230 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 231 if (!is_removing_) | 231 if (!is_removing_) |
| 232 return; | 232 return; |
| 233 is_removing_ = false; | 233 is_removing_ = false; |
| 234 event_->Signal(); | 234 event_->Signal(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 scoped_ptr<base::WaitableEvent> event_; | 237 std::unique_ptr<base::WaitableEvent> event_; |
| 238 // The point in time when we start removing data. | 238 // The point in time when we start removing data. |
| 239 base::Time remove_start_time_; | 239 base::Time remove_start_time_; |
| 240 // The point in time from which on we remove data. | 240 // The point in time from which on we remove data. |
| 241 base::Time begin_time_; | 241 base::Time begin_time_; |
| 242 bool is_removing_; | 242 bool is_removing_; |
| 243 | 243 |
| 244 // Path for the current profile. Must be retrieved on the UI thread from the | 244 // Path for the current profile. Must be retrieved on the UI thread from the |
| 245 // browser context when we start so we can use it later on the I/O thread. | 245 // browser context when we start so we can use it later on the I/O thread. |
| 246 base::FilePath browser_context_path_; | 246 base::FilePath browser_context_path_; |
| 247 | 247 |
| 248 // The name of the plugin. Use only on the I/O thread. | 248 // The name of the plugin. Use only on the I/O thread. |
| 249 std::string plugin_name_; | 249 std::string plugin_name_; |
| 250 | 250 |
| 251 // The channel is NULL until we have opened a connection to the plugin | 251 // The channel is NULL until we have opened a connection to the plugin |
| 252 // process. | 252 // process. |
| 253 scoped_ptr<IPC::Channel> channel_; | 253 std::unique_ptr<IPC::Channel> channel_; |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 | 256 |
| 257 PluginDataRemoverImpl::PluginDataRemoverImpl(BrowserContext* browser_context) | 257 PluginDataRemoverImpl::PluginDataRemoverImpl(BrowserContext* browser_context) |
| 258 : mime_type_(kFlashPluginSwfMimeType), | 258 : mime_type_(kFlashPluginSwfMimeType), |
| 259 browser_context_(browser_context) { | 259 browser_context_(browser_context) { |
| 260 } | 260 } |
| 261 | 261 |
| 262 PluginDataRemoverImpl::~PluginDataRemoverImpl() { | 262 PluginDataRemoverImpl::~PluginDataRemoverImpl() { |
| 263 } | 263 } |
| 264 | 264 |
| 265 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 265 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
| 266 base::Time begin_time) { | 266 base::Time begin_time) { |
| 267 DCHECK(!context_.get()); | 267 DCHECK(!context_.get()); |
| 268 context_ = new Context(begin_time, browser_context_); | 268 context_ = new Context(begin_time, browser_context_); |
| 269 context_->Init(mime_type_); | 269 context_->Init(mime_type_); |
| 270 return context_->event(); | 270 return context_->event(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace content | 273 } // namespace content |
| OLD | NEW |