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

Side by Side Diff: Source/platform/graphics/ThreadSafeDataTransport.cpp

Issue 858663002: Fix template angle bracket syntax in platform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 11 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 { 38 {
39 } 39 }
40 40
41 ThreadSafeDataTransport::~ThreadSafeDataTransport() 41 ThreadSafeDataTransport::~ThreadSafeDataTransport()
42 { 42 {
43 } 43 }
44 44
45 void ThreadSafeDataTransport::setData(SharedBuffer* buffer, bool allDataReceived ) 45 void ThreadSafeDataTransport::setData(SharedBuffer* buffer, bool allDataReceived )
46 { 46 {
47 ASSERT(buffer->size() >= m_readPosition); 47 ASSERT(buffer->size() >= m_readPosition);
48 Vector<RefPtr<SharedBuffer> > newBufferQueue; 48 Vector<RefPtr<SharedBuffer>> newBufferQueue;
49 49
50 const char* segment = 0; 50 const char* segment = 0;
51 while (size_t length = buffer->getSomeData(segment, m_readPosition)) { 51 while (size_t length = buffer->getSomeData(segment, m_readPosition)) {
52 m_readPosition += length; 52 m_readPosition += length;
53 newBufferQueue.append(SharedBuffer::create(segment, length)); 53 newBufferQueue.append(SharedBuffer::create(segment, length));
54 } 54 }
55 55
56 MutexLocker locker(m_mutex); 56 MutexLocker locker(m_mutex);
57 m_newBufferQueue.appendVector(newBufferQueue); 57 m_newBufferQueue.appendVector(newBufferQueue);
58 newBufferQueue.clear(); 58 newBufferQueue.clear();
59 m_allDataReceived = allDataReceived; 59 m_allDataReceived = allDataReceived;
60 } 60 }
61 61
62 void ThreadSafeDataTransport::data(SharedBuffer** buffer, bool* allDataReceived) 62 void ThreadSafeDataTransport::data(SharedBuffer** buffer, bool* allDataReceived)
63 { 63 {
64 ASSERT(buffer); 64 ASSERT(buffer);
65 ASSERT(allDataReceived); 65 ASSERT(allDataReceived);
66 Vector<RefPtr<SharedBuffer> > newBufferQueue; 66 Vector<RefPtr<SharedBuffer>> newBufferQueue;
67 { 67 {
68 MutexLocker lock(m_mutex); 68 MutexLocker lock(m_mutex);
69 m_newBufferQueue.swap(newBufferQueue); 69 m_newBufferQueue.swap(newBufferQueue);
70 *allDataReceived = m_allDataReceived; 70 *allDataReceived = m_allDataReceived;
71 } 71 }
72 for (size_t i = 0; i < newBufferQueue.size(); ++i) 72 for (size_t i = 0; i < newBufferQueue.size(); ++i)
73 m_readBuffer->append(newBufferQueue[i].get()); 73 m_readBuffer->append(newBufferQueue[i].get());
74 *buffer = m_readBuffer.get(); 74 *buffer = m_readBuffer.get();
75 } 75 }
76 76
77 bool ThreadSafeDataTransport::hasNewData() 77 bool ThreadSafeDataTransport::hasNewData()
78 { 78 {
79 MutexLocker lock(m_mutex); 79 MutexLocker lock(m_mutex);
80 return !m_newBufferQueue.isEmpty(); 80 return !m_newBufferQueue.isEmpty();
81 } 81 }
82 82
83 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/ThreadSafeDataTransport.h ('k') | Source/platform/graphics/filters/FilterEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698