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

Side by Side Diff: mojo/edk/system/shared_buffer_dispatcher.cc

Issue 1958823002: Fix implicit access to raw pointer of scoped_refptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Splitting out change to scoped_refptr to follow up patch. Created 4 years, 7 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
« no previous file with comments | « media/gpu/h264_decoder.cc ('k') | mojo/edk/system/wait_set_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/edk/system/shared_buffer_dispatcher.h" 5 #include "mojo/edk/system/shared_buffer_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return false; 269 return false;
270 } 270 }
271 handles[0] = handle_for_transit_.get(); 271 handles[0] = handle_for_transit_.get();
272 return true; 272 return true;
273 } 273 }
274 274
275 bool SharedBufferDispatcher::BeginTransit() { 275 bool SharedBufferDispatcher::BeginTransit() {
276 base::AutoLock lock(lock_); 276 base::AutoLock lock(lock_);
277 if (in_transit_) 277 if (in_transit_)
278 return false; 278 return false;
279 in_transit_ = shared_buffer_ != nullptr; 279 in_transit_ = static_cast<bool>(shared_buffer_);
280 return in_transit_; 280 return in_transit_;
281 } 281 }
282 282
283 void SharedBufferDispatcher::CompleteTransitAndClose() { 283 void SharedBufferDispatcher::CompleteTransitAndClose() {
284 base::AutoLock lock(lock_); 284 base::AutoLock lock(lock_);
285 in_transit_ = false; 285 in_transit_ = false;
286 shared_buffer_ = nullptr; 286 shared_buffer_ = nullptr;
287 ignore_result(handle_for_transit_.release()); 287 ignore_result(handle_for_transit_.release());
288 } 288 }
289 289
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 // Checks for fields beyond |flags|: 331 // Checks for fields beyond |flags|:
332 332
333 // (Nothing here yet.) 333 // (Nothing here yet.)
334 334
335 return MOJO_RESULT_OK; 335 return MOJO_RESULT_OK;
336 } 336 }
337 337
338 } // namespace edk 338 } // namespace edk
339 } // namespace mojo 339 } // namespace mojo
OLDNEW
« no previous file with comments | « media/gpu/h264_decoder.cc ('k') | mojo/edk/system/wait_set_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698