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

Side by Side Diff: gpu/command_buffer/tests/fuzzer_main.cc

Issue 2378583003: Ping watchdog thread during GpuChannel destruction (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include <stddef.h> 4 #include <stddef.h>
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "gpu/command_buffer/common/constants.h" 16 #include "gpu/command_buffer/common/constants.h"
17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 17 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
18 #include "gpu/command_buffer/common/sync_token.h" 18 #include "gpu/command_buffer/common/sync_token.h"
19 #include "gpu/command_buffer/service/buffer_manager.h" 19 #include "gpu/command_buffer/service/buffer_manager.h"
20 #include "gpu/command_buffer/service/command_buffer_service.h" 20 #include "gpu/command_buffer/service/command_buffer_service.h"
21 #include "gpu/command_buffer/service/command_executor.h" 21 #include "gpu/command_buffer/service/command_executor.h"
22 #include "gpu/command_buffer/service/context_group.h" 22 #include "gpu/command_buffer/service/context_group.h"
23 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 23 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
24 #include "gpu/command_buffer/service/logger.h" 24 #include "gpu/command_buffer/service/logger.h"
25 #include "gpu/command_buffer/service/mailbox_manager_impl.h" 25 #include "gpu/command_buffer/service/mailbox_manager_impl.h"
26 #include "gpu/command_buffer/service/progress_reporter.h"
26 #include "gpu/command_buffer/service/sync_point_manager.h" 27 #include "gpu/command_buffer/service/sync_point_manager.h"
27 #include "gpu/command_buffer/service/transfer_buffer_manager.h" 28 #include "gpu/command_buffer/service/transfer_buffer_manager.h"
28 #include "ui/gfx/geometry/size.h" 29 #include "ui/gfx/geometry/size.h"
29 #include "ui/gl/gl_context.h" 30 #include "ui/gl/gl_context.h"
30 #include "ui/gl/gl_context_stub_with_extensions.h" 31 #include "ui/gl/gl_context_stub_with_extensions.h"
31 #include "ui/gl/gl_image_ref_counted_memory.h" 32 #include "ui/gl/gl_image_ref_counted_memory.h"
32 #include "ui/gl/gl_share_group.h" 33 #include "ui/gl/gl_share_group.h"
33 #include "ui/gl/gl_stub_api.h" 34 #include "ui/gl/gl_stub_api.h"
34 #include "ui/gl/gl_surface.h" 35 #include "ui/gl/gl_surface.h"
35 #include "ui/gl/gl_surface_stub.h" 36 #include "ui/gl/gl_surface_stub.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 completeness_cache_ = new gles2::FramebufferCompletenessCache; 111 completeness_cache_ = new gles2::FramebufferCompletenessCache;
111 } 112 }
112 113
113 void InitDecoder() { 114 void InitDecoder() {
114 context_->MakeCurrent(surface_.get()); 115 context_->MakeCurrent(surface_.get());
115 scoped_refptr<gles2::FeatureInfo> feature_info = 116 scoped_refptr<gles2::FeatureInfo> feature_info =
116 new gles2::FeatureInfo(); 117 new gles2::FeatureInfo();
117 scoped_refptr<gles2::ContextGroup> context_group = new gles2::ContextGroup( 118 scoped_refptr<gles2::ContextGroup> context_group = new gles2::ContextGroup(
118 gpu_preferences_, mailbox_manager_.get(), nullptr, translator_cache_, 119 gpu_preferences_, mailbox_manager_.get(), nullptr, translator_cache_,
119 completeness_cache_, feature_info, true /* bind_generates_resource */, 120 completeness_cache_, feature_info, true /* bind_generates_resource */,
120 nullptr /* ImageFactory */); 121 nullptr /* ImageFactory */, nullptr /* progress_reporter */);
121 command_buffer_.reset( 122 command_buffer_.reset(
122 new CommandBufferService(context_group->transfer_buffer_manager())); 123 new CommandBufferService(context_group->transfer_buffer_manager()));
123 command_buffer_->SetPutOffsetChangeCallback( 124 command_buffer_->SetPutOffsetChangeCallback(
124 base::Bind(&CommandBufferSetup::PumpCommands, base::Unretained(this))); 125 base::Bind(&CommandBufferSetup::PumpCommands, base::Unretained(this)));
125 command_buffer_->SetGetBufferChangeCallback(base::Bind( 126 command_buffer_->SetGetBufferChangeCallback(base::Bind(
126 &CommandBufferSetup::GetBufferChanged, base::Unretained(this))); 127 &CommandBufferSetup::GetBufferChanged, base::Unretained(this)));
127 InitializeInitialCommandBuffer(); 128 InitializeInitialCommandBuffer();
128 129
129 decoder_.reset(gles2::GLES2Decoder::Create(context_group.get())); 130 decoder_.reset(gles2::GLES2Decoder::Create(context_group.get()));
130 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), 131 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(),
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 295
295 static gpu::CommandBufferSetup& GetSetup() { 296 static gpu::CommandBufferSetup& GetSetup() {
296 static gpu::CommandBufferSetup setup; 297 static gpu::CommandBufferSetup setup;
297 return setup; 298 return setup;
298 } 299 }
299 300
300 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 301 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
301 GetSetup().RunCommandBuffer(data, size); 302 GetSetup().RunCommandBuffer(data, size);
302 return 0; 303 return 0;
303 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698