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

Side by Side Diff: content/browser/indexed_db/indexed_db_callbacks.cc

Issue 2521903004: Use a scoped_refptr in the IndexedDBCallbacks constructor. (Closed)
Patch Set: 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 (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 #include "content/browser/indexed_db/indexed_db_callbacks.h" 5 #include "content/browser/indexed_db/indexed_db_callbacks.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 std::vector<::indexed_db::mojom::BlobInfoPtr>* blob_or_file_info); 134 std::vector<::indexed_db::mojom::BlobInfoPtr>* blob_or_file_info);
135 135
136 private: 136 private:
137 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 137 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
138 ::indexed_db::mojom::CallbacksAssociatedPtr callbacks_; 138 ::indexed_db::mojom::CallbacksAssociatedPtr callbacks_;
139 139
140 DISALLOW_COPY_AND_ASSIGN(IOThreadHelper); 140 DISALLOW_COPY_AND_ASSIGN(IOThreadHelper);
141 }; 141 };
142 142
143 IndexedDBCallbacks::IndexedDBCallbacks( 143 IndexedDBCallbacks::IndexedDBCallbacks(
144 IndexedDBDispatcherHost* dispatcher_host, 144 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
145 const url::Origin& origin, 145 const url::Origin& origin,
146 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info) 146 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info)
147 : dispatcher_host_(dispatcher_host), 147 : dispatcher_host_(std::move(dispatcher_host)),
148 host_transaction_id_(kNoTransaction), 148 host_transaction_id_(kNoTransaction),
149 origin_(origin), 149 origin_(origin),
150 data_loss_(blink::WebIDBDataLossNone), 150 data_loss_(blink::WebIDBDataLossNone),
151 sent_blocked_(false), 151 sent_blocked_(false),
152 io_helper_( 152 io_helper_(
153 new IOThreadHelper(std::move(callbacks_info), dispatcher_host_)) { 153 new IOThreadHelper(std::move(callbacks_info), dispatcher_host_)) {
154 DCHECK_CURRENTLY_ON(BrowserThread::IO); 154 DCHECK_CURRENTLY_ON(BrowserThread::IO);
155 thread_checker_.DetachFromThread(); 155 thread_checker_.DetachFromThread();
156 } 156 }
157 157
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 IDB_TRACE("IndexedDBCallbacks::CreateAllBlobs"); 608 IDB_TRACE("IndexedDBCallbacks::CreateAllBlobs");
609 DCHECK_EQ(blob_info.size(), blob_or_file_info->size()); 609 DCHECK_EQ(blob_info.size(), blob_or_file_info->size());
610 if (!dispatcher_host_->blob_storage_context()) 610 if (!dispatcher_host_->blob_storage_context())
611 return false; 611 return false;
612 for (size_t i = 0; i < blob_info.size(); ++i) 612 for (size_t i = 0; i < blob_info.size(); ++i)
613 (*blob_or_file_info)[i]->uuid = CreateBlobData(blob_info[i]); 613 (*blob_or_file_info)[i]->uuid = CreateBlobData(blob_info[i]);
614 return true; 614 return true;
615 } 615 }
616 616
617 } // namespace content 617 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698