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 #include "content/browser/plugin_data_remover_impl.h" | 5 #include "content/browser/plugin_data_remover_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
11 #include "content/browser/plugin_process_host.h" | 11 #include "content/browser/plugin_process_host.h" |
12 #include "content/browser/plugin_service.h" | 12 #include "content/browser/plugin_service_impl.h" |
13 #include "content/common/child_process_host_impl.h" | 13 #include "content/common/child_process_host_impl.h" |
14 #include "content/common/plugin_messages.h" | 14 #include "content/common/plugin_messages.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "webkit/plugins/npapi/plugin_group.h" | 16 #include "webkit/plugins/npapi/plugin_group.h" |
17 | 17 |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 using content::ChildProcessHostImpl; | 19 using content::ChildProcessHostImpl; |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 // Initialize on the IO thread. | 90 // Initialize on the IO thread. |
91 void InitOnIOThread(const std::string& mime_type) { | 91 void InitOnIOThread(const std::string& mime_type) { |
92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
93 remove_start_time_ = base::Time::Now(); | 93 remove_start_time_ = base::Time::Now(); |
94 is_removing_ = true; | 94 is_removing_ = true; |
95 // Balanced in OnChannelOpened or OnError. Exactly one them will eventually | 95 // Balanced in OnChannelOpened or OnError. Exactly one them will eventually |
96 // be called, so we need to keep this object around until then. | 96 // be called, so we need to keep this object around until then. |
97 AddRef(); | 97 AddRef(); |
98 PluginService::GetInstance()->OpenChannelToNpapiPlugin( | 98 PluginServiceImpl::GetInstance()->OpenChannelToNpapiPlugin( |
99 0, 0, GURL(), GURL(), mime_type, this); | 99 0, 0, GURL(), GURL(), mime_type, this); |
100 } | 100 } |
101 | 101 |
102 // Called when a timeout happens in order not to block the client | 102 // Called when a timeout happens in order not to block the client |
103 // indefinitely. | 103 // indefinitely. |
104 void OnTimeout() { | 104 void OnTimeout() { |
105 LOG_IF(ERROR, is_removing_) << "Timed out"; | 105 LOG_IF(ERROR, is_removing_) << "Timed out"; |
106 SignalDone(); | 106 SignalDone(); |
107 } | 107 } |
108 | 108 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 PluginDataRemoverImpl::~PluginDataRemoverImpl() { | 231 PluginDataRemoverImpl::~PluginDataRemoverImpl() { |
232 } | 232 } |
233 | 233 |
234 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 234 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
235 base::Time begin_time) { | 235 base::Time begin_time) { |
236 DCHECK(!context_.get()); | 236 DCHECK(!context_.get()); |
237 context_ = new Context(begin_time, resource_context_); | 237 context_ = new Context(begin_time, resource_context_); |
238 context_->Init(mime_type_); | 238 context_->Init(mime_type_); |
239 return context_->event(); | 239 return context_->event(); |
240 } | 240 } |
OLD | NEW |