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

Unified Diff: content/renderer/webplugin_delegate_proxy.cc

Issue 10834355: Enable verbose logging during PluginMsg_CreateInstance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix crashes Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/np_channel_base.cc ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webplugin_delegate_proxy.cc
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index c05c20a51f8d4fa9ad5625b4d9a5d479da1797c5..05a5410ae7084e9151d4a5955ad03bd12971f5dd 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);
« no previous file with comments | « content/common/np_channel_base.cc ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698