| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 base::FilePath plugin_data_path = | 205 base::FilePath plugin_data_path = |
| 206 profile_path.Append(base::FilePath(base::UTF8ToUTF16(plugin_name_))); | 206 profile_path.Append(base::FilePath(base::UTF8ToUTF16(plugin_name_))); |
| 207 #else | 207 #else |
| 208 base::FilePath plugin_data_path = | 208 base::FilePath plugin_data_path = |
| 209 profile_path.Append(base::FilePath(plugin_name_)); | 209 profile_path.Append(base::FilePath(plugin_name_)); |
| 210 #endif // defined(OS_WIN) | 210 #endif // defined(OS_WIN) |
| 211 return new PpapiMsg_ClearSiteData(0u, plugin_data_path, std::string(), | 211 return new PpapiMsg_ClearSiteData(0u, plugin_data_path, std::string(), |
| 212 kClearAllData, max_age); | 212 kClearAllData, max_age); |
| 213 } | 213 } |
| 214 | 214 |
| 215 // Connects the client side of a newly opened plug-in channel. | 215 // Connects the client side of a newly opened plugin channel. |
| 216 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { | 216 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { |
| 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 218 | 218 |
| 219 // If we timed out, don't bother connecting. | 219 // If we timed out, don't bother connecting. |
| 220 if (!is_removing_) | 220 if (!is_removing_) |
| 221 return; | 221 return; |
| 222 | 222 |
| 223 DCHECK(!channel_.get()); | 223 DCHECK(!channel_.get()); |
| 224 channel_ = IPC::Channel::CreateClient(handle, this); | 224 channel_ = IPC::Channel::CreateClient(handle, this); |
| 225 if (!channel_->Connect()) { | 225 if (!channel_->Connect()) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Path for the current profile. Must be retrieved on the UI thread from the | 281 // Path for the current profile. Must be retrieved on the UI thread from the |
| 282 // browser context when we start so we can use it later on the I/O thread. | 282 // browser context when we start so we can use it later on the I/O thread. |
| 283 base::FilePath browser_context_path_; | 283 base::FilePath browser_context_path_; |
| 284 | 284 |
| 285 // The resource context for the profile. Use only on the I/O thread. | 285 // The resource context for the profile. Use only on the I/O thread. |
| 286 ResourceContext* resource_context_; | 286 ResourceContext* resource_context_; |
| 287 | 287 |
| 288 // The name of the plugin. Use only on the I/O thread. | 288 // The name of the plugin. Use only on the I/O thread. |
| 289 std::string plugin_name_; | 289 std::string plugin_name_; |
| 290 | 290 |
| 291 // The channel is NULL until we have opened a connection to the plug-in | 291 // The channel is NULL until we have opened a connection to the plugin |
| 292 // process. | 292 // process. |
| 293 scoped_ptr<IPC::Channel> channel_; | 293 scoped_ptr<IPC::Channel> channel_; |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 | 296 |
| 297 PluginDataRemoverImpl::PluginDataRemoverImpl(BrowserContext* browser_context) | 297 PluginDataRemoverImpl::PluginDataRemoverImpl(BrowserContext* browser_context) |
| 298 : mime_type_(kFlashPluginSwfMimeType), | 298 : mime_type_(kFlashPluginSwfMimeType), |
| 299 browser_context_(browser_context) { | 299 browser_context_(browser_context) { |
| 300 } | 300 } |
| 301 | 301 |
| 302 PluginDataRemoverImpl::~PluginDataRemoverImpl() { | 302 PluginDataRemoverImpl::~PluginDataRemoverImpl() { |
| 303 } | 303 } |
| 304 | 304 |
| 305 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 305 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
| 306 base::Time begin_time) { | 306 base::Time begin_time) { |
| 307 DCHECK(!context_.get()); | 307 DCHECK(!context_.get()); |
| 308 context_ = new Context(begin_time, browser_context_); | 308 context_ = new Context(begin_time, browser_context_); |
| 309 context_->Init(mime_type_); | 309 context_->Init(mime_type_); |
| 310 return context_->event(); | 310 return context_->event(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 } // namespace content | 313 } // namespace content |
| OLD | NEW |