| 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" |
| 11 #include "base/sequenced_task_runner_helpers.h" | 11 #include "base/sequenced_task_runner_helpers.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "base/version.h" | 14 #include "base/version.h" |
| 15 #include "content/browser/plugin_process_host.h" | 15 #include "content/browser/plugin_process_host.h" |
| 16 #include "content/browser/plugin_service_impl.h" | 16 #include "content/browser/plugin_service_impl.h" |
| 17 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" | 17 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" |
| 18 #include "content/common/child_process_host_impl.h" | 18 #include "content/common/child_process_host_impl.h" |
| 19 #include "content/common/plugin_process_messages.h" | 19 #include "content/common/plugin_process_messages.h" |
| 20 #include "content/public/browser/browser_context.h" | 20 #include "content/public/browser/browser_context.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/common/child_process_host.h" |
| 22 #include "content/public/common/content_constants.h" | 23 #include "content/public/common/content_constants.h" |
| 23 #include "content/public/common/pepper_plugin_info.h" | 24 #include "content/public/common/pepper_plugin_info.h" |
| 24 #include "ppapi/proxy/ppapi_messages.h" | 25 #include "ppapi/proxy/ppapi_messages.h" |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 | 28 |
| 28 namespace { | 29 namespace { |
| 29 | 30 |
| 30 // The minimum Flash Player version that implements NPP_ClearSiteData. | 31 // The minimum Flash Player version that implements NPP_ClearSiteData. |
| 31 const char kMinFlashVersion[] = "10.3"; | 32 const char kMinFlashVersion[] = "10.3"; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 220 |
| 220 // Connects the client side of a newly opened plugin channel. | 221 // Connects the client side of a newly opened plugin channel. |
| 221 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { | 222 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { |
| 222 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 223 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 223 | 224 |
| 224 // If we timed out, don't bother connecting. | 225 // If we timed out, don't bother connecting. |
| 225 if (!is_removing_) | 226 if (!is_removing_) |
| 226 return; | 227 return; |
| 227 | 228 |
| 228 DCHECK(!channel_.get()); | 229 DCHECK(!channel_.get()); |
| 229 channel_ = IPC::Channel::CreateClient(handle, this); | 230 channel_ = IPC::Channel::CreateClient( |
| 231 handle, this, content::ChildProcessHost::GetAttachmentBroker()); |
| 230 if (!channel_->Connect()) { | 232 if (!channel_->Connect()) { |
| 231 NOTREACHED() << "Couldn't connect to plugin"; | 233 NOTREACHED() << "Couldn't connect to plugin"; |
| 232 SignalDone(); | 234 SignalDone(); |
| 233 return; | 235 return; |
| 234 } | 236 } |
| 235 | 237 |
| 236 uint64 max_age = begin_time_.is_null() ? | 238 uint64 max_age = begin_time_.is_null() ? |
| 237 std::numeric_limits<uint64>::max() : | 239 std::numeric_limits<uint64>::max() : |
| 238 (base::Time::Now() - begin_time_).InSeconds(); | 240 (base::Time::Now() - begin_time_).InSeconds(); |
| 239 | 241 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 311 |
| 310 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 312 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
| 311 base::Time begin_time) { | 313 base::Time begin_time) { |
| 312 DCHECK(!context_.get()); | 314 DCHECK(!context_.get()); |
| 313 context_ = new Context(begin_time, browser_context_); | 315 context_ = new Context(begin_time, browser_context_); |
| 314 context_->Init(mime_type_); | 316 context_->Init(mime_type_); |
| 315 return context_->event(); | 317 return context_->event(); |
| 316 } | 318 } |
| 317 | 319 |
| 318 } // namespace content | 320 } // namespace content |
| OLD | NEW |