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); |