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

Unified Diff: gpu/command_buffer/service/mocks.h

Issue 2275203002: Make command buffer commands and immediate data volatile (Closed)
Patch Set: std::copy->const_cast+memcpy Created 4 years, 3 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
Index: gpu/command_buffer/service/mocks.h
diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h
index a71c6ad7fd07d45555d8275cd80db1e961e21acb..a47ca6fa7d2ec6125efbdb1606c3b1f4aefdba65 100644
--- a/gpu/command_buffer/service/mocks.h
+++ b/gpu/command_buffer/service/mocks.h
@@ -33,21 +33,21 @@ class AsyncAPIMock : public AsyncAPIInterface {
virtual ~AsyncAPIMock();
error::Error FakeDoCommands(unsigned int num_commands,
- const void* buffer,
+ const volatile void* buffer,
int num_entries,
int* entries_processed);
// Predicate that matches args passed to DoCommand, by looking at the values.
class IsArgs {
public:
- IsArgs(unsigned int arg_count, const void* args)
+ IsArgs(unsigned int arg_count, const volatile void* args)
: arg_count_(arg_count),
- args_(static_cast<CommandBufferEntry*>(const_cast<void*>(args))) {
- }
+ args_(static_cast<volatile CommandBufferEntry*>(
+ const_cast<volatile void*>(args))) {}
- bool operator() (const void* _args) const {
- const CommandBufferEntry* args =
- static_cast<const CommandBufferEntry*>(_args) + 1;
+ bool operator()(const volatile void* _args) const {
+ const volatile CommandBufferEntry* args =
+ static_cast<const volatile CommandBufferEntry*>(_args) + 1;
for (unsigned int i = 0; i < arg_count_; ++i) {
if (args[i].value_uint32 != args_[i].value_uint32) return false;
}
@@ -56,17 +56,17 @@ class AsyncAPIMock : public AsyncAPIInterface {
private:
unsigned int arg_count_;
- CommandBufferEntry *args_;
+ volatile CommandBufferEntry* args_;
};
- MOCK_METHOD3(DoCommand, error::Error(
- unsigned int command,
- unsigned int arg_count,
- const void* cmd_data));
+ MOCK_METHOD3(DoCommand,
+ error::Error(unsigned int command,
+ unsigned int arg_count,
+ const volatile void* cmd_data));
MOCK_METHOD4(DoCommands,
error::Error(unsigned int num_commands,
- const void* buffer,
+ const volatile void* buffer,
int num_entries,
int* entries_processed));
@@ -80,7 +80,7 @@ class AsyncAPIMock : public AsyncAPIInterface {
// Forwards the SetToken commands to the engine.
void SetToken(unsigned int command,
unsigned int arg_count,
- const void* _args);
+ const volatile void* _args);
private:
CommandBufferEngine *engine_;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc ('k') | gpu/command_buffer/service/mocks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698