Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: content/browser/plugin_data_remover_impl.cc

Issue 1292263003: ipc: Use a global for the process's attachment broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_message2
Patch Set: Comments from avi. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 // Connects the client side of a newly opened plugin channel. 221 // Connects the client side of a newly opened plugin channel.
222 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) { 222 void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) {
223 DCHECK_CURRENTLY_ON(BrowserThread::IO); 223 DCHECK_CURRENTLY_ON(BrowserThread::IO);
224 224
225 // If we timed out, don't bother connecting. 225 // If we timed out, don't bother connecting.
226 if (!is_removing_) 226 if (!is_removing_)
227 return; 227 return;
228 228
229 DCHECK(!channel_.get()); 229 DCHECK(!channel_.get());
230 channel_ = IPC::Channel::CreateClient( 230 channel_ = IPC::Channel::CreateClient(handle, this);
231 handle, this, content::ChildProcessHost::GetAttachmentBroker());
232 if (!channel_->Connect()) { 231 if (!channel_->Connect()) {
233 NOTREACHED() << "Couldn't connect to plugin"; 232 NOTREACHED() << "Couldn't connect to plugin";
234 SignalDone(); 233 SignalDone();
235 return; 234 return;
236 } 235 }
237 236
238 uint64 max_age = begin_time_.is_null() ? 237 uint64 max_age = begin_time_.is_null() ?
239 std::numeric_limits<uint64>::max() : 238 std::numeric_limits<uint64>::max() :
240 (base::Time::Now() - begin_time_).InSeconds(); 239 (base::Time::Now() - begin_time_).InSeconds();
241 240
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 310
312 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( 311 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving(
313 base::Time begin_time) { 312 base::Time begin_time) {
314 DCHECK(!context_.get()); 313 DCHECK(!context_.get());
315 context_ = new Context(begin_time, browser_context_); 314 context_ = new Context(begin_time, browser_context_);
316 context_->Init(mime_type_); 315 context_->Init(mime_type_);
317 return context_->event(); 316 return context_->event();
318 } 317 }
319 318
320 } // namespace content 319 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698