summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 19:40:29 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 19:40:29 +0000
commit3c8bd9f45bfeb09acc2fbad3407e7b2c14d7c7be (patch)
treea4e06819ca0c59659ff8d4538c51bdbfd18e0873 /chrome/plugin
parent096d5cdd6c7b6930ca4a59bb965b5e4f6647f8e0 (diff)
downloadchromium_src-3c8bd9f45bfeb09acc2fbad3407e7b2c14d7c7be.zip
chromium_src-3c8bd9f45bfeb09acc2fbad3407e7b2c14d7c7be.tar.gz
chromium_src-3c8bd9f45bfeb09acc2fbad3407e7b2c14d7c7be.tar.bz2
Expose whether we're in private browsing mode to plugins.I chose to implement this for multi-process mode only and not --single-process or --in-process-plugins, since I wanted to send this data from the browser process, not the renderer (in case it's exploited).
BUG=158 Review URL: http://codereview.chromium.org/52037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/plugin_channel.cc2
-rw-r--r--chrome/plugin/plugin_channel.h4
-rw-r--r--chrome/plugin/plugin_thread.cc6
-rw-r--r--chrome/plugin/plugin_thread.h2
-rw-r--r--chrome/plugin/webplugin_proxy.cc4
-rw-r--r--chrome/plugin/webplugin_proxy.h2
6 files changed, 16 insertions, 4 deletions
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc
index 675a46f..125054a 100644
--- a/chrome/plugin/plugin_channel.cc
+++ b/chrome/plugin/plugin_channel.cc
@@ -27,7 +27,7 @@ PluginChannel* PluginChannel::GetPluginChannel(MessageLoop* ipc_message_loop) {
false));
}
-PluginChannel::PluginChannel() : in_send_(0) {
+PluginChannel::PluginChannel() : in_send_(0), off_the_record_(false) {
SendUnblockingOnlyDuringDispatch();
PluginProcess::current()->AddRefProcess();
const CommandLine* command_line = CommandLine::ForCurrentProcess();
diff --git a/chrome/plugin/plugin_channel.h b/chrome/plugin/plugin_channel.h
index 22ebbfa..94d18f9 100644
--- a/chrome/plugin/plugin_channel.h
+++ b/chrome/plugin/plugin_channel.h
@@ -26,6 +26,9 @@ class PluginChannel : public PluginChannelBase {
bool in_send() { return in_send_ != 0; }
+ bool off_the_record() { return off_the_record_; }
+ void set_off_the_record(bool value) { off_the_record_ = value; }
+
protected:
// IPC::Channel::Listener implementation:
virtual void OnChannelConnected(int32 peer_pid);
@@ -52,6 +55,7 @@ class PluginChannel : public PluginChannelBase {
int in_send_; // Tracks if we're in a Send call.
bool log_messages_; // True if we should log sent and received messages.
+ bool off_the_record_; // True if the renderer is in off the record mode.
DISALLOW_EVIL_CONSTRUCTORS(PluginChannel);
};
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc
index 5f26f71..10172e7 100644
--- a/chrome/plugin/plugin_thread.cc
+++ b/chrome/plugin/plugin_thread.cc
@@ -88,12 +88,14 @@ void PluginThread::CleanUp() {
ChildThread::CleanUp();
}
-void PluginThread::OnCreateChannel() {
+void PluginThread::OnCreateChannel(bool off_the_record) {
std::wstring channel_name;
scoped_refptr<PluginChannel> channel =
PluginChannel::GetPluginChannel(owner_loop());
- if (channel.get())
+ if (channel.get()) {
channel_name = channel->channel_name();
+ channel->set_off_the_record(off_the_record);
+ }
Send(new PluginProcessHostMsg_ChannelCreated(channel_name));
}
diff --git a/chrome/plugin/plugin_thread.h b/chrome/plugin/plugin_thread.h
index bcf926f..1550d5a 100644
--- a/chrome/plugin/plugin_thread.h
+++ b/chrome/plugin/plugin_thread.h
@@ -29,7 +29,7 @@ class PluginThread : public ChildThread {
virtual void Init();
virtual void CleanUp();
- void OnCreateChannel();
+ void OnCreateChannel(bool off_the_record);
void OnShutdownResponse(bool ok_to_shutdown);
void OnPluginMessage(const std::vector<uint8> &data);
void OnBrowserShutdown();
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index dbe9b5a..38310fb 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -439,3 +439,7 @@ void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) {
Paint(damaged_rect);
Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect));
}
+
+bool WebPluginProxy::IsOffTheRecord() {
+ return channel_->off_the_record();
+}
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 78ca43c..cba1ac5 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -94,6 +94,8 @@ class WebPluginProxy : public WebPlugin {
bool notify_needed,
HANDLE notify_data);
+ bool IsOffTheRecord();
+
base::WaitableEvent* modal_dialog_event() {
return modal_dialog_event_.get();
}