| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 class PluginDataRemoverImpl::Context | 61 class PluginDataRemoverImpl::Context |
| 62 : public PpapiPluginProcessHost::BrokerClient, | 62 : public PpapiPluginProcessHost::BrokerClient, |
| 63 public IPC::Listener, | 63 public IPC::Listener, |
| 64 public base::RefCountedThreadSafe<Context, | 64 public base::RefCountedThreadSafe<Context, |
| 65 BrowserThread::DeleteOnIOThread> { | 65 BrowserThread::DeleteOnIOThread> { |
| 66 public: | 66 public: |
| 67 Context(base::Time begin_time, BrowserContext* browser_context) | 67 Context(base::Time begin_time, BrowserContext* browser_context) |
| 68 : event_(new base::WaitableEvent(true, false)), | 68 : event_(new base::WaitableEvent( |
| 69 base::WaitableEvent::ResetPolicy::MANUAL, |
| 70 base::WaitableEvent::InitialState::NOT_SIGNALED)), |
| 69 begin_time_(begin_time), | 71 begin_time_(begin_time), |
| 70 is_removing_(false), | 72 is_removing_(false), |
| 71 browser_context_path_(browser_context->GetPath()) { | 73 browser_context_path_(browser_context->GetPath()) { |
| 72 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 74 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 73 } | 75 } |
| 74 | 76 |
| 75 void Init(const std::string& mime_type) { | 77 void Init(const std::string& mime_type) { |
| 76 BrowserThread::PostTask( | 78 BrowserThread::PostTask( |
| 77 BrowserThread::IO, | 79 BrowserThread::IO, |
| 78 FROM_HERE, | 80 FROM_HERE, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 266 |
| 265 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 267 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
| 266 base::Time begin_time) { | 268 base::Time begin_time) { |
| 267 DCHECK(!context_.get()); | 269 DCHECK(!context_.get()); |
| 268 context_ = new Context(begin_time, browser_context_); | 270 context_ = new Context(begin_time, browser_context_); |
| 269 context_->Init(mime_type_); | 271 context_->Init(mime_type_); |
| 270 return context_->event(); | 272 return context_->event(); |
| 271 } | 273 } |
| 272 | 274 |
| 273 } // namespace content | 275 } // namespace content |
| OLD | NEW |