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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp

Issue 2547053003: s/ passed(...) / WTF::passed(...) / to avoid future ambiguity w/ base::Passed. (Closed)
Patch Set: Rebasing... Created 4 years 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/indexeddb/IDBValue.h" 5 #include "modules/indexeddb/IDBValue.h"
6 6
7 #include "platform/blob/BlobData.h" 7 #include "platform/blob/BlobData.h"
8 #include "public/platform/WebBlobInfo.h" 8 #include "public/platform/WebBlobInfo.h"
9 #include "public/platform/modules/indexeddb/WebIDBValue.h" 9 #include "public/platform/modules/indexeddb/WebIDBValue.h"
10 #include "wtf/PtrUtil.h" 10 #include "wtf/PtrUtil.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 IDBValue::IDBValue() = default; 14 IDBValue::IDBValue() = default;
15 15
16 IDBValue::IDBValue(const WebIDBValue& value) 16 IDBValue::IDBValue(const WebIDBValue& value)
17 : IDBValue(value.data, value.webBlobInfo, value.primaryKey, value.keyPath) { 17 : IDBValue(value.data, value.webBlobInfo, value.primaryKey, value.keyPath) {
18 } 18 }
19 19
20 IDBValue::IDBValue(PassRefPtr<SharedBuffer> data, 20 IDBValue::IDBValue(PassRefPtr<SharedBuffer> data,
21 const WebVector<WebBlobInfo>& webBlobInfo, 21 const WebVector<WebBlobInfo>& webBlobInfo,
22 IDBKey* primaryKey, 22 IDBKey* primaryKey,
23 const IDBKeyPath& keyPath) 23 const IDBKeyPath& keyPath)
24 : m_data(data), 24 : m_data(data),
25 m_blobData(makeUnique<Vector<RefPtr<BlobDataHandle>>>()), 25 m_blobData(WTF::makeUnique<Vector<RefPtr<BlobDataHandle>>>()),
26 m_blobInfo(wrapUnique(new Vector<WebBlobInfo>(webBlobInfo.size()))), 26 m_blobInfo(WTF::wrapUnique(new Vector<WebBlobInfo>(webBlobInfo.size()))),
27 m_primaryKey(primaryKey && primaryKey->isValid() ? primaryKey : nullptr), 27 m_primaryKey(primaryKey && primaryKey->isValid() ? primaryKey : nullptr),
28 m_keyPath(keyPath) { 28 m_keyPath(keyPath) {
29 for (size_t i = 0; i < webBlobInfo.size(); ++i) { 29 for (size_t i = 0; i < webBlobInfo.size(); ++i) {
30 const WebBlobInfo& info = (*m_blobInfo)[i] = webBlobInfo[i]; 30 const WebBlobInfo& info = (*m_blobInfo)[i] = webBlobInfo[i];
31 m_blobData->append( 31 m_blobData->append(
32 BlobDataHandle::create(info.uuid(), info.type(), info.size())); 32 BlobDataHandle::create(info.uuid(), info.type(), info.size()));
33 } 33 }
34 } 34 }
35 35
36 IDBValue::IDBValue(const IDBValue* value, 36 IDBValue::IDBValue(const IDBValue* value,
37 IDBKey* primaryKey, 37 IDBKey* primaryKey,
38 const IDBKeyPath& keyPath) 38 const IDBKeyPath& keyPath)
39 : m_data(value->m_data), 39 : m_data(value->m_data),
40 m_blobData(makeUnique<Vector<RefPtr<BlobDataHandle>>>()), 40 m_blobData(WTF::makeUnique<Vector<RefPtr<BlobDataHandle>>>()),
41 m_blobInfo( 41 m_blobInfo(
42 wrapUnique(new Vector<WebBlobInfo>(value->m_blobInfo->size()))), 42 WTF::wrapUnique(new Vector<WebBlobInfo>(value->m_blobInfo->size()))),
43 m_primaryKey(primaryKey), 43 m_primaryKey(primaryKey),
44 m_keyPath(keyPath) { 44 m_keyPath(keyPath) {
45 for (size_t i = 0; i < value->m_blobInfo->size(); ++i) { 45 for (size_t i = 0; i < value->m_blobInfo->size(); ++i) {
46 const WebBlobInfo& info = (*m_blobInfo)[i] = value->m_blobInfo->at(i); 46 const WebBlobInfo& info = (*m_blobInfo)[i] = value->m_blobInfo->at(i);
47 m_blobData->append( 47 m_blobData->append(
48 BlobDataHandle::create(info.uuid(), info.type(), info.size())); 48 BlobDataHandle::create(info.uuid(), info.type(), info.size()));
49 } 49 }
50 } 50 }
51 51
52 IDBValue::~IDBValue() {} 52 IDBValue::~IDBValue() {}
(...skipping 22 matching lines...) Expand all
75 75
76 const SharedBuffer* IDBValue::data() const { 76 const SharedBuffer* IDBValue::data() const {
77 return m_data.get(); 77 return m_data.get();
78 } 78 }
79 79
80 bool IDBValue::isNull() const { 80 bool IDBValue::isNull() const {
81 return !m_data.get(); 81 return !m_data.get();
82 } 82 }
83 83
84 } // namespace blink 84 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698