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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/sequenced_task_runner_helpers.h" | 9 #include "base/sequenced_task_runner_helpers.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/version.h" | 12 #include "base/version.h" |
13 #include "content/browser/plugin_process_host.h" | 13 #include "content/browser/plugin_process_host.h" |
14 #include "content/browser/plugin_service_impl.h" | 14 #include "content/browser/plugin_service_impl.h" |
15 #include "content/browser/renderer_host/pepper/pepper_file_message_filter.h" | 15 #include "content/browser/renderer_host/pepper/pepper_file_message_filter.h" |
16 #include "content/common/child_process_host_impl.h" | 16 #include "content/common/child_process_host_impl.h" |
17 #include "content/common/plugin_messages.h" | 17 #include "content/common/plugin_messages.h" |
18 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/storage_partition.h" |
20 #include "content/public/common/pepper_plugin_info.h" | 21 #include "content/public/common/pepper_plugin_info.h" |
21 #include "ppapi/proxy/ppapi_messages.h" | 22 #include "ppapi/proxy/ppapi_messages.h" |
22 #include "webkit/plugins/npapi/plugin_group.h" | 23 #include "webkit/plugins/npapi/plugin_group.h" |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
26 namespace { | 27 namespace { |
27 | 28 |
28 const char kFlashMimeType[] = "application/x-shockwave-flash"; | 29 const char kFlashMimeType[] = "application/x-shockwave-flash"; |
29 // The minimum Flash Player version that implements NPP_ClearSiteData. | 30 // The minimum Flash Player version that implements NPP_ClearSiteData. |
(...skipping 30 matching lines...) Expand all Loading... |
60 public PpapiPluginProcessHost::BrokerClient, | 61 public PpapiPluginProcessHost::BrokerClient, |
61 public IPC::Listener, | 62 public IPC::Listener, |
62 public base::RefCountedThreadSafe<Context, | 63 public base::RefCountedThreadSafe<Context, |
63 BrowserThread::DeleteOnIOThread> { | 64 BrowserThread::DeleteOnIOThread> { |
64 public: | 65 public: |
65 Context(base::Time begin_time, BrowserContext* browser_context) | 66 Context(base::Time begin_time, BrowserContext* browser_context) |
66 : event_(new base::WaitableEvent(true, false)), | 67 : event_(new base::WaitableEvent(true, false)), |
67 begin_time_(begin_time), | 68 begin_time_(begin_time), |
68 is_removing_(false), | 69 is_removing_(false), |
69 browser_context_path_(browser_context->GetPath()), | 70 browser_context_path_(browser_context->GetPath()), |
70 resource_context_(browser_context->GetResourceContext()), | 71 resource_context_( |
| 72 content::BrowserContext::GetDefaultStoragePartition(browser_context)
-> |
| 73 GetResourceContext()), |
71 channel_(NULL) { | 74 channel_(NULL) { |
72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
73 } | 76 } |
74 | 77 |
75 void Init(const std::string& mime_type) { | 78 void Init(const std::string& mime_type) { |
76 BrowserThread::PostTask( | 79 BrowserThread::PostTask( |
77 BrowserThread::IO, | 80 BrowserThread::IO, |
78 FROM_HERE, | 81 FROM_HERE, |
79 base::Bind(&Context::InitOnIOThread, this, mime_type)); | 82 base::Bind(&Context::InitOnIOThread, this, mime_type)); |
80 BrowserThread::PostDelayedTask( | 83 BrowserThread::PostDelayedTask( |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 305 |
303 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 306 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
304 base::Time begin_time) { | 307 base::Time begin_time) { |
305 DCHECK(!context_.get()); | 308 DCHECK(!context_.get()); |
306 context_ = new Context(begin_time, browser_context_); | 309 context_ = new Context(begin_time, browser_context_); |
307 context_->Init(mime_type_); | 310 context_->Init(mime_type_); |
308 return context_->event(); | 311 return context_->event(); |
309 } | 312 } |
310 | 313 |
311 } // namespace content | 314 } // namespace content |
OLD | NEW |