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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 // Connects the client side of a newly opened plugin channel. | 221 // Connects the client side of a newly opened plugin channel. |
222 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { | 222 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { |
223 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 223 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
224 | 224 |
225 // If we timed out, don't bother connecting. | 225 // If we timed out, don't bother connecting. |
226 if (!is_removing_) | 226 if (!is_removing_) |
227 return; | 227 return; |
228 | 228 |
229 DCHECK(!channel_.get()); | 229 DCHECK(!channel_.get()); |
230 channel_ = IPC::Channel::CreateClient( | 230 channel_ = IPC::Channel::CreateClient(handle, this); |
231 handle, this, content::ChildProcessHost::GetAttachmentBroker()); | |
232 if (!channel_->Connect()) { | 231 if (!channel_->Connect()) { |
233 NOTREACHED() << "Couldn't connect to plugin"; | 232 NOTREACHED() << "Couldn't connect to plugin"; |
234 SignalDone(); | 233 SignalDone(); |
235 return; | 234 return; |
236 } | 235 } |
237 | 236 |
238 uint64 max_age = begin_time_.is_null() ? | 237 uint64 max_age = begin_time_.is_null() ? |
239 std::numeric_limits<uint64>::max() : | 238 std::numeric_limits<uint64>::max() : |
240 (base::Time::Now() - begin_time_).InSeconds(); | 239 (base::Time::Now() - begin_time_).InSeconds(); |
241 | 240 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 310 |
312 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 311 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
313 base::Time begin_time) { | 312 base::Time begin_time) { |
314 DCHECK(!context_.get()); | 313 DCHECK(!context_.get()); |
315 context_ = new Context(begin_time, browser_context_); | 314 context_ = new Context(begin_time, browser_context_); |
316 context_->Init(mime_type_); | 315 context_->Init(mime_type_); |
317 return context_->event(); | 316 return context_->event(); |
318 } | 317 } |
319 | 318 |
320 } // namespace content | 319 } // namespace content |
OLD | NEW |