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