summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/content_renderer.gypi8
-rw-r--r--content/renderer/pepper/pepper_broker.cc12
-rw-r--r--content/renderer/pepper/pepper_broker.h7
-rw-r--r--content/renderer/pepper/pepper_broker_unittest.cc2
-rw-r--r--content/renderer/pepper/pepper_browser_connection.cc25
-rw-r--r--content/renderer/pepper/pepper_browser_connection.h8
-rw-r--r--content/renderer/pepper/pepper_file_io_host.cc11
-rw-r--r--content/renderer/pepper/pepper_helper_impl.cc (renamed from content/renderer/pepper/pepper_plugin_delegate_impl.cc)142
-rw-r--r--content/renderer/pepper/pepper_helper_impl.h (renamed from content/renderer/pepper/pepper_plugin_delegate_impl.h)23
-rw-r--r--content/renderer/pepper/pepper_platform_audio_output.cc2
-rw-r--r--content/renderer/pepper/pepper_platform_video_capture.cc2
-rw-r--r--content/renderer/pepper/pepper_platform_video_capture.h2
-rw-r--r--content/renderer/pepper/pepper_plugin_instance_impl.cc47
-rw-r--r--content/renderer/pepper/pepper_plugin_instance_impl.h14
-rw-r--r--content/renderer/pepper/pepper_webplugin_impl.cc4
-rw-r--r--content/renderer/pepper/pepper_webplugin_impl.h4
-rw-r--r--content/renderer/pepper/plugin_module.cc4
-rw-r--r--content/renderer/pepper/plugin_module.h6
-rw-r--r--content/renderer/pepper/ppb_broker_impl.cc4
-rw-r--r--content/renderer/pepper/ppb_file_ref_impl.cc6
-rw-r--r--content/renderer/pepper/ppb_image_data_impl.cc3
-rw-r--r--content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc31
-rw-r--r--content/renderer/pepper/ppb_tcp_server_socket_private_impl.h4
-rw-r--r--content/renderer/pepper/ppb_tcp_socket_private_impl.cc71
-rw-r--r--content/renderer/pepper/ppb_tcp_socket_private_impl.h4
-rw-r--r--content/renderer/pepper/ppb_video_decoder_impl.cc7
-rw-r--r--content/renderer/pepper/renderer_ppapi_host_impl.cc14
-rw-r--r--content/renderer/pepper/resource_helper.cc5
-rw-r--r--content/renderer/pepper/resource_helper.h5
-rw-r--r--content/renderer/pepper/url_request_info_util.cc5
-rw-r--r--content/renderer/pepper_helper.cc49
-rw-r--r--content/renderer/pepper_helper.h (renamed from content/renderer/render_view_pepper_helper.h)14
-rw-r--r--content/renderer/render_view_browsertest.cc6
-rw-r--r--content/renderer/render_view_impl.cc6
-rw-r--r--content/renderer/render_view_impl.h4
-rw-r--r--content/renderer/render_view_pepper_helper.cc50
36 files changed, 294 insertions, 317 deletions
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index 4443522..df47403 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -303,6 +303,8 @@
'renderer/pepper/pepper_file_system_host.h',
'renderer/pepper/pepper_graphics_2d_host.cc',
'renderer/pepper/pepper_graphics_2d_host.h',
+ 'renderer/pepper/pepper_helper_impl.cc',
+ 'renderer/pepper/pepper_helper_impl.h',
'renderer/pepper/pepper_hung_plugin_filter.cc',
'renderer/pepper/pepper_hung_plugin_filter.h',
'renderer/pepper/pepper_in_process_resource_creation.cc',
@@ -319,8 +321,6 @@
'renderer/pepper/pepper_platform_context_3d.h',
'renderer/pepper/pepper_platform_video_capture.cc',
'renderer/pepper/pepper_platform_video_capture.h',
- 'renderer/pepper/pepper_plugin_delegate_impl.cc',
- 'renderer/pepper/pepper_plugin_delegate_impl.h',
'renderer/pepper/pepper_plugin_instance_impl.cc',
'renderer/pepper/pepper_plugin_instance_impl.h',
'renderer/pepper/pepper_plugin_registry.cc',
@@ -431,6 +431,8 @@
'renderer/fetchers/resource_fetcher.h',
'renderer/ime_event_guard.cc',
'renderer/ime_event_guard.h',
+ 'renderer/pepper_helper.cc',
+ 'renderer/pepper_helper.h',
'renderer/render_frame_impl.cc',
'renderer/render_frame_impl.h',
'renderer/render_process.h',
@@ -448,8 +450,6 @@
'renderer/render_view_linux.cc',
'renderer/render_view_mouse_lock_dispatcher.cc',
'renderer/render_view_mouse_lock_dispatcher.h',
- 'renderer/render_view_pepper_helper.cc',
- 'renderer/render_view_pepper_helper.h',
'renderer/render_widget.cc',
'renderer/render_widget.h',
'renderer/render_widget_fullscreen.cc',
diff --git a/content/renderer/pepper/pepper_broker.cc b/content/renderer/pepper/pepper_broker.cc
index cfde183..623ead7 100644
--- a/content/renderer/pepper/pepper_broker.cc
+++ b/content/renderer/pepper/pepper_broker.cc
@@ -5,7 +5,7 @@
#include "content/renderer/pepper/pepper_broker.h"
#include "build/build_config.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/pepper/ppb_broker_impl.h"
@@ -108,11 +108,11 @@ int32_t PepperBrokerDispatcherWrapper::SendHandleToBroker(
}
PepperBroker::PepperBroker(PluginModule* plugin_module,
- PepperPluginDelegateImpl* delegate)
+ PepperHelperImpl* helper)
: plugin_module_(plugin_module),
- delegate_(delegate->AsWeakPtr()) {
+ helper_(helper->AsWeakPtr()) {
DCHECK(plugin_module_);
- DCHECK(delegate_.get());
+ DCHECK(helper_.get());
plugin_module_->SetBroker(this);
}
@@ -160,8 +160,8 @@ void PepperBroker::Disconnect(PPB_Broker_Impl* client) {
// instance of this object.
// This doesn't solve all potential problems, but it helps with the ones
// we can influence.
- if (delegate_.get()) {
- bool stopped = delegate_->StopWaitingForBrokerConnection(this);
+ if (helper_.get()) {
+ bool stopped = helper_->StopWaitingForBrokerConnection(this);
// Verify the assumption that there are no references other than the one
// |client| holds, which will be released below.
diff --git a/content/renderer/pepper/pepper_broker.h b/content/renderer/pepper/pepper_broker.h
index 4afb993..426015c 100644
--- a/content/renderer/pepper/pepper_broker.h
+++ b/content/renderer/pepper/pepper_broker.h
@@ -24,7 +24,7 @@ class BrokerDispatcher;
namespace content {
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PluginModule;
// This object is NOT thread-safe.
@@ -46,8 +46,7 @@ class CONTENT_EXPORT PepperBrokerDispatcherWrapper {
class PepperBroker : public base::RefCountedThreadSafe<PepperBroker>{
public:
- PepperBroker(PluginModule* plugin_module,
- PepperPluginDelegateImpl* delegate_);
+ PepperBroker(PluginModule* plugin_module, PepperHelperImpl* helper);
// Decrements the references to the broker.
// When there are no more references, this renderer's dispatcher is
@@ -98,7 +97,7 @@ class PepperBroker : public base::RefCountedThreadSafe<PepperBroker>{
// Always set and cleared at the same time as the module's pointer to this.
PluginModule* plugin_module_;
- base::WeakPtr<PepperPluginDelegateImpl> delegate_;
+ base::WeakPtr<PepperHelperImpl> helper_;
DISALLOW_COPY_AND_ASSIGN(PepperBroker);
};
diff --git a/content/renderer/pepper/pepper_broker_unittest.cc b/content/renderer/pepper/pepper_broker_unittest.cc
index 7c2ee9d..5267beb 100644
--- a/content/renderer/pepper/pepper_broker_unittest.cc
+++ b/content/renderer/pepper/pepper_broker_unittest.cc
@@ -38,7 +38,7 @@ TEST_F(PepperBrokerTest, InitFailure) {
// On valid ChannelHandle, initialization should succeed.
TEST_F(PepperBrokerTest, InitSuccess) {
PepperBrokerDispatcherWrapper dispatcher_wrapper;
- const char kChannelName[] = "PepperPluginDelegateImplTestChannelName";
+ const char kChannelName[] = "PepperHelperImplTestChannelName";
#if defined(OS_POSIX)
int fds[2] = {-1, -1};
ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, fds));
diff --git a/content/renderer/pepper/pepper_browser_connection.cc b/content/renderer/pepper/pepper_browser_connection.cc
index 8cc5c28..08e3cd9 100644
--- a/content/renderer/pepper/pepper_browser_connection.cc
+++ b/content/renderer/pepper/pepper_browser_connection.cc
@@ -7,7 +7,7 @@
#include <limits>
#include "base/logging.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/render_view_impl.h"
#include "ipc/ipc_message_macros.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -15,9 +15,8 @@
namespace content {
-PepperBrowserConnection::PepperBrowserConnection(
- PepperPluginDelegateImpl* plugin_delegate)
- : plugin_delegate_(plugin_delegate),
+PepperBrowserConnection::PepperBrowserConnection(PepperHelperImpl* helper)
+ : helper_(helper),
next_sequence_number_(1) {
}
@@ -43,13 +42,12 @@ void PepperBrowserConnection::SendBrowserCreate(
int32_t sequence_number = GetNextSequence();
pending_create_map_[sequence_number] = callback;
ppapi::proxy::ResourceMessageCallParams params(0, sequence_number);
- plugin_delegate_->Send(
- new PpapiHostMsg_CreateResourceHostFromHost(
- plugin_delegate_->routing_id(),
- child_process_id,
- params,
- instance,
- nested_msg));
+ helper_->Send(new PpapiHostMsg_CreateResourceHostFromHost(
+ helper_->routing_id(),
+ child_process_id,
+ params,
+ instance,
+ nested_msg));
}
void PepperBrowserConnection::SendBrowserFileRefGetInfo(
@@ -59,9 +57,8 @@ void PepperBrowserConnection::SendBrowserFileRefGetInfo(
int32_t sequence_number = GetNextSequence();
get_info_map_[sequence_number] = callback;
ppapi::proxy::ResourceMessageCallParams params(resource, sequence_number);
- plugin_delegate_->Send(
- new PpapiHostMsg_FileRef_GetInfoForRenderer(
- plugin_delegate_->routing_id(), child_process_id, params));
+ helper_->Send(new PpapiHostMsg_FileRef_GetInfoForRenderer(
+ helper_->routing_id(), child_process_id, params));
}
void PepperBrowserConnection::OnMsgCreateResourceHostFromHostReply(
diff --git a/content/renderer/pepper/pepper_browser_connection.h b/content/renderer/pepper/pepper_browser_connection.h
index 12e403c..03e90b3 100644
--- a/content/renderer/pepper/pepper_browser_connection.h
+++ b/content/renderer/pepper/pepper_browser_connection.h
@@ -17,7 +17,7 @@
namespace content {
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
// This class represents a connection from the renderer to the browser for
// sending/receiving pepper ResourceHost related messages. When the browser
@@ -30,7 +30,7 @@ class PepperBrowserConnection {
std::string,
base::FilePath)> FileRefGetInfoCallback;
- explicit PepperBrowserConnection(PepperPluginDelegateImpl* plugin_delegate);
+ explicit PepperBrowserConnection(PepperHelperImpl* helper);
virtual ~PepperBrowserConnection();
bool OnMessageReceived(const IPC::Message& message);
@@ -65,8 +65,8 @@ class PepperBrowserConnection {
// Return the next sequence number.
int32_t GetNextSequence();
- // The plugin delegate that owns us.
- PepperPluginDelegateImpl* plugin_delegate_;
+ // The plugin helper that owns us.
+ PepperHelperImpl* helper_;
// Sequence number to track pending callbacks.
int32_t next_sequence_number_;
diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc
index 155a3b2..4750f8f 100644
--- a/content/renderer/pepper/pepper_file_io_host.cc
+++ b/content/renderer/pepper/pepper_file_io_host.cc
@@ -16,7 +16,7 @@
#include "content/public/common/content_client.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/pepper/host_globals.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/ppb_file_ref_impl.h"
#include "content/renderer/pepper/quota_file_io.h"
@@ -227,12 +227,11 @@ int32_t PepperFileIOHost::OnHostMsgOpen(
base::Bind(&DidOpenFileSystemURL, callback),
base::Bind(&DidFailOpenFileSystemURL, callback));
} else {
- PepperPluginDelegateImpl* plugin_delegate =
- static_cast<PepperPluginInstanceImpl*>(
- PepperPluginInstance::Get(pp_instance()))->delegate();
- if (file_system_type_ != PP_FILESYSTEMTYPE_EXTERNAL || !plugin_delegate)
+ PepperHelperImpl* helper = static_cast<PepperPluginInstanceImpl*>(
+ PepperPluginInstance::Get(pp_instance()))->helper();
+ if (file_system_type_ != PP_FILESYSTEMTYPE_EXTERNAL || !helper)
return PP_ERROR_FAILED;
- if (!plugin_delegate->AsyncOpenFile(
+ if (!helper->AsyncOpenFile(
file_ref->GetSystemPath(), flags,
base::Bind(&PepperFileIOHost::ExecutePlatformOpenFileCallback,
weak_factory_.GetWeakPtr(),
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_helper_impl.cc
index 682fe0f..d6bb5fc 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_helper_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include <cmath>
#include <cstddef>
@@ -111,7 +111,7 @@ void CreateHostForInProcessModule(RenderViewImpl* render_view,
} // namespace
-PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderViewImpl* render_view)
+PepperHelperImpl::PepperHelperImpl(RenderViewImpl* render_view)
: RenderViewObserver(render_view),
render_view_(render_view),
pepper_browser_connection_(this),
@@ -119,10 +119,10 @@ PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderViewImpl* render_view)
last_mouse_event_target_(NULL) {
}
-PepperPluginDelegateImpl::~PepperPluginDelegateImpl() {
+PepperHelperImpl::~PepperHelperImpl() {
}
-WebKit::WebPlugin* PepperPluginDelegateImpl::CreatePepperWebPlugin(
+WebKit::WebPlugin* PepperHelperImpl::CreatePepperWebPlugin(
const WebPluginInfo& webplugin_info,
const WebKit::WebPluginParams& params) {
bool pepper_plugin_was_registered = false;
@@ -139,7 +139,7 @@ WebKit::WebPlugin* PepperPluginDelegateImpl::CreatePepperWebPlugin(
return NULL;
}
-scoped_refptr<PluginModule> PepperPluginDelegateImpl::CreatePepperPluginModule(
+scoped_refptr<PluginModule> PepperHelperImpl::CreatePepperPluginModule(
const WebPluginInfo& webplugin_info,
bool* pepper_plugin_was_registered) {
*pepper_plugin_was_registered = true;
@@ -202,7 +202,7 @@ scoped_refptr<PluginModule> PepperPluginDelegateImpl::CreatePepperPluginModule(
return module;
}
-scoped_refptr<PepperBroker> PepperPluginDelegateImpl::CreateBroker(
+scoped_refptr<PepperBroker> PepperHelperImpl::CreateBroker(
PluginModule* plugin_module) {
DCHECK(plugin_module);
DCHECK(!plugin_module->GetBroker());
@@ -222,7 +222,7 @@ scoped_refptr<PepperBroker> PepperPluginDelegateImpl::CreateBroker(
return broker;
}
-RendererPpapiHost* PepperPluginDelegateImpl::CreateOutOfProcessModule(
+RendererPpapiHost* PepperHelperImpl::CreateOutOfProcessModule(
PluginModule* module,
const base::FilePath& path,
ppapi::PpapiPermissions permissions,
@@ -254,7 +254,7 @@ RendererPpapiHost* PepperPluginDelegateImpl::CreateOutOfProcessModule(
return host_impl;
}
-void PepperPluginDelegateImpl::OnPpapiBrokerChannelCreated(
+void PepperHelperImpl::OnPpapiBrokerChannelCreated(
int request_id,
base::ProcessId broker_pid,
const IPC::ChannelHandle& handle) {
@@ -277,7 +277,7 @@ void PepperPluginDelegateImpl::OnPpapiBrokerChannelCreated(
// Iterates through pending_connect_broker_ to find the broker.
// Cannot use Lookup() directly because pending_connect_broker_ does not store
// the raw pointer to the broker. Assumes maximum of one copy of broker exists.
-bool PepperPluginDelegateImpl::StopWaitingForBrokerConnection(
+bool PepperHelperImpl::StopWaitingForBrokerConnection(
PepperBroker* broker) {
for (BrokerMap::iterator i(&pending_connect_broker_);
!i.IsAtEnd(); i.Advance()) {
@@ -290,7 +290,7 @@ bool PepperPluginDelegateImpl::StopWaitingForBrokerConnection(
return false;
}
-void PepperPluginDelegateImpl::ViewWillInitiatePaint() {
+void PepperHelperImpl::ViewWillInitiatePaint() {
// Notify all of our instances that we started painting. This is used for
// internal bookkeeping only, so we know that the set can not change under
// us.
@@ -300,7 +300,7 @@ void PepperPluginDelegateImpl::ViewWillInitiatePaint() {
(*i)->ViewWillInitiatePaint();
}
-void PepperPluginDelegateImpl::ViewInitiatedPaint() {
+void PepperHelperImpl::ViewInitiatedPaint() {
// Notify all instances that we painted. The same caveats apply as for
// ViewFlushedPaint regarding instances closing themselves, so we take
// similar precautions.
@@ -312,7 +312,7 @@ void PepperPluginDelegateImpl::ViewInitiatedPaint() {
}
}
-void PepperPluginDelegateImpl::ViewFlushedPaint() {
+void PepperHelperImpl::ViewFlushedPaint() {
// Notify all instances that we flushed. This will call into the plugin, and
// we it may ask to close itself as a result. This will, in turn, modify our
// set, possibly invalidating the iterator. So we iterate on a copy that
@@ -341,13 +341,12 @@ void PepperPluginDelegateImpl::ViewFlushedPaint() {
}
}
-PepperPluginInstanceImpl* PepperPluginDelegateImpl::
- GetBitmapForOptimizedPluginPaint(
- const gfx::Rect& paint_bounds,
- TransportDIB** dib,
- gfx::Rect* location,
- gfx::Rect* clip,
- float* scale_factor) {
+PepperPluginInstanceImpl* PepperHelperImpl::GetBitmapForOptimizedPluginPaint(
+ const gfx::Rect& paint_bounds,
+ TransportDIB** dib,
+ gfx::Rect* location,
+ gfx::Rect* clip,
+ float* scale_factor) {
for (std::set<PepperPluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i) {
@@ -362,7 +361,7 @@ PepperPluginInstanceImpl* PepperPluginDelegateImpl::
return NULL;
}
-void PepperPluginDelegateImpl::PluginFocusChanged(
+void PepperHelperImpl::PluginFocusChanged(
PepperPluginInstanceImpl* instance,
bool focused) {
if (focused)
@@ -373,31 +372,31 @@ void PepperPluginDelegateImpl::PluginFocusChanged(
render_view_->PpapiPluginFocusChanged();
}
-void PepperPluginDelegateImpl::PluginTextInputTypeChanged(
+void PepperHelperImpl::PluginTextInputTypeChanged(
PepperPluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginTextInputTypeChanged();
}
-void PepperPluginDelegateImpl::PluginCaretPositionChanged(
+void PepperHelperImpl::PluginCaretPositionChanged(
PepperPluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginCaretPositionChanged();
}
-void PepperPluginDelegateImpl::PluginRequestedCancelComposition(
+void PepperHelperImpl::PluginRequestedCancelComposition(
PepperPluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginCancelComposition();
}
-void PepperPluginDelegateImpl::PluginSelectionChanged(
+void PepperHelperImpl::PluginSelectionChanged(
PepperPluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginSelectionChanged();
}
-void PepperPluginDelegateImpl::OnImeSetComposition(
+void PepperHelperImpl::OnImeSetComposition(
const string16& text,
const std::vector<WebKit::WebCompositionUnderline>& underlines,
int selection_start,
@@ -425,7 +424,7 @@ void PepperPluginDelegateImpl::OnImeSetComposition(
}
}
-void PepperPluginDelegateImpl::OnImeConfirmComposition(const string16& text) {
+void PepperHelperImpl::OnImeConfirmComposition(const string16& text) {
// Here, text.empty() has a special meaning. It means to commit the last
// update of composition text (see RenderWidgetHost::ImeConfirmComposition()).
const string16& last_text = text.empty() ? composition_text_ : text;
@@ -456,36 +455,36 @@ void PepperPluginDelegateImpl::OnImeConfirmComposition(const string16& text) {
composition_text_.clear();
}
-gfx::Rect PepperPluginDelegateImpl::GetCaretBounds() const {
+gfx::Rect PepperHelperImpl::GetCaretBounds() const {
if (!focused_plugin_)
return gfx::Rect(0, 0, 0, 0);
return focused_plugin_->GetCaretBounds();
}
-ui::TextInputType PepperPluginDelegateImpl::GetTextInputType() const {
+ui::TextInputType PepperHelperImpl::GetTextInputType() const {
if (!focused_plugin_)
return ui::TEXT_INPUT_TYPE_NONE;
return focused_plugin_->text_input_type();
}
-void PepperPluginDelegateImpl::GetSurroundingText(string16* text,
- ui::Range* range) const {
+void PepperHelperImpl::GetSurroundingText(string16* text,
+ ui::Range* range) const {
if (!focused_plugin_)
return;
return focused_plugin_->GetSurroundingText(text, range);
}
-bool PepperPluginDelegateImpl::IsPluginAcceptingCompositionEvents() const {
+bool PepperHelperImpl::IsPluginAcceptingCompositionEvents() const {
if (!focused_plugin_)
return false;
return focused_plugin_->IsPluginAcceptingCompositionEvents();
}
-bool PepperPluginDelegateImpl::CanComposeInline() const {
+bool PepperHelperImpl::CanComposeInline() const {
return IsPluginAcceptingCompositionEvents();
}
-void PepperPluginDelegateImpl::InstanceCreated(
+void PepperHelperImpl::InstanceCreated(
PepperPluginInstanceImpl* instance) {
active_instances_.insert(instance);
@@ -493,7 +492,7 @@ void PepperPluginDelegateImpl::InstanceCreated(
instance->SetContentAreaFocus(render_view_->has_focus());
}
-void PepperPluginDelegateImpl::InstanceDeleted(
+void PepperHelperImpl::InstanceDeleted(
PepperPluginInstanceImpl* instance) {
active_instances_.erase(instance);
@@ -504,7 +503,7 @@ void PepperPluginDelegateImpl::InstanceDeleted(
}
// If a broker has not already been created for this plugin, creates one.
-PepperBroker* PepperPluginDelegateImpl::ConnectToBroker(
+PepperBroker* PepperHelperImpl::ConnectToBroker(
PPB_Broker_Impl* client) {
DCHECK(client);
@@ -532,9 +531,8 @@ PepperBroker* PepperPluginDelegateImpl::ConnectToBroker(
return broker.get();
}
-void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult(
- int request_id,
- bool result) {
+void PepperHelperImpl::OnPpapiBrokerPermissionResult(int request_id,
+ bool result) {
scoped_ptr<base::WeakPtr<PPB_Broker_Impl> > client_ptr(
pending_permission_requests_.Lookup(request_id));
DCHECK(client_ptr.get());
@@ -551,17 +549,16 @@ void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult(
broker->OnBrokerPermissionResult(client.get(), result);
}
-bool PepperPluginDelegateImpl::AsyncOpenFile(
- const base::FilePath& path,
- int flags,
- const AsyncOpenFileCallback& callback) {
+bool PepperHelperImpl::AsyncOpenFile(const base::FilePath& path,
+ int flags,
+ const AsyncOpenFileCallback& callback) {
int message_id = pending_async_open_files_.Add(
new AsyncOpenFileCallback(callback));
return Send(new ViewHostMsg_AsyncOpenFile(
routing_id(), path, flags, message_id));
}
-void PepperPluginDelegateImpl::OnAsyncFileOpened(
+void PepperHelperImpl::OnAsyncFileOpened(
base::PlatformFileError error_code,
IPC::PlatformFileForTransit file_for_transit,
int message_id) {
@@ -583,25 +580,25 @@ void PepperPluginDelegateImpl::OnAsyncFileOpened(
delete callback;
}
-void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) {
+void PepperHelperImpl::OnSetFocus(bool has_focus) {
for (std::set<PepperPluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i)
(*i)->SetContentAreaFocus(has_focus);
}
-void PepperPluginDelegateImpl::PageVisibilityChanged(bool is_visible) {
+void PepperHelperImpl::PageVisibilityChanged(bool is_visible) {
for (std::set<PepperPluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i)
(*i)->PageVisibilityChanged(is_visible);
}
-bool PepperPluginDelegateImpl::IsPluginFocused() const {
+bool PepperHelperImpl::IsPluginFocused() const {
return focused_plugin_ != NULL;
}
-void PepperPluginDelegateImpl::WillHandleMouseEvent() {
+void PepperHelperImpl::WillHandleMouseEvent() {
// This method is called for every mouse event that the render view receives.
// And then the mouse event is forwarded to WebKit, which dispatches it to the
// event target. Potentially a Pepper plugin will receive the event.
@@ -612,24 +609,24 @@ void PepperPluginDelegateImpl::WillHandleMouseEvent() {
last_mouse_event_target_ = NULL;
}
-void PepperPluginDelegateImpl::RegisterTCPSocket(
+void PepperHelperImpl::RegisterTCPSocket(
PPB_TCPSocket_Private_Impl* socket,
uint32 socket_id) {
tcp_sockets_.AddWithID(socket, socket_id);
}
-void PepperPluginDelegateImpl::UnregisterTCPSocket(uint32 socket_id) {
+void PepperHelperImpl::UnregisterTCPSocket(uint32 socket_id) {
// There is no DCHECK(tcp_sockets_.Lookup(socket_id)) because this method
// can be called before TCPSocketConnect or TCPSocketConnectWithNetAddress.
if (tcp_sockets_.Lookup(socket_id))
tcp_sockets_.Remove(socket_id);
}
-void PepperPluginDelegateImpl::TCPServerSocketStopListening(uint32 socket_id) {
+void PepperHelperImpl::TCPServerSocketStopListening(uint32 socket_id) {
tcp_server_sockets_.Remove(socket_id);
}
-void PepperPluginDelegateImpl::HandleDocumentLoad(
+void PepperHelperImpl::HandleDocumentLoad(
PepperPluginInstanceImpl* instance,
const WebKit::WebURLResponse& response) {
DCHECK(!instance->document_loader());
@@ -686,7 +683,7 @@ void PepperPluginDelegateImpl::HandleDocumentLoad(
}
}
-RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule(
+RendererPpapiHost* PepperHelperImpl::CreateExternalPluginModule(
scoped_refptr<PluginModule> module,
const base::FilePath& path,
ppapi::PpapiPermissions permissions,
@@ -704,9 +701,8 @@ RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule(
true); // is_external = true
}
-void PepperPluginDelegateImpl::DidChangeCursor(
- PepperPluginInstanceImpl* instance,
- const WebKit::WebCursorInfo& cursor) {
+void PepperHelperImpl::DidChangeCursor(PepperPluginInstanceImpl* instance,
+ const WebKit::WebCursorInfo& cursor) {
// Update the cursor appearance immediately if the requesting plugin is the
// one which receives the last mouse event. Otherwise, the new cursor won't be
// picked up until the plugin gets the next input event. That is bad if, e.g.,
@@ -716,23 +712,23 @@ void PepperPluginDelegateImpl::DidChangeCursor(
render_view_->didChangeCursor(cursor);
}
-void PepperPluginDelegateImpl::DidReceiveMouseEvent(
+void PepperHelperImpl::DidReceiveMouseEvent(
PepperPluginInstanceImpl* instance) {
last_mouse_event_target_ = instance;
}
-void PepperPluginDelegateImpl::SampleGamepads(WebKit::WebGamepads* data) {
+void PepperHelperImpl::SampleGamepads(WebKit::WebGamepads* data) {
if (!gamepad_shared_memory_reader_)
gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader);
gamepad_shared_memory_reader_->SampleGamepads(*data);
}
-bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) {
+bool PepperHelperImpl::OnMessageReceived(const IPC::Message& message) {
if (pepper_browser_connection_.OnMessageReceived(message))
return true;
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message)
+ IPC_BEGIN_MESSAGE_MAP(PepperHelperImpl, message)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK,
OnTCPSocketConnectACK)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK,
@@ -755,13 +751,13 @@ bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void PepperPluginDelegateImpl::OnDestruct() {
+void PepperHelperImpl::OnDestruct() {
// Nothing to do here. Default implementation in RenderViewObserver does
- // 'delete this' but it's not suitable for PepperPluginDelegateImpl because
+ // 'delete this' but it's not suitable for PepperHelperImpl because
// it's non-pointer member in RenderViewImpl.
}
-void PepperPluginDelegateImpl::OnTCPSocketConnectACK(
+void PepperHelperImpl::OnTCPSocketConnectACK(
uint32 plugin_dispatcher_id,
uint32 socket_id,
int32_t result,
@@ -774,7 +770,7 @@ void PepperPluginDelegateImpl::OnTCPSocketConnectACK(
tcp_sockets_.Remove(socket_id);
}
-void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK(
+void PepperHelperImpl::OnTCPSocketSSLHandshakeACK(
uint32 plugin_dispatcher_id,
uint32 socket_id,
bool succeeded,
@@ -784,24 +780,24 @@ void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK(
socket->OnSSLHandshakeCompleted(succeeded, certificate_fields);
}
-void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id,
- uint32 socket_id,
- int32_t result,
- const std::string& data) {
+void PepperHelperImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id,
+ uint32 socket_id,
+ int32_t result,
+ const std::string& data) {
PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
if (socket)
socket->OnReadCompleted(result, data);
}
-void PepperPluginDelegateImpl::OnTCPSocketWriteACK(uint32 plugin_dispatcher_id,
- uint32 socket_id,
- int32_t result) {
+void PepperHelperImpl::OnTCPSocketWriteACK(uint32 plugin_dispatcher_id,
+ uint32 socket_id,
+ int32_t result) {
PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
if (socket)
socket->OnWriteCompleted(result);
}
-void PepperPluginDelegateImpl::OnTCPSocketSetOptionACK(
+void PepperHelperImpl::OnTCPSocketSetOptionACK(
uint32 plugin_dispatcher_id,
uint32 socket_id,
int32_t result) {
@@ -810,7 +806,7 @@ void PepperPluginDelegateImpl::OnTCPSocketSetOptionACK(
socket->OnSetOptionCompleted(result);
}
-void PepperPluginDelegateImpl::OnTCPServerSocketListenACK(
+void PepperHelperImpl::OnTCPServerSocketListenACK(
uint32 plugin_dispatcher_id,
PP_Resource socket_resource,
uint32 socket_id,
@@ -830,7 +826,7 @@ void PepperPluginDelegateImpl::OnTCPServerSocketListenACK(
}
}
-void PepperPluginDelegateImpl::OnTCPServerSocketAcceptACK(
+void PepperHelperImpl::OnTCPServerSocketAcceptACK(
uint32 plugin_dispatcher_id,
uint32 server_socket_id,
uint32 accepted_socket_id,
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_helper_impl.h
index bd62a5a..f49fe08 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper/pepper_helper_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_
-#define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_
#include <map>
#include <set>
@@ -18,7 +18,7 @@
#include "base/observer_list.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/renderer/pepper/pepper_browser_connection.h"
-#include "content/renderer/render_view_pepper_helper.h"
+#include "content/renderer/pepper_helper.h"
#include "ipc/ipc_platform_file.h"
#include "ppapi/c/pp_file_info.h"
#include "ppapi/c/ppb_tcp_socket.h"
@@ -57,13 +57,12 @@ class PPB_TCPSocket_Private_Impl;
class RenderViewImpl;
struct WebPluginInfo;
-class PepperPluginDelegateImpl
- : public RenderViewPepperHelper,
- public base::SupportsWeakPtr<PepperPluginDelegateImpl>,
- public RenderViewObserver {
+class PepperHelperImpl : public PepperHelper,
+ public base::SupportsWeakPtr<PepperHelperImpl>,
+ public RenderViewObserver {
public:
- explicit PepperPluginDelegateImpl(RenderViewImpl* render_view);
- virtual ~PepperPluginDelegateImpl();
+ explicit PepperHelperImpl(RenderViewImpl* render_view);
+ virtual ~PepperHelperImpl();
RenderViewImpl* render_view() { return render_view_; }
@@ -145,7 +144,7 @@ class PepperPluginDelegateImpl
int plugin_child_id);
private:
- // RenderViewPepperHelper implementation.
+ // PepperHelper implementation.
virtual WebKit::WebPlugin* CreatePepperWebPlugin(
const WebPluginInfo& webplugin_info,
const WebKit::WebPluginParams& params) OVERRIDE;
@@ -282,9 +281,9 @@ class PepperPluginDelegateImpl
scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_;
- DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl);
+ DISALLOW_COPY_AND_ASSIGN(PepperHelperImpl);
};
} // namespace content
-#endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_
diff --git a/content/renderer/pepper/pepper_platform_audio_output.cc b/content/renderer/pepper/pepper_platform_audio_output.cc
index e6930d7..ba1bcab 100644
--- a/content/renderer/pepper/pepper_platform_audio_output.cc
+++ b/content/renderer/pepper/pepper_platform_audio_output.cc
@@ -166,7 +166,7 @@ void PepperPlatformAudioOutput::ShutDownOnIOThread() {
ipc_.reset();
Release(); // Release for the delegate, balances out the reference taken in
- // PepperPluginDelegateImpl::CreateAudio.
+ // PepperHelperImpl::CreateAudio.
}
} // namespace content
diff --git a/content/renderer/pepper/pepper_platform_video_capture.cc b/content/renderer/pepper/pepper_platform_video_capture.cc
index 72d42d1..e7070d3 100644
--- a/content/renderer/pepper/pepper_platform_video_capture.cc
+++ b/content/renderer/pepper/pepper_platform_video_capture.cc
@@ -8,8 +8,8 @@
#include "base/logging.h"
#include "base/message_loop/message_loop_proxy.h"
#include "content/renderer/media/video_capture_impl_manager.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_media_device_manager.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/pepper/pepper_video_capture_host.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
diff --git a/content/renderer/pepper/pepper_platform_video_capture.h b/content/renderer/pepper/pepper_platform_video_capture.h
index d525f5c..af06acf 100644
--- a/content/renderer/pepper/pepper_platform_video_capture.h
+++ b/content/renderer/pepper/pepper_platform_video_capture.h
@@ -21,8 +21,8 @@ class VideoCaptureHandlerProxy;
}
namespace content {
+class PepperHelperImpl;
class PepperMediaDeviceManager;
-class PepperPluginDelegateImpl;
class PepperVideoCaptureHost;
class RenderViewImpl;
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 4054aba..ad62135 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -27,8 +27,8 @@
#include "content/renderer/pepper/message_channel.h"
#include "content/renderer/pepper/npapi_glue.h"
#include "content/renderer/pepper/pepper_graphics_2d_host.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_platform_context_3d.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/pepper/plugin_object.h"
#include "content/renderer/pepper/ppb_buffer_impl.h"
@@ -352,7 +352,7 @@ class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget {
// static
PepperPluginInstanceImpl* PepperPluginInstanceImpl::Create(
- PepperPluginDelegateImpl* delegate,
+ PepperHelperImpl* helper,
RenderViewImpl* render_view,
PluginModule* module,
WebPluginContainer* container,
@@ -363,7 +363,7 @@ PepperPluginInstanceImpl* PepperPluginInstanceImpl::Create(
PPP_Instance_Combined::Create(get_plugin_interface_func);
if (!ppp_instance_combined)
return NULL;
- return new PepperPluginInstanceImpl(delegate, render_view, module,
+ return new PepperPluginInstanceImpl(helper, render_view, module,
ppp_instance_combined, container,
plugin_url);
}
@@ -413,10 +413,9 @@ void PepperPluginInstanceImpl::NaClDocumentLoader::didFail(
error_.reset(new WebURLError(error));
}
-PepperPluginInstanceImpl::GamepadImpl::GamepadImpl(
- PepperPluginDelegateImpl* delegate)
+PepperPluginInstanceImpl::GamepadImpl::GamepadImpl(PepperHelperImpl* helper)
: Resource(::ppapi::Resource::Untracked()),
- delegate_(delegate) {
+ helper_(helper) {
}
PepperPluginInstanceImpl::GamepadImpl::~GamepadImpl() {
@@ -430,19 +429,19 @@ void PepperPluginInstanceImpl::GamepadImpl::Sample(
PP_Instance instance,
PP_GamepadsSampleData* data) {
WebKit::WebGamepads webkit_data;
- delegate_->SampleGamepads(&webkit_data);
+ helper_->SampleGamepads(&webkit_data);
ConvertWebKitGamepadData(
*reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data);
}
PepperPluginInstanceImpl::PepperPluginInstanceImpl(
- PepperPluginDelegateImpl* delegate,
+ PepperHelperImpl* helper,
RenderViewImpl* render_view,
PluginModule* module,
::ppapi::PPP_Instance_Combined* instance_interface,
WebPluginContainer* container,
const GURL& plugin_url)
- : delegate_(delegate),
+ : helper_(helper),
render_view_(render_view),
module_(module),
instance_interface_(instance_interface),
@@ -469,7 +468,7 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
checked_for_plugin_input_event_interface_(false),
checked_for_plugin_messaging_interface_(false),
checked_for_plugin_pdf_interface_(false),
- gamepad_impl_(new GamepadImpl(delegate)),
+ gamepad_impl_(new GamepadImpl(helper)),
plugin_print_interface_(NULL),
plugin_graphics_3d_interface_(NULL),
always_on_top_(false),
@@ -495,8 +494,8 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
memset(&current_print_settings_, 0, sizeof(current_print_settings_));
module_->InstanceCreated(this);
- if (delegate_)
- delegate_->InstanceCreated(this);
+ if (helper_)
+ helper_->InstanceCreated(this);
if (render_view) // NULL in tests
view_data_.is_page_visible = !render_view->is_hidden();
@@ -533,8 +532,8 @@ PepperPluginInstanceImpl::~PepperPluginInstanceImpl() {
if (TrackedCallback::IsPending(lock_mouse_callback_))
lock_mouse_callback_->Abort();
- if (delegate_)
- delegate_->InstanceDeleted(this);
+ if (helper_)
+ helper_->InstanceDeleted(this);
UnSetAndDeleteLockTargetAdapter();
module_->InstanceDeleted(this);
// If we switched from the NaCl plugin module, notify it too.
@@ -718,7 +717,7 @@ bool PepperPluginInstanceImpl::HandleDocumentLoad(
container()->element().document().frame()->stopLoading();
return false;
}
- delegate_->HandleDocumentLoad(this, response);
+ helper_->HandleDocumentLoad(this, response);
// If the load was not abandoned, document_loader_ will now be set. It's
// possible that the load was canceled by now and document_loader_ was
// already nulled out.
@@ -893,7 +892,7 @@ bool PepperPluginInstanceImpl::HandleInputEvent(
TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent");
if (WebInputEvent::isMouseEventType(event.type)) {
- delegate_->DidReceiveMouseEvent(this);
+ helper_->DidReceiveMouseEvent(this);
}
// Don't dispatch input events to crashed plugins.
@@ -1333,10 +1332,10 @@ bool PepperPluginInstanceImpl::PluginHasFocus() const {
void PepperPluginInstanceImpl::SendFocusChangeNotification() {
// This call can happen during PepperPluginIn>stanceImpl destruction, because
// WebKit informs the plugin it's losing focus. See crbug.com/236574
- if (!delegate_ || !instance_interface_)
+ if (!helper_ || !instance_interface_)
return;
bool has_focus = PluginHasFocus();
- delegate_->PluginFocusChanged(this, has_focus);
+ helper_->PluginFocusChanged(this, has_focus);
instance_interface_->DidChangeFocus(pp_instance(), PP_FromBool(has_focus));
}
@@ -2345,7 +2344,7 @@ void PepperPluginInstanceImpl::SetTextInputType(PP_Instance instance,
if (itype < 0 || itype > ui::TEXT_INPUT_TYPE_URL)
itype = ui::TEXT_INPUT_TYPE_NONE;
text_input_type_ = static_cast<ui::TextInputType>(itype);
- delegate_->PluginTextInputTypeChanged(this);
+ helper_->PluginTextInputTypeChanged(this);
}
void PepperPluginInstanceImpl::UpdateCaretPosition(
@@ -2355,11 +2354,11 @@ void PepperPluginInstanceImpl::UpdateCaretPosition(
text_input_caret_ = PP_ToGfxRect(caret);
text_input_caret_bounds_ = PP_ToGfxRect(bounding_box);
text_input_caret_set_ = true;
- delegate_->PluginCaretPositionChanged(this);
+ helper_->PluginCaretPositionChanged(this);
}
void PepperPluginInstanceImpl::CancelCompositionText(PP_Instance instance) {
- delegate_->PluginRequestedCancelComposition(this);
+ helper_->PluginRequestedCancelComposition(this);
}
void PepperPluginInstanceImpl::SelectionChanged(PP_Instance instance) {
@@ -2385,7 +2384,7 @@ void PepperPluginInstanceImpl::UpdateSurroundingText(PP_Instance instance,
surrounding_text_ = text;
selection_caret_ = caret;
selection_anchor_ = anchor;
- delegate_->PluginSelectionChanged(this);
+ helper_->PluginSelectionChanged(this);
}
PP_Var PepperPluginInstanceImpl::ResolveRelativeToDocument(
@@ -2611,7 +2610,7 @@ PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy(
module_->CreateModuleForExternalPluginInstance());
RendererPpapiHost* renderer_ppapi_host =
- delegate_->CreateExternalPluginModule(
+ helper_->CreateExternalPluginModule(
external_plugin_module,
file_path,
permissions,
@@ -2636,7 +2635,7 @@ void PepperPluginInstanceImpl::DoSetCursor(WebCursorInfo* cursor) {
if (fullscreen_container_) {
fullscreen_container_->DidChangeCursor(*cursor);
} else {
- delegate_->DidChangeCursor(this, *cursor);
+ helper_->DidChangeCursor(this, *cursor);
}
}
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
index 6d2c574..c1eac40 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -99,7 +99,7 @@ class ContentDecryptorDelegate;
class FullscreenContainer;
class MessageChannel;
class PepperGraphics2DHost;
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PluginModule;
class PluginObject;
class PPB_Graphics3D_Impl;
@@ -122,12 +122,12 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// get_plugin_interface function. If the plugin does not support any valid
// PPP_Instance interface, returns NULL.
static PepperPluginInstanceImpl* Create(
- PepperPluginDelegateImpl* delegate,
+ PepperHelperImpl* helper,
RenderViewImpl* render_view,
PluginModule* module,
WebKit::WebPluginContainer* container,
const GURL& plugin_url);
- PepperPluginDelegateImpl* delegate() const { return delegate_; }
+ PepperHelperImpl* helper() const { return helper_; }
RenderViewImpl* render_view() const { return render_view_; }
PluginModule* module() const { return module_.get(); }
MessageChannel& message_channel() { return *message_channel_; }
@@ -540,21 +540,21 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API,
public ::ppapi::Resource {
public:
- explicit GamepadImpl(PepperPluginDelegateImpl* delegate);
+ explicit GamepadImpl(PepperHelperImpl* helper);
// Resource implementation.
virtual ::ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE;
virtual void Sample(PP_Instance instance,
PP_GamepadsSampleData* data) OVERRIDE;
private:
virtual ~GamepadImpl();
- PepperPluginDelegateImpl* delegate_;
+ PepperHelperImpl* helper_;
};
// See the static Create functions above for creating PepperPluginInstanceImpl
// objects. This constructor is private so that we can hide the
// PPP_Instance_Combined details while still having 1 constructor to maintain
// for member initialization.
- PepperPluginInstanceImpl(PepperPluginDelegateImpl* delegate,
+ PepperPluginInstanceImpl(PepperHelperImpl* helper,
RenderViewImpl* render_view,
PluginModule* module,
::ppapi::PPP_Instance_Combined* instance_interface,
@@ -646,7 +646,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter();
void UnSetAndDeleteLockTargetAdapter();
- PepperPluginDelegateImpl* delegate_;
+ PepperHelperImpl* helper_;
RenderViewImpl* render_view_;
scoped_refptr<PluginModule> module_;
scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_;
diff --git a/content/renderer/pepper/pepper_webplugin_impl.cc b/content/renderer/pepper/pepper_webplugin_impl.cc
index 176dca2..8e6df6f6 100644
--- a/content/renderer/pepper/pepper_webplugin_impl.cc
+++ b/content/renderer/pepper/pepper_webplugin_impl.cc
@@ -48,7 +48,7 @@ namespace content {
struct PepperWebPluginImpl::InitData {
scoped_refptr<PluginModule> module;
- base::WeakPtr<PepperPluginDelegateImpl> delegate;
+ base::WeakPtr<PepperHelperImpl> delegate;
base::WeakPtr<RenderViewImpl> render_view;
std::vector<std::string> arg_names;
std::vector<std::string> arg_values;
@@ -58,7 +58,7 @@ struct PepperWebPluginImpl::InitData {
PepperWebPluginImpl::PepperWebPluginImpl(
PluginModule* plugin_module,
const WebPluginParams& params,
- const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate,
+ const base::WeakPtr<PepperHelperImpl>& plugin_delegate,
const base::WeakPtr<RenderViewImpl>& render_view)
: init_data_(new InitData()),
full_frame_(params.loadManually),
diff --git a/content/renderer/pepper/pepper_webplugin_impl.h b/content/renderer/pepper/pepper_webplugin_impl.h
index c05e840d..580d564 100644
--- a/content/renderer/pepper/pepper_webplugin_impl.h
+++ b/content/renderer/pepper/pepper_webplugin_impl.h
@@ -24,7 +24,7 @@ struct WebPrintParams;
namespace content {
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PepperPluginInstanceImpl;
class PluginModule;
class PPB_URLLoader_Impl;
@@ -35,7 +35,7 @@ class PepperWebPluginImpl : public WebKit::WebPlugin {
PepperWebPluginImpl(
PluginModule* module,
const WebKit::WebPluginParams& params,
- const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate,
+ const base::WeakPtr<PepperHelperImpl>& plugin_delegate,
const base::WeakPtr<RenderViewImpl>& render_view);
PepperPluginInstanceImpl* instance() { return instance_.get(); }
diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc
index dc8b893..6f144d3 100644
--- a/content/renderer/pepper/plugin_module.cc
+++ b/content/renderer/pepper/plugin_module.cc
@@ -532,12 +532,12 @@ bool PluginModule::SupportsInterface(const char* name) {
}
PepperPluginInstanceImpl* PluginModule::CreateInstance(
- PepperPluginDelegateImpl* delegate,
+ PepperHelperImpl* helper,
RenderViewImpl* render_view,
WebKit::WebPluginContainer* container,
const GURL& plugin_url) {
PepperPluginInstanceImpl* instance = PepperPluginInstanceImpl::Create(
- delegate, render_view, this, container, plugin_url);
+ helper, render_view, this, container, plugin_url);
if (!instance) {
LOG(WARNING) << "Plugin doesn't support instance interface, failing.";
return NULL;
diff --git a/content/renderer/pepper/plugin_module.h b/content/renderer/pepper/plugin_module.h
index e177aae..acc92f4 100644
--- a/content/renderer/pepper/plugin_module.h
+++ b/content/renderer/pepper/plugin_module.h
@@ -43,7 +43,7 @@ class WebPluginContainer;
namespace content {
class HostDispatcherWrapper;
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PepperPluginInstanceImpl;
class PepperBroker;
class RendererPpapiHostImpl;
@@ -139,7 +139,7 @@ class CONTENT_EXPORT PluginModule :
const ::ppapi::PpapiPermissions& permissions() const { return permissions_; }
PepperPluginInstanceImpl* CreateInstance(
- PepperPluginDelegateImpl* delegate,
+ PepperHelperImpl* helper,
RenderViewImpl* render_view,
WebKit::WebPluginContainer* container,
const GURL& plugin_url);
@@ -147,7 +147,7 @@ class CONTENT_EXPORT PluginModule :
// Returns "some" plugin instance associated with this module. This is not
// guaranteed to be any one in particular. This is normally used to execute
// callbacks up to the browser layer that are not inherently per-instance,
- // but the delegate lives only on the plugin instance so we need one of them.
+ // but the helper lives only on the plugin instance so we need one of them.
PepperPluginInstanceImpl* GetSomeInstance() const;
const PluginInstanceSet& GetAllInstances() const { return instances_; }
diff --git a/content/renderer/pepper/ppb_broker_impl.cc b/content/renderer/pepper/ppb_broker_impl.cc
index 6425fb2..38943ae 100644
--- a/content/renderer/pepper/ppb_broker_impl.cc
+++ b/content/renderer/pepper/ppb_broker_impl.cc
@@ -7,7 +7,7 @@
#include "base/logging.h"
#include "content/renderer/pepper/common.h"
#include "content/renderer/pepper/pepper_broker.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/pepper/resource_helper.h"
@@ -66,7 +66,7 @@ int32_t PPB_Broker_Impl::Connect(
// ConnectToBroker fails.
connect_callback_ = connect_callback;
- broker_ = plugin_instance->delegate()->ConnectToBroker(this);
+ broker_ = plugin_instance->helper()->ConnectToBroker(this);
if (!broker_) {
connect_callback_->Abort();
return PP_ERROR_FAILED;
diff --git a/content/renderer/pepper/ppb_file_ref_impl.cc b/content/renderer/pepper/ppb_file_ref_impl.cc
index 163c874..875f1bf 100644
--- a/content/renderer/pepper/ppb_file_ref_impl.cc
+++ b/content/renderer/pepper/ppb_file_ref_impl.cc
@@ -11,7 +11,7 @@
#include "content/child/fileapi/file_system_dispatcher.h"
#include "content/renderer/pepper/common.h"
#include "content/renderer/pepper/pepper_file_system_host.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/pepper/renderer_ppapi_host_impl.h"
@@ -238,7 +238,7 @@ PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Instance instance,
const std::string& path) {
PepperPluginInstanceImpl* plugin_instance =
ResourceHelper::PPInstanceToPluginInstance(instance);
- if (!plugin_instance || !plugin_instance->delegate())
+ if (!plugin_instance || !plugin_instance->helper())
return 0;
ppapi::host::ResourceHost* host = GetResourceHostInternal(
@@ -466,7 +466,7 @@ int32_t PPB_FileRef_Impl::QueryInHost(
// TODO(teravest): Use the SequencedWorkerPool instead.
scoped_refptr<base::TaskRunner> task_runner =
RenderThreadImpl::current()->GetFileThreadMessageLoopProxy();
- if (!plugin_instance->delegate()->AsyncOpenFile(
+ if (!plugin_instance->helper()->AsyncOpenFile(
GetSystemPath(),
base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
base::Bind(&QueryCallback, task_runner, info, callback)))
diff --git a/content/renderer/pepper/ppb_image_data_impl.cc b/content/renderer/pepper/ppb_image_data_impl.cc
index fc28868..c51d1d2 100644
--- a/content/renderer/pepper/ppb_image_data_impl.cc
+++ b/content/renderer/pepper/ppb_image_data_impl.cc
@@ -255,8 +255,7 @@ bool ImageDataSimpleBackend::Init(PPB_ImageData_Impl* impl,
bool init_to_zero) {
skia_bitmap_.setConfig(SkBitmap::kARGB_8888_Config,
impl->width(), impl->height());
- PepperPluginDelegateImpl* plugin_delegate =
- ResourceHelper::GetPluginDelegate(impl);
+ PepperHelperImpl* plugin_delegate = ResourceHelper::GetHelper(impl);
if (!plugin_delegate)
return false;
shared_memory_.reset(RenderThread::Get()->HostAllocateSharedMemoryBuffer(
diff --git a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
index 695774b..4dfbe4a 100644
--- a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
+++ b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "content/renderer/pepper/host_globals.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/ppb_tcp_socket_private_impl.h"
#include "content/renderer/pepper/resource_helper.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -55,38 +55,37 @@ void PPB_TCPServerSocket_Private_Impl::OnAcceptCompleted(
void PPB_TCPServerSocket_Private_Impl::SendListen(
const PP_NetAddress_Private& addr,
int32_t backlog) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate();
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper();
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPServerSocket_Listen(
- plugin_delegate->routing_id(), 0, pp_resource(), addr, backlog));
+ helper->Send(new PpapiHostMsg_PPBTCPServerSocket_Listen(
+ helper->routing_id(), 0, pp_resource(), addr, backlog));
}
void PPB_TCPServerSocket_Private_Impl::SendAccept() {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate();
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper();
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPServerSocket_Accept(
- plugin_delegate->routing_id(), socket_id_));
+ helper->Send(new PpapiHostMsg_PPBTCPServerSocket_Accept(
+ helper->routing_id(), socket_id_));
}
void PPB_TCPServerSocket_Private_Impl::SendStopListening() {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate();
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper();
+ if (!helper)
return;
if (socket_id_ != 0) {
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPServerSocket_Destroy(
+ helper->Send(new PpapiHostMsg_PPBTCPServerSocket_Destroy(
socket_id_));
- plugin_delegate->TCPServerSocketStopListening(socket_id_);
+ helper->TCPServerSocketStopListening(socket_id_);
}
}
-PepperPluginDelegateImpl*
- PPB_TCPServerSocket_Private_Impl::GetPluginDelegate() {
- return ResourceHelper::GetPluginDelegate(this);
+PepperHelperImpl* PPB_TCPServerSocket_Private_Impl::GetHelper() {
+ return ResourceHelper::GetHelper(this);
}
} // namespace content
diff --git a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h
index 2740bfe..e704287 100644
--- a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h
+++ b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h
@@ -9,7 +9,7 @@
#include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h"
namespace content {
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PPB_TCPServerSocket_Private_Impl
: public ::ppapi::PPB_TCPServerSocket_Shared {
@@ -31,7 +31,7 @@ class PPB_TCPServerSocket_Private_Impl
PPB_TCPServerSocket_Private_Impl(PP_Instance instance);
virtual ~PPB_TCPServerSocket_Private_Impl();
- PepperPluginDelegateImpl* GetPluginDelegate();
+ PepperHelperImpl* GetHelper();
DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Impl);
};
diff --git a/content/renderer/pepper/ppb_tcp_socket_private_impl.cc b/content/renderer/pepper/ppb_tcp_socket_private_impl.cc
index 1022a86..c9e6087 100644
--- a/content/renderer/pepper/ppb_tcp_socket_private_impl.cc
+++ b/content/renderer/pepper/ppb_tcp_socket_private_impl.cc
@@ -6,7 +6,7 @@
#include "content/common/pepper_messages.h"
#include "content/renderer/pepper/host_globals.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/resource_helper.h"
#include "content/renderer/render_thread_impl.h"
@@ -25,13 +25,13 @@ PPB_TCPSocket_Private_Impl::~PPB_TCPSocket_Private_Impl() {
}
PP_Resource PPB_TCPSocket_Private_Impl::CreateResource(PP_Instance instance) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(instance);
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(instance);
+ if (!helper)
return 0;
uint32 socket_id = 0;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_CreatePrivate(
- plugin_delegate->routing_id(), 0, &socket_id));
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_CreatePrivate(
+ helper->routing_id(), 0, &socket_id));
if (!socket_id)
return 0;
@@ -43,8 +43,8 @@ PP_Resource PPB_TCPSocket_Private_Impl::CreateConnectedSocket(
uint32 socket_id,
const PP_NetAddress_Private& local_addr,
const PP_NetAddress_Private& remote_addr) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(instance);
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(instance);
+ if (!helper)
return 0;
PPB_TCPSocket_Private_Impl* socket =
@@ -54,31 +54,31 @@ PP_Resource PPB_TCPSocket_Private_Impl::CreateConnectedSocket(
socket->local_addr_ = local_addr;
socket->remote_addr_ = remote_addr;
- plugin_delegate->RegisterTCPSocket(socket, socket_id);
+ helper->RegisterTCPSocket(socket, socket_id);
return socket->GetReference();
}
void PPB_TCPSocket_Private_Impl::SendConnect(const std::string& host,
uint16_t port) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->RegisterTCPSocket(this, socket_id_);
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_Connect(
- plugin_delegate->routing_id(), socket_id_, host, port));
+ helper->RegisterTCPSocket(this, socket_id_);
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_Connect(
+ helper->routing_id(), socket_id_, host, port));
}
void PPB_TCPSocket_Private_Impl::SendConnectWithNetAddress(
const PP_NetAddress_Private& addr) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->RegisterTCPSocket(this, socket_id_);
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress(
- plugin_delegate->routing_id(), socket_id_, addr));
+ helper->RegisterTCPSocket(this, socket_id_);
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress(
+ helper->routing_id(), socket_id_, addr));
}
void PPB_TCPSocket_Private_Impl::SendSSLHandshake(
@@ -86,59 +86,58 @@ void PPB_TCPSocket_Private_Impl::SendSSLHandshake(
uint16_t server_port,
const std::vector<std::vector<char> >& trusted_certs,
const std::vector<std::vector<char> >& untrusted_certs) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake(
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake(
socket_id_, server_name, server_port, trusted_certs, untrusted_certs));
}
void PPB_TCPSocket_Private_Impl::SendRead(int32_t bytes_to_read) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_Read(
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_Read(
socket_id_, bytes_to_read));
}
void PPB_TCPSocket_Private_Impl::SendWrite(const std::string& buffer) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_Write(
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_Write(
socket_id_, buffer));
}
void PPB_TCPSocket_Private_Impl::SendDisconnect() {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_Disconnect(socket_id_));
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_Disconnect(socket_id_));
}
void PPB_TCPSocket_Private_Impl::SendSetOption(
PP_TCPSocket_Option name,
const ::ppapi::SocketOptionData& value) {
- PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate(pp_instance());
- if (!plugin_delegate)
+ PepperHelperImpl* helper = GetHelper(pp_instance());
+ if (!helper)
return;
- plugin_delegate->Send(new PpapiHostMsg_PPBTCPSocket_SetOption(
+ helper->Send(new PpapiHostMsg_PPBTCPSocket_SetOption(
socket_id_, name, value));
}
-PepperPluginDelegateImpl* PPB_TCPSocket_Private_Impl::GetPluginDelegate(
- PP_Instance instance) {
+PepperHelperImpl* PPB_TCPSocket_Private_Impl::GetHelper(PP_Instance instance) {
PepperPluginInstanceImpl* plugin_instance =
HostGlobals::Get()->GetInstance(instance);
if (!plugin_instance)
return NULL;
- return plugin_instance->delegate();
+ return plugin_instance->helper();
}
} // namespace content
diff --git a/content/renderer/pepper/ppb_tcp_socket_private_impl.h b/content/renderer/pepper/ppb_tcp_socket_private_impl.h
index 69c8656..aea82cb 100644
--- a/content/renderer/pepper/ppb_tcp_socket_private_impl.h
+++ b/content/renderer/pepper/ppb_tcp_socket_private_impl.h
@@ -12,7 +12,7 @@
namespace content {
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PPB_TCPSocket_Private_Impl : public ::ppapi::TCPSocketPrivateImpl {
public:
@@ -41,7 +41,7 @@ class PPB_TCPSocket_Private_Impl : public ::ppapi::TCPSocketPrivateImpl {
PPB_TCPSocket_Private_Impl(PP_Instance instance, uint32 socket_id);
virtual ~PPB_TCPSocket_Private_Impl();
- static PepperPluginDelegateImpl* GetPluginDelegate(PP_Instance instance);
+ static PepperHelperImpl* GetHelper(PP_Instance instance);
DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Impl);
};
diff --git a/content/renderer/pepper/ppb_video_decoder_impl.cc b/content/renderer/pepper/ppb_video_decoder_impl.cc
index 07307dd6..647d6da 100644
--- a/content/renderer/pepper/ppb_video_decoder_impl.cc
+++ b/content/renderer/pepper/ppb_video_decoder_impl.cc
@@ -11,8 +11,8 @@
#include "base/metrics/histogram.h"
#include "content/renderer/media/pepper_platform_video_decoder.h"
#include "content/renderer/pepper/common.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_platform_context_3d.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/pepper/ppb_buffer_impl.h"
#include "content/renderer/pepper/ppb_graphics_3d_impl.h"
@@ -139,11 +139,6 @@ bool PPB_VideoDecoder_Impl::Init(
if (command_buffer_route_id == 0)
return false;
- PepperPluginDelegateImpl* plugin_delegate =
- ResourceHelper::GetPluginDelegate(this);
- if (!plugin_delegate)
- return false;
-
platform_video_decoder_.reset(new PlatformVideoDecoder(
this, command_buffer_route_id));
if (!platform_video_decoder_)
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 8f77a62..b9069e4 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -12,9 +12,9 @@
#include "content/renderer/pepper/host_globals.h"
#include "content/renderer/pepper/pepper_browser_connection.h"
#include "content/renderer/pepper/pepper_graphics_2d_host.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/render_view_impl.h"
@@ -128,13 +128,13 @@ RendererPpapiHostImpl::GetBrowserConnection(PP_Instance instance) const {
if (!instance_object)
return NULL;
- // Since we're the embedder, we can make assumptions about the delegate on
+ // Since we're the embedder, we can make assumptions about the helper on
// the instance.
- PepperPluginDelegateImpl* delegate = instance_object->delegate();
- if (!delegate)
+ PepperHelperImpl* helper = instance_object->helper();
+ if (!helper)
return NULL;
- return delegate->pepper_browser_connection();
+ return helper->pepper_browser_connection();
}
PepperPluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl(
@@ -152,9 +152,9 @@ RenderView* RendererPpapiHostImpl::GetRenderViewForInstance(
if (!instance_object)
return NULL;
- // Since we're the embedder, we can make assumptions about the delegate on
+ // Since we're the embedder, we can make assumptions about the helper on
// the instance and get back to our RenderView.
- return instance_object->delegate()->render_view();
+ return instance_object->helper()->render_view();
}
bool RendererPpapiHostImpl::IsValidInstance(PP_Instance instance) const {
diff --git a/content/renderer/pepper/resource_helper.cc b/content/renderer/pepper/resource_helper.cc
index 9a20fe8..8a4e9dd 100644
--- a/content/renderer/pepper/resource_helper.cc
+++ b/content/renderer/pepper/resource_helper.cc
@@ -29,10 +29,9 @@ PluginModule* ResourceHelper::GetPluginModule(
return instance ? instance->module() : NULL;
}
-PepperPluginDelegateImpl* ResourceHelper::GetPluginDelegate(
- const ::ppapi::Resource* resource) {
+PepperHelperImpl* ResourceHelper::GetHelper(const ::ppapi::Resource* resource) {
PepperPluginInstanceImpl* instance = GetPluginInstance(resource);
- return instance ? instance->delegate() : NULL;
+ return instance ? instance->helper() : NULL;
}
} // namespace content
diff --git a/content/renderer/pepper/resource_helper.h b/content/renderer/pepper/resource_helper.h
index 2ace5d1..a4c6397 100644
--- a/content/renderer/pepper/resource_helper.h
+++ b/content/renderer/pepper/resource_helper.h
@@ -15,7 +15,7 @@ class Resource;
namespace content {
-class PepperPluginDelegateImpl;
+class PepperHelperImpl;
class PepperPluginInstanceImpl;
class PluginModule;
@@ -37,8 +37,7 @@ class ResourceHelper {
// Returns the plugin delegate for the given resource, or NULL if the
// resource has outlived its instance.
- static PepperPluginDelegateImpl* GetPluginDelegate(
- const ::ppapi::Resource* resource);
+ static PepperHelperImpl* GetHelper(const ::ppapi::Resource* resource);
// Returns the instance implementation object for the pp_instance.
static PepperPluginInstanceImpl* PPInstanceToPluginInstance(
diff --git a/content/renderer/pepper/url_request_info_util.cc b/content/renderer/pepper/url_request_info_util.cc
index 23fe60f..1948e75 100644
--- a/content/renderer/pepper/url_request_info_util.cc
+++ b/content/renderer/pepper/url_request_info_util.cc
@@ -58,9 +58,8 @@ bool AppendFileRefToBody(
const PPB_FileRef_Impl* file_ref =
static_cast<PPB_FileRef_Impl*>(file_ref_api);
- PepperPluginDelegateImpl* plugin_delegate =
- ResourceHelper::GetPluginDelegate(file_ref_resource);
- if (!plugin_delegate)
+ PepperHelperImpl* helper = ResourceHelper::GetHelper(file_ref_resource);
+ if (!helper)
return false;
base::FilePath platform_path;
diff --git a/content/renderer/pepper_helper.cc b/content/renderer/pepper_helper.cc
new file mode 100644
index 0000000..963ea15
--- /dev/null
+++ b/content/renderer/pepper_helper.cc
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/pepper_helper.h"
+
+#include "ui/gfx/rect.h"
+
+namespace content {
+
+PepperHelper::~PepperHelper() {
+}
+
+WebKit::WebPlugin* PepperHelper::CreatePepperWebPlugin(
+ const WebPluginInfo& webplugin_info,
+ const WebKit::WebPluginParams& params) {
+ return NULL;
+}
+
+PepperPluginInstanceImpl* PepperHelper::GetBitmapForOptimizedPluginPaint(
+ const gfx::Rect& paint_bounds,
+ TransportDIB** dib,
+ gfx::Rect* location,
+ gfx::Rect* clip,
+ float* scale_factor) {
+ return NULL;
+}
+
+bool PepperHelper::IsPluginFocused() const {
+ return false;
+}
+
+gfx::Rect PepperHelper::GetCaretBounds() const {
+ return gfx::Rect(0, 0, 0, 0);
+}
+
+ui::TextInputType PepperHelper::GetTextInputType() const {
+ return ui::TEXT_INPUT_TYPE_NONE;
+}
+
+bool PepperHelper::IsPluginAcceptingCompositionEvents() const {
+ return false;
+}
+
+bool PepperHelper::CanComposeInline() const {
+ return false;
+}
+
+} // namespace content
diff --git a/content/renderer/render_view_pepper_helper.h b/content/renderer/pepper_helper.h
index 67896aa..1e15396 100644
--- a/content/renderer/render_view_pepper_helper.h
+++ b/content/renderer/pepper_helper.h
@@ -3,8 +3,8 @@
// found in the LICENSE file.
// This interface is used by RenderView to talk to the pepper plugin delegate.
-#ifndef CONTENT_RENDERER_RENDER_VIEW_PEPPER_HELPER_H
-#define CONTENT_RENDERER_RENDER_VIEW_PEPPER_HELPER_H
+#ifndef CONTENT_RENDERER_PEPPER_HELPER_H
+#define CONTENT_RENDERER_PEPPER_HELPER_H
#include <string>
#include <vector>
@@ -40,10 +40,10 @@ namespace content {
class PepperPluginInstanceImpl;
struct WebPluginInfo;
-class CONTENT_EXPORT RenderViewPepperHelper {
+class CONTENT_EXPORT PepperHelper {
public:
- RenderViewPepperHelper() {}
- virtual ~RenderViewPepperHelper();
+ PepperHelper() {}
+ virtual ~PepperHelper();
virtual WebKit::WebPlugin* CreatePepperWebPlugin(
const WebPluginInfo& webplugin_info,
@@ -92,9 +92,9 @@ class CONTENT_EXPORT RenderViewPepperHelper {
virtual void WillHandleMouseEvent() {}
private:
- DISALLOW_COPY_AND_ASSIGN(RenderViewPepperHelper);
+ DISALLOW_COPY_AND_ASSIGN(PepperHelper);
};
} // namespace content
-#endif // CONTENT_RENDERER_RENDER_VIEW_PEPPER_HELPER_H
+#endif // CONTENT_RENDERER_PEPPER_HELPER_H
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index fedb2a2..52f189c 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -110,9 +110,9 @@ class WebUITestWebUIControllerFactory : public WebUIControllerFactory {
}
};
-class MockRenderViewPepperHelper : public RenderViewPepperHelper {
+class MockPepperHelper : public PepperHelper {
public:
- MockRenderViewPepperHelper() : text_input_type_(ui::TEXT_INPUT_TYPE_NONE) {}
+ MockPepperHelper() : text_input_type_(ui::TEXT_INPUT_TYPE_NONE) {}
virtual bool IsPluginFocused() const OVERRIDE {
return true;
}
@@ -1940,7 +1940,7 @@ TEST_F(RenderViewImplTest, BasicRenderFrame) {
}
TEST_F(RenderViewImplTest, TextInputTypeWithPepper) {
- MockRenderViewPepperHelper* pepper_helper = new MockRenderViewPepperHelper();
+ MockPepperHelper* pepper_helper = new MockPepperHelper();
pepper_helper->SetTextInputType(ui::TEXT_INPUT_TYPE_EMAIL);
view()->pepper_helper_ .reset(pepper_helper);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 78ea0a3..be08296 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -107,7 +107,7 @@
#include "content/renderer/media/webmediaplayer_params.h"
#include "content/renderer/mhtml_generator.h"
#include "content/renderer/notification_provider.h"
-#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_plugin_registry.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_process.h"
@@ -961,9 +961,9 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) {
ProcessViewLayoutFlags(command_line);
#if defined(ENABLE_PLUGINS)
- pepper_helper_.reset(new PepperPluginDelegateImpl(this));
+ pepper_helper_.reset(new PepperHelperImpl(this));
#else
- pepper_helper_.reset(new RenderViewPepperHelper());
+ pepper_helper_.reset(new PepperHelper());
#endif
GetContentClient()->renderer()->RenderViewCreated(this);
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 9d8d113..b832463 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -36,8 +36,8 @@
#include "content/public/renderer/render_view.h"
#include "content/renderer/media/webmediaplayer_delegate.h"
#include "content/renderer/mouse_lock_dispatcher.h"
+#include "content/renderer/pepper_helper.h"
#include "content/renderer/render_frame_impl.h"
-#include "content/renderer/render_view_pepper_helper.h"
#include "content/renderer/render_widget.h"
#include "content/renderer/renderer_webcookiejar_impl.h"
#include "content/renderer/stats_collection_observer.h"
@@ -1540,7 +1540,7 @@ class CONTENT_EXPORT RenderViewImpl
// NOTE: pepper_helper_ and stats_collection_observer_ should be the last
// members because their constructors call the AddObservers method of
// RenderViewImpl.
- scoped_ptr<RenderViewPepperHelper> pepper_helper_;
+ scoped_ptr<PepperHelper> pepper_helper_;
scoped_ptr<StatsCollectionObserver> stats_collection_observer_;
ui::MenuSourceType context_menu_source_type_;
diff --git a/content/renderer/render_view_pepper_helper.cc b/content/renderer/render_view_pepper_helper.cc
deleted file mode 100644
index c98bcd1..0000000
--- a/content/renderer/render_view_pepper_helper.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/render_view_pepper_helper.h"
-
-#include "ui/gfx/rect.h"
-
-namespace content {
-
-RenderViewPepperHelper::~RenderViewPepperHelper() {
-}
-
-WebKit::WebPlugin* RenderViewPepperHelper::CreatePepperWebPlugin(
- const WebPluginInfo& webplugin_info,
- const WebKit::WebPluginParams& params) {
- return NULL;
-}
-
-PepperPluginInstanceImpl*
- RenderViewPepperHelper::GetBitmapForOptimizedPluginPaint(
- const gfx::Rect& paint_bounds,
- TransportDIB** dib,
- gfx::Rect* location,
- gfx::Rect* clip,
- float* scale_factor) {
- return NULL;
-}
-
-bool RenderViewPepperHelper::IsPluginFocused() const {
- return false;
-}
-
-gfx::Rect RenderViewPepperHelper::GetCaretBounds() const {
- return gfx::Rect(0, 0, 0, 0);
-}
-
-ui::TextInputType RenderViewPepperHelper::GetTextInputType() const {
- return ui::TEXT_INPUT_TYPE_NONE;
-}
-
-bool RenderViewPepperHelper::IsPluginAcceptingCompositionEvents() const {
- return false;
-}
-
-bool RenderViewPepperHelper::CanComposeInline() const {
- return false;
-}
-
-} // namespace content