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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 9380026: Add a stackframe named 'CrashIntentionally' to crashes from about:crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « no previous file | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE; 318 params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE;
319 } 319 }
320 320
321 static WebReferrerPolicy getReferrerPolicyFromRequest( 321 static WebReferrerPolicy getReferrerPolicyFromRequest(
322 const WebURLRequest& request) { 322 const WebURLRequest& request) {
323 return request.extraData() ? 323 return request.extraData() ?
324 static_cast<RequestExtraData*>(request.extraData())->referrer_policy() : 324 static_cast<RequestExtraData*>(request.extraData())->referrer_policy() :
325 WebKit::WebReferrerPolicyDefault; 325 WebKit::WebReferrerPolicyDefault;
326 } 326 }
327 327
328 // Disable optimizations so the symbol "CrashIntentionally()" does not get
329 // optimized away. We want this name to appear in the crashed callstack to
330 // make it clear what these crashes are about.
331 #if defined(COMPILER_MSVC)
332 #pragma optimize("", off)
333 MSVC_PUSH_DISABLE_WARNING(4748)
334 #endif
335
336 #if defined(COMPILER_GCC)
337 __attribute__((noinline))
Nico 2012/02/10 22:20:39 Does this work? I thought attributes go behind the
338 #endif
339
340 static void CrashIntentionally() {
341 // NOTE(shess): Crash directly rather than using NOTREACHED() so
342 // that the signature is easier to triage in crash reports.
343 volatile int* zero = NULL;
344 *zero = 0;
345 }
346
347 #if defined(COMPILER_MSVC)
348 MSVC_POP_WARNING()
349 #pragma optimize("", on)
350 #endif
351
328 static void MaybeHandleDebugURL(const GURL& url) { 352 static void MaybeHandleDebugURL(const GURL& url) {
329 if (!url.SchemeIs(chrome::kChromeUIScheme)) 353 if (!url.SchemeIs(chrome::kChromeUIScheme))
330 return; 354 return;
331 if (url == GURL(chrome::kChromeUICrashURL)) { 355 if (url == GURL(chrome::kChromeUICrashURL)) {
332 // NOTE(shess): Crash directly rather than using NOTREACHED() so 356 CrashIntentionally();
333 // that the signature is easier to triage in crash reports.
334 volatile int* zero = NULL;
335 *zero = 0;
336
337 // Just in case the compiler decides the above is undefined and
338 // optimizes it away.
339 NOTREACHED();
340 } else if (url == GURL(chrome::kChromeUIKillURL)) { 357 } else if (url == GURL(chrome::kChromeUIKillURL)) {
341 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); 358 base::KillProcess(base::GetCurrentProcessHandle(), 1, false);
342 } else if (url == GURL(chrome::kChromeUIHangURL)) { 359 } else if (url == GURL(chrome::kChromeUIHangURL)) {
343 for (;;) { 360 for (;;) {
344 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); 361 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
345 } 362 }
346 } else if (url == GURL(chrome::kChromeUIShorthangURL)) { 363 } else if (url == GURL(chrome::kChromeUIShorthangURL)) {
347 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); 364 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
348 } 365 }
349 } 366 }
(...skipping 4689 matching lines...) Expand 10 before | Expand all | Expand 10 after
5039 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5056 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5040 return !!RenderThreadImpl::current()->compositor_thread(); 5057 return !!RenderThreadImpl::current()->compositor_thread();
5041 } 5058 }
5042 5059
5043 void RenderViewImpl::OnJavaBridgeInit() { 5060 void RenderViewImpl::OnJavaBridgeInit() {
5044 DCHECK(!java_bridge_dispatcher_.get()); 5061 DCHECK(!java_bridge_dispatcher_.get());
5045 #if defined(ENABLE_JAVA_BRIDGE) 5062 #if defined(ENABLE_JAVA_BRIDGE)
5046 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 5063 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
5047 #endif 5064 #endif
5048 } 5065 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698