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

Unified Diff: content/plugin/npobject_stub.cc

Issue 7763008: Disable frame pointer optimization on base::debug::StackTrace() so it works properly in release b... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 | « base/debug/stack_trace_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/npobject_stub.cc
===================================================================
--- content/plugin/npobject_stub.cc (revision 98490)
+++ content/plugin/npobject_stub.cc (working copy)
@@ -16,6 +16,26 @@
using WebKit::WebBindings;
+// TODO(eroman): Remove this when done investigating 94179.
+//
+// The following disables optimizations for all the functions in this file.
+//
+// At a minimum we want to disable frame pointer optimization ("y"), so that
+// base::debug::StackTrace() works better. We also prevent inlining of these
+// functions so that StackTrace() is more complete. (The StackTrace() will
+// probably not be able to go deeper than these functions since the callers
+// will probably have FPO).
+//
+// Note that disabling optimizations causes warning 4748 which I have had to
+// disable throughout this file. That warning was:
+//
+// /GS can not protect parameters and local variables from local buffer
+// overrun because optimizations are disabled in function
+#if defined(COMPILER_MSVC)
+#pragma optimize("", off)
+MSVC_PUSH_DISABLE_WARNING(4748)
+#endif
+
NPObjectStub::NPObjectStub(
NPObject* npobject,
PluginChannelBase* channel,
@@ -385,3 +405,9 @@
NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value);
channel_->Send(reply_msg);
}
+
+// Restore compiler optimizations and warnings.
+#if defined(COMPILER_MSVC)
+MSVC_POP_WARNING()
+#pragma optimize("", on)
+#endif
« no previous file with comments | « base/debug/stack_trace_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698