OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 int32 GenerateStreamID(); | 183 int32 GenerateStreamID(); |
184 | 184 |
185 // Sends a synchronous nop to the server which validate that all previous IPC | 185 // Sends a synchronous nop to the server which validate that all previous IPC |
186 // messages have been received. Once the synchronous nop has been sent to the | 186 // messages have been received. Once the synchronous nop has been sent to the |
187 // server all previous flushes will all be marked as validated, including | 187 // server all previous flushes will all be marked as validated, including |
188 // flushes for other streams on the same channel. Once a validation has been | 188 // flushes for other streams on the same channel. Once a validation has been |
189 // sent, it will return the highest validated flush id for the stream. | 189 // sent, it will return the highest validated flush id for the stream. |
190 // If the validation fails (which can only happen upon context lost), the | 190 // If the validation fails (which can only happen upon context lost), the |
191 // highest validated flush id will not change. If no flush ID were ever | 191 // highest validated flush id will not change. If no flush ID were ever |
192 // validated then it will return 0 (Note the lowest valid flush ID is 1). | 192 // validated then it will return 0 (Note the lowest valid flush ID is 1). |
193 uint32_t ValidateFlushIDReachedServer(int32 stream_id, bool force_validate); | 193 uint32_t ValidateFlushIDReachedServer(int32 stream_id); |
194 | 194 |
195 // Returns the highest validated flush ID for a given stream. | 195 // Returns the highest validated flush ID for a given stream. |
196 uint32_t GetHighestValidatedFlushID(int32 stream_id); | 196 uint32_t GetHighestValidatedFlushID(int32 stream_id); |
197 | 197 |
198 private: | 198 private: |
199 friend class base::RefCountedThreadSafe<GpuChannelHost>; | 199 friend class base::RefCountedThreadSafe<GpuChannelHost>; |
200 | 200 |
201 // A filter used internally to route incoming messages from the IO thread | 201 // A filter used internally to route incoming messages from the IO thread |
202 // to the correct message loop. It also maintains some shared state between | 202 // to the correct message loop. It also maintains some shared state between |
203 // all the contexts. | 203 // all the contexts. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 mutable base::Lock context_lock_; | 303 mutable base::Lock context_lock_; |
304 scoped_ptr<IPC::SyncChannel> channel_; | 304 scoped_ptr<IPC::SyncChannel> channel_; |
305 base::hash_map<int32, StreamFlushInfo> stream_flush_info_; | 305 base::hash_map<int32, StreamFlushInfo> stream_flush_info_; |
306 | 306 |
307 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 307 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
308 }; | 308 }; |
309 | 309 |
310 } // namespace content | 310 } // namespace content |
311 | 311 |
312 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 312 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |