OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <v8.h> | 7 #include <v8.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "webkit/extensions/v8/benchmarking_extension.h" | 70 #include "webkit/extensions/v8/benchmarking_extension.h" |
71 #include "webkit/extensions/v8/gears_extension.h" | 71 #include "webkit/extensions/v8/gears_extension.h" |
72 #include "webkit/extensions/v8/interval_extension.h" | 72 #include "webkit/extensions/v8/interval_extension.h" |
73 #include "webkit/extensions/v8/playback_extension.h" | 73 #include "webkit/extensions/v8/playback_extension.h" |
74 | 74 |
75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
76 #include <windows.h> | 76 #include <windows.h> |
77 #include <objbase.h> | 77 #include <objbase.h> |
78 #endif | 78 #endif |
79 | 79 |
| 80 #if defined(OS_MACOSX) |
| 81 #include "chrome/app/breakpad_mac.h" |
| 82 #endif |
| 83 |
80 using WebKit::WebCache; | 84 using WebKit::WebCache; |
81 using WebKit::WebCrossOriginPreflightResultCache; | 85 using WebKit::WebCrossOriginPreflightResultCache; |
82 using WebKit::WebFontCache; | 86 using WebKit::WebFontCache; |
83 using WebKit::WebRuntimeFeatures; | 87 using WebKit::WebRuntimeFeatures; |
84 using WebKit::WebSecurityPolicy; | 88 using WebKit::WebSecurityPolicy; |
85 using WebKit::WebScriptController; | 89 using WebKit::WebScriptController; |
86 using WebKit::WebString; | 90 using WebKit::WebString; |
87 using WebKit::WebStorageEventDispatcher; | 91 using WebKit::WebStorageEventDispatcher; |
88 using WebKit::WebView; | 92 using WebKit::WebView; |
89 | 93 |
(...skipping 14 matching lines...) Expand all Loading... |
104 // from the IPC channel) are routed to the main message loop but never | 108 // from the IPC channel) are routed to the main message loop but never |
105 // processed (because that message loop is stuck in V8). | 109 // processed (because that message loop is stuck in V8). |
106 // | 110 // |
107 // One could make the browser SIGKILL the renderers, but that leaves open a | 111 // One could make the browser SIGKILL the renderers, but that leaves open a |
108 // large window where a browser failure (or a user, manually terminating | 112 // large window where a browser failure (or a user, manually terminating |
109 // the browser because "it's stuck") will leave behind a process eating all | 113 // the browser because "it's stuck") will leave behind a process eating all |
110 // the CPU. | 114 // the CPU. |
111 // | 115 // |
112 // So, we install a filter on the channel so that we can process this event | 116 // So, we install a filter on the channel so that we can process this event |
113 // here and kill the process. | 117 // here and kill the process. |
| 118 |
| 119 #if defined(OS_MACOSX) |
| 120 // TODO(viettrungluu): crbug.com/28547: The following is needed, as a |
| 121 // stopgap, to avoid leaking due to not releasing Breakpad properly. |
| 122 // TODO(viettrungluu): Investigate why this is being called. |
| 123 if (IsCrashReporterEnabled()) { |
| 124 LOG(INFO) << "Cleaning up Breakpad."; |
| 125 DestructCrashReporter(); |
| 126 } else { |
| 127 LOG(INFO) << "Breakpad not enabled; no clean-up needed."; |
| 128 } |
| 129 #endif // OS_MACOSX |
| 130 |
114 _exit(0); | 131 _exit(0); |
115 } | 132 } |
116 }; | 133 }; |
117 #endif | 134 #endif |
118 } // namespace | 135 } // namespace |
119 | 136 |
120 // When we run plugins in process, we actually run them on the render thread, | 137 // When we run plugins in process, we actually run them on the render thread, |
121 // which means that we need to make the render thread pump UI events. | 138 // which means that we need to make the render thread pump UI events. |
122 RenderThread::RenderThread() { | 139 RenderThread::RenderThread() { |
123 Init(); | 140 Init(); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 void RenderThread::OnPurgePluginListCache(bool reload_pages) { | 643 void RenderThread::OnPurgePluginListCache(bool reload_pages) { |
627 EnsureWebKitInitialized(); | 644 EnsureWebKitInitialized(); |
628 // The call below will cause a GetPlugins call with refresh=true, but at this | 645 // The call below will cause a GetPlugins call with refresh=true, but at this |
629 // point we already know that the browser has refreshed its list, so disable | 646 // point we already know that the browser has refreshed its list, so disable |
630 // refresh temporarily to prevent each renderer process causing the list to be | 647 // refresh temporarily to prevent each renderer process causing the list to be |
631 // regenerated. | 648 // regenerated. |
632 plugin_refresh_allowed_ = false; | 649 plugin_refresh_allowed_ = false; |
633 WebKit::resetPluginCache(reload_pages); | 650 WebKit::resetPluginCache(reload_pages); |
634 plugin_refresh_allowed_ = true; | 651 plugin_refresh_allowed_ = true; |
635 } | 652 } |
OLD | NEW |