summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/ppapi_plugin_process_host.cc4
-rw-r--r--content/browser/ppapi_plugin_process_host.h3
-rw-r--r--content/browser/renderer_host/render_message_filter.cc8
-rw-r--r--content/ppapi_plugin/plugin_process_dispatcher.cc7
-rw-r--r--content/ppapi_plugin/plugin_process_dispatcher.h3
-rw-r--r--content/ppapi_plugin/ppapi_thread.cc9
-rw-r--r--content/ppapi_plugin/ppapi_thread.h4
-rw-r--r--ppapi/api/private/ppb_flash.idl8
-rw-r--r--ppapi/c/private/ppb_flash.h9
-rw-r--r--ppapi/proxy/plugin_dispatcher.cc6
-rw-r--r--ppapi/proxy/plugin_dispatcher.h8
-rw-r--r--ppapi/proxy/ppapi_messages.h5
-rw-r--r--ppapi/proxy/ppapi_proxy_test.cc6
-rw-r--r--ppapi/proxy/ppb_flash_proxy.cc2
14 files changed, 63 insertions, 19 deletions
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 491dade..48d019f 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -206,8 +206,8 @@ void PpapiPluginProcessHost::RequestPluginChannel(Client* client) {
// We can't send any sync messages from the browser because it might lead to
// a hang. See the similar code in PluginProcessHost for more description.
- PpapiMsg_CreateChannel* msg = new PpapiMsg_CreateChannel(process_handle,
- renderer_id);
+ PpapiMsg_CreateChannel* msg = new PpapiMsg_CreateChannel(
+ process_handle, renderer_id, client->OffTheRecord());
msg->set_unblock(true);
if (Send(msg)) {
sent_requests_.push(client);
diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h
index 3d7436e..6054a0d 100644
--- a/content/browser/ppapi_plugin_process_host.h
+++ b/content/browser/ppapi_plugin_process_host.h
@@ -48,6 +48,9 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate,
base::ProcessHandle plugin_process_handle,
const IPC::ChannelHandle& channel_handle,
int plugin_child_id) = 0;
+
+ // Returns true if the current connection is off-the-record.
+ virtual bool OffTheRecord() = 0;
};
class PluginClient : public Client {
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 879c2e6..248e563 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -138,6 +138,10 @@ class OpenChannelToPpapiPluginCallback
SendReplyAndDeleteThis();
}
+ virtual bool OffTheRecord() {
+ return filter()->OffTheRecord();
+ }
+
virtual content::ResourceContext* GetResourceContext() {
return context_;
}
@@ -175,6 +179,10 @@ class OpenChannelToPpapiBrokerCallback
delete this;
}
+ virtual bool OffTheRecord() {
+ return filter_->OffTheRecord();
+ }
+
private:
scoped_refptr<RenderMessageFilter> filter_;
int routing_id_;
diff --git a/content/ppapi_plugin/plugin_process_dispatcher.cc b/content/ppapi_plugin/plugin_process_dispatcher.cc
index 22c42c7..bf77c66 100644
--- a/content/ppapi_plugin/plugin_process_dispatcher.cc
+++ b/content/ppapi_plugin/plugin_process_dispatcher.cc
@@ -17,8 +17,11 @@ const int kPluginReleaseTimeSeconds = 30;
PluginProcessDispatcher::PluginProcessDispatcher(
base::ProcessHandle remote_process_handle,
- PP_GetInterface_Func get_interface)
- : ppapi::proxy::PluginDispatcher(remote_process_handle, get_interface) {
+ PP_GetInterface_Func get_interface,
+ bool incognito)
+ : ppapi::proxy::PluginDispatcher(remote_process_handle,
+ get_interface,
+ incognito) {
ChildProcess::current()->AddRefProcess();
}
diff --git a/content/ppapi_plugin/plugin_process_dispatcher.h b/content/ppapi_plugin/plugin_process_dispatcher.h
index 12455d8..631b0c1 100644
--- a/content/ppapi_plugin/plugin_process_dispatcher.h
+++ b/content/ppapi_plugin/plugin_process_dispatcher.h
@@ -14,7 +14,8 @@
class PluginProcessDispatcher : public ppapi::proxy::PluginDispatcher {
public:
PluginProcessDispatcher(base::ProcessHandle remote_process_handle,
- PP_GetInterface_Func get_interface);
+ PP_GetInterface_Func get_interface,
+ bool incognito);
virtual ~PluginProcessDispatcher();
private:
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index 1a4fa68..bf84ce2 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -248,10 +248,11 @@ void PpapiThread::OnMsgLoadPlugin(const FilePath& path) {
}
void PpapiThread::OnMsgCreateChannel(base::ProcessHandle host_process_handle,
- int renderer_id) {
+ int renderer_id,
+ bool incognito) {
IPC::ChannelHandle channel_handle;
if (!library_.is_valid() || // Plugin couldn't be loaded.
- !SetupRendererChannel(host_process_handle, renderer_id,
+ !SetupRendererChannel(host_process_handle, renderer_id, incognito,
&channel_handle)) {
Send(new PpapiHostMsg_ChannelCreated(IPC::ChannelHandle()));
return;
@@ -285,6 +286,7 @@ void PpapiThread::OnPluginDispatcherMessageReceived(const IPC::Message& msg) {
bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle,
int renderer_id,
+ bool incognito,
IPC::ChannelHandle* handle) {
DCHECK(is_broker_ == (connect_instance_func_ != NULL));
IPC::ChannelHandle plugin_handle;
@@ -304,7 +306,8 @@ bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle,
dispatcher = broker_dispatcher;
} else {
PluginProcessDispatcher* plugin_dispatcher =
- new PluginProcessDispatcher(host_process_handle, get_plugin_interface_);
+ new PluginProcessDispatcher(host_process_handle, get_plugin_interface_,
+ incognito);
init_result = plugin_dispatcher->InitPluginWithChannel(this,
plugin_handle,
false);
diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h
index fa071df..c416ba4 100644
--- a/content/ppapi_plugin/ppapi_thread.h
+++ b/content/ppapi_plugin/ppapi_thread.h
@@ -56,7 +56,8 @@ class PpapiThread : public ChildThread,
// Message handlers.
void OnMsgLoadPlugin(const FilePath& path);
void OnMsgCreateChannel(base::ProcessHandle host_process_handle,
- int renderer_id);
+ int renderer_id,
+ bool incognito);
void OnMsgSetNetworkState(bool online);
void OnPluginDispatcherMessageReceived(const IPC::Message& msg);
@@ -64,6 +65,7 @@ class PpapiThread : public ChildThread,
// fills the given ChannelHandle with the information from the new channel.
bool SetupRendererChannel(base::ProcessHandle host_process_handle,
int renderer_id,
+ bool incognito,
IPC::ChannelHandle* handle);
// Sets up the name of the plugin for logging using the given path.
diff --git a/ppapi/api/private/ppb_flash.idl b/ppapi/api/private/ppb_flash.idl
index a3c9b77..a08c4d0 100644
--- a/ppapi/api/private/ppb_flash.idl
+++ b/ppapi/api/private/ppb_flash.idl
@@ -28,7 +28,13 @@ enum PP_FlashSetting {
* created 3D context will use emulation because context initialization
* failed.
*/
- PP_FLASHSETTING_3DENABLED = 1
+ PP_FLASHSETTING_3DENABLED = 1,
+
+ /**
+ * Specifies if the given instance is in private/inconito/off-the-record mode
+ * (returns 1) or "regular" mode (returns 0). Returns -1 on invalid instance.
+ */
+ PP_FLASHSETTING_INCOGNITO = 2
};
/**
diff --git a/ppapi/c/private/ppb_flash.h b/ppapi/c/private/ppb_flash.h
index 632285c8d..b7dc4bc 100644
--- a/ppapi/c/private/ppb_flash.h
+++ b/ppapi/c/private/ppb_flash.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_flash.idl modified Fri Apr 27 10:13:19 2012. */
+/* From private/ppb_flash.idl modified Tue May 01 16:01:19 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_
#define PPAPI_C_PRIVATE_PPB_FLASH_H_
@@ -50,7 +50,12 @@ typedef enum {
* created 3D context will use emulation because context initialization
* failed.
*/
- PP_FLASHSETTING_3DENABLED = 1
+ PP_FLASHSETTING_3DENABLED = 1,
+ /**
+ * Specifies if the given instance is in private/inconito/off-the-record mode
+ * (returns 1) or "regular" mode (returns 0). Returns -1 on invalid instance.
+ */
+ PP_FLASHSETTING_INCOGNITO = 2
} PP_FlashSetting;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashSetting, 4);
/**
diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc
index c5cb90e..1e3fc25 100644
--- a/ppapi/proxy/plugin_dispatcher.cc
+++ b/ppapi/proxy/plugin_dispatcher.cc
@@ -59,11 +59,13 @@ InstanceData::~InstanceData() {
}
PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle,
- PP_GetInterface_Func get_interface)
+ PP_GetInterface_Func get_interface,
+ bool incognito)
: Dispatcher(remote_process_handle, get_interface),
plugin_delegate_(NULL),
received_preferences_(false),
- plugin_dispatcher_id_(0) {
+ plugin_dispatcher_id_(0),
+ incognito_(incognito) {
SetSerializationRules(new PluginVarSerializationRules(AsWeakPtr()));
if (!g_live_dispatchers)
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 129a37ca..3e43bf2 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -71,7 +71,8 @@ class PPAPI_PROXY_EXPORT PluginDispatcher
//
// You must call InitPluginWithChannel after the constructor.
PluginDispatcher(base::ProcessHandle remote_process_handle,
- PP_GetInterface_Func get_interface);
+ PP_GetInterface_Func get_interface,
+ bool incognito);
virtual ~PluginDispatcher();
// The plugin side maintains a mapping from PP_Instance to Dispatcher so
@@ -131,6 +132,7 @@ class PPAPI_PROXY_EXPORT PluginDispatcher
const Preferences& preferences() const { return preferences_; }
uint32 plugin_dispatcher_id() const { return plugin_dispatcher_id_; }
+ bool incognito() const { return incognito_; }
private:
friend class PluginDispatcherTest;
@@ -162,6 +164,10 @@ class PPAPI_PROXY_EXPORT PluginDispatcher
uint32 plugin_dispatcher_id_;
+ // Set to true when the instances associated with this dispatcher are
+ // incognito mode.
+ bool incognito_;
+
DISALLOW_COPY_AND_ASSIGN(PluginDispatcher);
};
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index bc058f3..78156a8 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -209,9 +209,10 @@ IPC_MESSAGE_CONTROL1(PpapiMsg_LoadPlugin, FilePath /* path */)
// Creates a channel to talk to a renderer. The plugin will respond with
// PpapiHostMsg_ChannelCreated.
-IPC_MESSAGE_CONTROL2(PpapiMsg_CreateChannel,
+IPC_MESSAGE_CONTROL3(PpapiMsg_CreateChannel,
base::ProcessHandle /* host_process_handle */,
- int /* renderer_id */)
+ int /* renderer_id */,
+ bool /* incognito */)
// Each plugin may be referenced by multiple renderers. We need the instance
// IDs to be unique within a plugin, despite coming from different renderers,
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc
index 98baafd..e1fb6e7 100644
--- a/ppapi/proxy/ppapi_proxy_test.cc
+++ b/ppapi/proxy/ppapi_proxy_test.cc
@@ -158,7 +158,8 @@ void PluginProxyTestHarness::SetUpHarness() {
plugin_dispatcher_.reset(new PluginDispatcher(
base::Process::Current().handle(),
- &MockGetInterface));
+ &MockGetInterface,
+ false));
plugin_dispatcher_->InitWithTestSink(&sink());
plugin_dispatcher_->DidCreateInstance(pp_instance());
}
@@ -175,7 +176,8 @@ void PluginProxyTestHarness::SetUpHarnessWithChannel(
plugin_dispatcher_.reset(new PluginDispatcher(
base::Process::Current().handle(),
- &MockGetInterface));
+ &MockGetInterface,
+ false));
plugin_dispatcher_->InitPluginWithChannel(&plugin_delegate_mock_,
channel_handle,
is_client);
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index 9442539..842abeb 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -561,6 +561,8 @@ int32_t PPB_Flash_Proxy::GetSettingInt(PP_Instance instance,
case PP_FLASHSETTING_3DENABLED:
return static_cast<PluginDispatcher*>(dispatcher())->preferences().
is_3d_supported;
+ case PP_FLASHSETTING_INCOGNITO:
+ return static_cast<PluginDispatcher*>(dispatcher())->incognito();
default:
return -1;
}