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

Side by Side Diff: chrome/browser/plugin_data_remover.cc

Issue 5598010: Convert over to channel handles (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed up bad whitespace Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/gpu/gpu_channel.h » ('j') | ipc/ipc_channel.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/plugin_data_remover.h" 5 #include "chrome/browser/plugin_data_remover.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "chrome/browser/browser_thread.h" 8 #include "chrome/browser/browser_thread.h"
9 #include "chrome/browser/plugin_service.h" 9 #include "chrome/browser/plugin_service.h"
10 #include "chrome/common/plugin_messages.h" 10 #include "chrome/common/plugin_messages.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 bool PluginDataRemover::OffTheRecord() { 55 bool PluginDataRemover::OffTheRecord() {
56 return false; 56 return false;
57 } 57 }
58 58
59 void PluginDataRemover::SetPluginInfo(const WebPluginInfo& info) { 59 void PluginDataRemover::SetPluginInfo(const WebPluginInfo& info) {
60 } 60 }
61 61
62 void PluginDataRemover::OnChannelOpened(const IPC::ChannelHandle& handle) { 62 void PluginDataRemover::OnChannelOpened(const IPC::ChannelHandle& handle) {
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
64 DCHECK(!channel_); 64 DCHECK(!channel_);
65 #if defined(OS_POSIX) 65 channel_ = new IPC::Channel(handle, IPC::Channel::MODE_CLIENT, this);
66 // If we received a ChannelHandle, register it now.
67 if (handle.socket.fd >= 0)
68 IPC::AddChannelSocket(handle.name, handle.socket.fd);
69 #endif
70 channel_ = new IPC::Channel(handle.name, IPC::Channel::MODE_CLIENT, this);
71 if (!channel_->Connect()) { 66 if (!channel_->Connect()) {
72 NOTREACHED() << "Couldn't connect to plugin"; 67 NOTREACHED() << "Couldn't connect to plugin";
73 SignalDone(); 68 SignalDone();
74 return; 69 return;
75 } 70 }
76 71
77 if (!channel_->Send( 72 if (!channel_->Send(
78 new PluginMsg_ClearSiteData(0, std::string(), begin_time_))) { 73 new PluginMsg_ClearSiteData(0, std::string(), begin_time_))) {
79 NOTREACHED() << "Couldn't send ClearSiteData message"; 74 NOTREACHED() << "Couldn't send ClearSiteData message";
80 SignalDone(); 75 SignalDone();
(...skipping 28 matching lines...) Expand all
109 SignalDone(); 104 SignalDone();
110 } 105 }
111 106
112 void PluginDataRemover::SignalDone() { 107 void PluginDataRemover::SignalDone() {
113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
114 if (!done_task_.get()) 109 if (!done_task_.get())
115 return; 110 return;
116 message_loop_->PostTask(FROM_HERE, done_task_.release()); 111 message_loop_->PostTask(FROM_HERE, done_task_.release());
117 message_loop_ = NULL; 112 message_loop_ = NULL;
118 } 113 }
OLDNEW
« no previous file with comments | « no previous file | chrome/gpu/gpu_channel.h » ('j') | ipc/ipc_channel.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698