summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-20 22:10:08 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-20 22:10:08 +0000
commit33c66e3473573743888019bd0e97eee01f548f81 (patch)
tree5c24f213fdbea613d07513f368f33661234dd53b /content
parent8f7137be2411b7d6176fb3fed485a8db20ec3edf (diff)
downloadchromium_src-33c66e3473573743888019bd0e97eee01f548f81.zip
chromium_src-33c66e3473573743888019bd0e97eee01f548f81.tar.gz
chromium_src-33c66e3473573743888019bd0e97eee01f548f81.tar.bz2
Enable verbose logging during PluginMsg_CreateInstance.
This should get rid of the spurious ERROR messages when closing tabs, and log backtraces when we need them. BUG=141055 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=151975 Review URL: https://chromiumcodereview.appspot.com/10834355 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/np_channel_base.cc2
-rw-r--r--content/renderer/webplugin_delegate_proxy.cc40
2 files changed, 35 insertions, 7 deletions
diff --git a/content/common/np_channel_base.cc b/content/common/np_channel_base.cc
index 5640958..625677f 100644
--- a/content/common/np_channel_base.cc
+++ b/content/common/np_channel_base.cc
@@ -141,7 +141,7 @@ bool NPChannelBase::Init(base::MessageLoopProxy* ipc_message_loop,
bool NPChannelBase::Send(IPC::Message* message) {
if (!channel_.get()) {
- LOG(ERROR) << "Channel is NULL; dropping message";
+ VLOG(1) << "Channel is NULL; dropping message";
delete message;
return false;
}
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index c05c20a..05a5410 100644
--- a/content/renderer/webplugin_delegate_proxy.cc
+++ b/content/renderer/webplugin_delegate_proxy.cc
@@ -73,6 +73,28 @@ using WebKit::WebInputEvent;
using WebKit::WebString;
using WebKit::WebView;
+namespace {
+
+class ScopedLogLevel {
+ public:
+ ScopedLogLevel(int level);
+ ~ScopedLogLevel();
+
+ private:
+ int old_level_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedLogLevel);
+};
+
+ScopedLogLevel::ScopedLogLevel(int level)
+ : old_level_(logging::GetMinLogLevel()) {
+ logging::SetMinLogLevel(level);
+}
+
+ScopedLogLevel::~ScopedLogLevel() {
+ logging::SetMinLogLevel(old_level_);
+}
+
// Proxy for WebPluginResourceClient. The object owns itself after creation,
// deleting itself after its callback has been called.
class ResourceClientProxy : public webkit::npapi::WebPluginResourceClient {
@@ -169,6 +191,8 @@ class ResourceClientProxy : public webkit::npapi::WebPluginResourceClient {
bool multibyte_response_expected_;
};
+} // namespace
+
WebPluginDelegateProxy::WebPluginDelegateProxy(
const std::string& mime_type,
const base::WeakPtr<RenderViewImpl>& render_view)
@@ -319,11 +343,15 @@ bool WebPluginDelegateProxy::Initialize(
#endif
int instance_id;
- bool result = channel_host->Send(new PluginMsg_CreateInstance(
- mime_type_, &instance_id));
- if (!result) {
- LOG(ERROR) << "Couldn't send PluginMsg_CreateInstance";
- return false;
+ {
+ // TODO(bauerb): Debugging for http://crbug.com/141055.
+ ScopedLogLevel log_level(-2); // Equivalent to --v=2
+ bool result = channel_host->Send(new PluginMsg_CreateInstance(
+ mime_type_, &instance_id));
+ if (!result) {
+ LOG(ERROR) << "Couldn't send PluginMsg_CreateInstance";
+ return false;
+ }
}
channel_host_ = channel_host;
@@ -356,7 +384,7 @@ bool WebPluginDelegateProxy::Initialize(
plugin_ = plugin;
- result = false;
+ bool result = false;
IPC::Message* msg = new PluginMsg_Init(instance_id_, params, &result);
Send(msg);