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

Side by Side Diff: native_client_sdk/src/libraries/ppapi_main/ppapi_queue.cc

Issue 13106002: [NaCl SDK] A bunch of spelling fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix presubmit Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <assert.h> 5 #include <assert.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "ppapi_main/ppapi_queue.h" 9 #include "ppapi_main/ppapi_queue.h"
10 10
(...skipping 17 matching lines...) Expand all
28 if (array_) return false; 28 if (array_) return false;
29 29
30 array_ = new void*[queue_size]; 30 array_ = new void*[queue_size];
31 size_ = queue_size; 31 size_ = queue_size;
32 32
33 memset(array_, 0, sizeof(void*) * queue_size); 33 memset(array_, 0, sizeof(void*) * queue_size);
34 return true; 34 return true;
35 } 35 }
36 36
37 bool PPAPIQueue::AddNewMessage(void* msg) { 37 bool PPAPIQueue::AddNewMessage(void* msg) {
38 // Writting a NULL message is illegal 38 // Writing a NULL message is illegal
39 assert(array_ != NULL); 39 assert(array_ != NULL);
40 assert(msg != NULL); 40 assert(msg != NULL);
41 41
42 // If the slot not empty, the queue must be full. Calling RemoveStaleMessage 42 // If the slot not empty, the queue must be full. Calling RemoveStaleMessage
43 // may create space by freeing messages that have already been read. 43 // may create space by freeing messages that have already been read.
44 if (array_[write_] != NULL) return false; 44 if (array_[write_] != NULL) return false;
45 45
46 // Write to the spot 46 // Write to the spot
47 array_[write_] = msg; 47 array_[write_] = msg;
48 48
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void PPAPIQueue::ReleaseTopMessage(void* msg) { 88 void PPAPIQueue::ReleaseTopMessage(void* msg) {
89 // Verify we currently acquire message. 89 // Verify we currently acquire message.
90 assert(msg != NULL); 90 assert(msg != NULL);
91 assert(msg == last_msg_); 91 assert(msg == last_msg_);
92 92
93 last_msg_ = NULL; 93 last_msg_ = NULL;
94 94
95 // Signal that the message can be freed. 95 // Signal that the message can be freed.
96 read_ = (read_ + 1) % size_; 96 read_ = (read_ + 1) % size_;
97 } 97 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/ppapi_main/ppapi_queue.h ('k') | native_client_sdk/src/libraries/utils/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698