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

Unified Diff: services/ui/gpu/gpu_service.cc

Issue 2723013004: gpu: Replace more chrome ipc with mojom API. (Closed)
Patch Set: tot merge Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | services/ui/gpu/interfaces/gpu_service.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_service.cc
diff --git a/services/ui/gpu/gpu_service.cc b/services/ui/gpu/gpu_service.cc
index 73adbe39921d44dd5b71e1682dbd4985fba23471..f8a6a17ec8c2853e9702ae937315b62cad6c8471 100644
--- a/services/ui/gpu/gpu_service.cc
+++ b/services/ui/gpu/gpu_service.cc
@@ -36,6 +36,7 @@
#include "url/gurl.h"
#if defined(OS_ANDROID)
+#include "base/android/throw_uncaught_exception.h"
#include "media/gpu/avda_codec_allocator.h"
#endif
@@ -234,4 +235,34 @@ void GpuService::WakeUpGpu() {
#endif
}
+void GpuService::DestroyAllChannels() {
+ if (!gpu_channel_manager_)
+ return;
+ DVLOG(1) << "GPU: Removing all contexts";
+ gpu_channel_manager_->DestroyAllChannels();
+}
+
+void GpuService::Crash() {
+ DVLOG(1) << "GPU: Simulating GPU crash";
+ // Good bye, cruel world.
+ volatile int* it_s_the_end_of_the_world_as_we_know_it = NULL;
+ *it_s_the_end_of_the_world_as_we_know_it = 0xdead;
+}
+
+void GpuService::Hang() {
+ DVLOG(1) << "GPU: Simulating GPU hang";
+ for (;;) {
+ // Do not sleep here. The GPU watchdog timer tracks the amount of user
+ // time this thread is using and it doesn't use much while calling Sleep.
+ }
+}
+
+void GpuService::ThrowJavaException() {
+#if defined(OS_ANDROID)
+ base::android::ThrowUncaughtException();
+#else
+ NOTREACHED() << "Java exception not supported on this platform.";
+#endif
+}
+
} // namespace ui
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | services/ui/gpu/interfaces/gpu_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698