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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/debug/stack_trace_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/plugin/npobject_stub.h" 5 #include "content/plugin/npobject_stub.h"
6 6
7 #include "content/common/content_client.h" 7 #include "content/common/content_client.h"
8 #include "content/common/plugin_messages.h" 8 #include "content/common/plugin_messages.h"
9 #include "content/plugin/npobject_util.h" 9 #include "content/plugin/npobject_util.h"
10 #include "content/plugin/plugin_channel_base.h" 10 #include "content/plugin/plugin_channel_base.h"
11 #include "content/plugin/plugin_thread.h" 11 #include "content/plugin/plugin_thread.h"
12 #include "third_party/npapi/bindings/npapi.h" 12 #include "third_party/npapi/bindings/npapi.h"
13 #include "third_party/npapi/bindings/npruntime.h" 13 #include "third_party/npapi/bindings/npruntime.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
15 #include "webkit/plugins/npapi/plugin_constants_win.h" 15 #include "webkit/plugins/npapi/plugin_constants_win.h"
16 16
17 using WebKit::WebBindings; 17 using WebKit::WebBindings;
18 18
19 // TODO(eroman): Remove this when done investigating 94179.
20 //
21 // The following disables optimizations for all the functions in this file.
22 //
23 // At a minimum we want to disable frame pointer optimization ("y"), so that
24 // base::debug::StackTrace() works better. We also prevent inlining of these
25 // functions so that StackTrace() is more complete. (The StackTrace() will
26 // probably not be able to go deeper than these functions since the callers
27 // will probably have FPO).
28 //
29 // Note that disabling optimizations causes warning 4748 which I have had to
30 // disable throughout this file. That warning was:
31 //
32 // /GS can not protect parameters and local variables from local buffer
33 // overrun because optimizations are disabled in function
34 #if defined(COMPILER_MSVC)
35 #pragma optimize("", off)
36 MSVC_PUSH_DISABLE_WARNING(4748)
37 #endif
38
19 NPObjectStub::NPObjectStub( 39 NPObjectStub::NPObjectStub(
20 NPObject* npobject, 40 NPObject* npobject,
21 PluginChannelBase* channel, 41 PluginChannelBase* channel,
22 int route_id, 42 int route_id,
23 gfx::NativeViewId containing_window, 43 gfx::NativeViewId containing_window,
24 const GURL& page_url) 44 const GURL& page_url)
25 : npobject_(npobject), 45 : npobject_(npobject),
26 channel_(channel), 46 channel_(channel),
27 route_id_(route_id), 47 route_id_(route_id),
28 containing_window_(containing_window), 48 containing_window_(containing_window),
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 398
379 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_, 399 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_,
380 &script_string, &result_var); 400 &script_string, &result_var);
381 401
382 NPVariant_Param result_param; 402 NPVariant_Param result_param;
383 CreateNPVariantParam( 403 CreateNPVariantParam(
384 result_var, channel_, &result_param, true, containing_window_, page_url_); 404 result_var, channel_, &result_param, true, containing_window_, page_url_);
385 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); 405 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value);
386 channel_->Send(reply_msg); 406 channel_->Send(reply_msg);
387 } 407 }
408
409 // Restore compiler optimizations and warnings.
410 #if defined(COMPILER_MSVC)
411 MSVC_POP_WARNING()
412 #pragma optimize("", on)
413 #endif
OLDNEW
« 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