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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 | 116 |
117 // Called when a timeout happens in order not to block the client | 117 // Called when a timeout happens in order not to block the client |
118 // indefinitely. | 118 // indefinitely. |
119 void OnTimeout() { | 119 void OnTimeout() { |
120 LOG_IF(ERROR, is_removing_) << "Timed out"; | 120 LOG_IF(ERROR, is_removing_) << "Timed out"; |
121 SignalDone(); | 121 SignalDone(); |
122 } | 122 } |
123 | 123 |
124 // PluginProcessHost::Client methods. | 124 // PluginProcessHost::Client methods. |
125 virtual int ID() OVERRIDE { | 125 virtual int ID() override { |
126 // Generate a unique identifier for this PluginProcessHostClient. | 126 // Generate a unique identifier for this PluginProcessHostClient. |
127 return ChildProcessHostImpl::GenerateChildProcessUniqueId(); | 127 return ChildProcessHostImpl::GenerateChildProcessUniqueId(); |
128 } | 128 } |
129 | 129 |
130 virtual bool OffTheRecord() OVERRIDE { | 130 virtual bool OffTheRecord() override { |
131 return false; | 131 return false; |
132 } | 132 } |
133 | 133 |
134 virtual ResourceContext* GetResourceContext() OVERRIDE { | 134 virtual ResourceContext* GetResourceContext() override { |
135 return resource_context_; | 135 return resource_context_; |
136 } | 136 } |
137 | 137 |
138 virtual void SetPluginInfo(const WebPluginInfo& info) OVERRIDE {} | 138 virtual void SetPluginInfo(const WebPluginInfo& info) override {} |
139 | 139 |
140 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE {} | 140 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) override {} |
141 | 141 |
142 virtual void OnSentPluginChannelRequest() OVERRIDE {} | 142 virtual void OnSentPluginChannelRequest() override {} |
143 | 143 |
144 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE { | 144 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) override { |
145 ConnectToChannel(handle, false); | 145 ConnectToChannel(handle, false); |
146 // Balancing the AddRef call. | 146 // Balancing the AddRef call. |
147 Release(); | 147 Release(); |
148 } | 148 } |
149 | 149 |
150 virtual void OnError() OVERRIDE { | 150 virtual void OnError() override { |
151 LOG(ERROR) << "Couldn't open plugin channel"; | 151 LOG(ERROR) << "Couldn't open plugin channel"; |
152 SignalDone(); | 152 SignalDone(); |
153 // Balancing the AddRef call. | 153 // Balancing the AddRef call. |
154 Release(); | 154 Release(); |
155 } | 155 } |
156 | 156 |
157 // PpapiPluginProcessHost::BrokerClient implementation. | 157 // PpapiPluginProcessHost::BrokerClient implementation. |
158 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, | 158 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, |
159 int* renderer_id) OVERRIDE { | 159 int* renderer_id) override { |
160 *renderer_handle = base::kNullProcessHandle; | 160 *renderer_handle = base::kNullProcessHandle; |
161 *renderer_id = 0; | 161 *renderer_id = 0; |
162 } | 162 } |
163 | 163 |
164 virtual void OnPpapiChannelOpened( | 164 virtual void OnPpapiChannelOpened( |
165 const IPC::ChannelHandle& channel_handle, | 165 const IPC::ChannelHandle& channel_handle, |
166 base::ProcessId /* peer_pid */, | 166 base::ProcessId /* peer_pid */, |
167 int /* child_id */) OVERRIDE { | 167 int /* child_id */) override { |
168 if (!channel_handle.name.empty()) | 168 if (!channel_handle.name.empty()) |
169 ConnectToChannel(channel_handle, true); | 169 ConnectToChannel(channel_handle, true); |
170 | 170 |
171 // Balancing the AddRef call. | 171 // Balancing the AddRef call. |
172 Release(); | 172 Release(); |
173 } | 173 } |
174 | 174 |
175 // IPC::Listener methods. | 175 // IPC::Listener methods. |
176 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 176 virtual bool OnMessageReceived(const IPC::Message& message) override { |
177 IPC_BEGIN_MESSAGE_MAP(Context, message) | 177 IPC_BEGIN_MESSAGE_MAP(Context, message) |
178 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ClearSiteDataResult, | 178 IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ClearSiteDataResult, |
179 OnClearSiteDataResult) | 179 OnClearSiteDataResult) |
180 IPC_MESSAGE_HANDLER(PpapiHostMsg_ClearSiteDataResult, | 180 IPC_MESSAGE_HANDLER(PpapiHostMsg_ClearSiteDataResult, |
181 OnPpapiClearSiteDataResult) | 181 OnPpapiClearSiteDataResult) |
182 IPC_MESSAGE_UNHANDLED_ERROR() | 182 IPC_MESSAGE_UNHANDLED_ERROR() |
183 IPC_END_MESSAGE_MAP() | 183 IPC_END_MESSAGE_MAP() |
184 | 184 |
185 return true; | 185 return true; |
186 } | 186 } |
187 | 187 |
188 virtual void OnChannelError() OVERRIDE { | 188 virtual void OnChannelError() override { |
189 if (is_removing_) { | 189 if (is_removing_) { |
190 NOTREACHED() << "Channel error"; | 190 NOTREACHED() << "Channel error"; |
191 SignalDone(); | 191 SignalDone(); |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 base::WaitableEvent* event() { return event_.get(); } | 195 base::WaitableEvent* event() { return event_.get(); } |
196 | 196 |
197 private: | 197 private: |
198 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 198 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
(...skipping 110 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 |