OLD | NEW |
---|---|
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 Loading... | |
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 NOINLINE static void CrashIntentionally() { | |
Nico
2012/02/10 22:54:57
http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax
| |
329 // NOTE(shess): Crash directly rather than using NOTREACHED() so | |
330 // that the signature is easier to triage in crash reports. | |
331 volatile int* zero = NULL; | |
332 *zero = 0; | |
333 } | |
334 | |
328 static void MaybeHandleDebugURL(const GURL& url) { | 335 static void MaybeHandleDebugURL(const GURL& url) { |
329 if (!url.SchemeIs(chrome::kChromeUIScheme)) | 336 if (!url.SchemeIs(chrome::kChromeUIScheme)) |
330 return; | 337 return; |
331 if (url == GURL(chrome::kChromeUICrashURL)) { | 338 if (url == GURL(chrome::kChromeUICrashURL)) { |
332 // NOTE(shess): Crash directly rather than using NOTREACHED() so | 339 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)) { | 340 } else if (url == GURL(chrome::kChromeUIKillURL)) { |
341 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); | 341 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); |
342 } else if (url == GURL(chrome::kChromeUIHangURL)) { | 342 } else if (url == GURL(chrome::kChromeUIHangURL)) { |
343 for (;;) { | 343 for (;;) { |
344 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); | 344 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); |
345 } | 345 } |
346 } else if (url == GURL(chrome::kChromeUIShorthangURL)) { | 346 } else if (url == GURL(chrome::kChromeUIShorthangURL)) { |
347 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); | 347 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); |
348 } | 348 } |
349 } | 349 } |
(...skipping 4689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5039 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5039 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5040 return !!RenderThreadImpl::current()->compositor_thread(); | 5040 return !!RenderThreadImpl::current()->compositor_thread(); |
5041 } | 5041 } |
5042 | 5042 |
5043 void RenderViewImpl::OnJavaBridgeInit() { | 5043 void RenderViewImpl::OnJavaBridgeInit() { |
5044 DCHECK(!java_bridge_dispatcher_.get()); | 5044 DCHECK(!java_bridge_dispatcher_.get()); |
5045 #if defined(ENABLE_JAVA_BRIDGE) | 5045 #if defined(ENABLE_JAVA_BRIDGE) |
5046 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5046 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5047 #endif | 5047 #endif |
5048 } | 5048 } |
OLD | NEW |