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 #include "content/browser/indexed_db/indexed_db_callbacks.h" | 5 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 return true; | 256 return true; |
257 } | 257 } |
258 | 258 |
259 template <class ParamType, class MsgType> | 259 template <class ParamType, class MsgType> |
260 static void CreateBlobsAndSend( | 260 static void CreateBlobsAndSend( |
261 ParamType* params, | 261 ParamType* params, |
262 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, | 262 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, |
263 const std::vector<IndexedDBBlobInfo>& blob_info, | 263 const std::vector<IndexedDBBlobInfo>& blob_info, |
264 std::vector<IndexedDBMsg_BlobOrFileInfo>* blob_or_file_info) { | 264 std::vector<IndexedDBMsg_BlobOrFileInfo>* blob_or_file_info) { |
265 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 265 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
266 if (CreateAllBlobs(blob_info, blob_or_file_info, dispatcher_host)) | 266 if (CreateAllBlobs(blob_info, blob_or_file_info, dispatcher_host)) |
267 dispatcher_host->Send(new MsgType(*params)); | 267 dispatcher_host->Send(new MsgType(*params)); |
268 } | 268 } |
269 | 269 |
270 static void BlobLookupForCursorPrefetch( | 270 static void BlobLookupForCursorPrefetch( |
271 IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params* params, | 271 IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params* params, |
272 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, | 272 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, |
273 const std::vector<IndexedDBValue>& values) { | 273 const std::vector<IndexedDBValue>& values) { |
274 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 274 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
275 DCHECK_EQ(values.size(), params->blob_or_file_infos.size()); | 275 DCHECK_EQ(values.size(), params->blob_or_file_infos.size()); |
276 | 276 |
277 std::vector<IndexedDBValue>::const_iterator value_iter; | 277 std::vector<IndexedDBValue>::const_iterator value_iter; |
278 std::vector<std::vector<IndexedDBMsg_BlobOrFileInfo> >::iterator blob_iter; | 278 std::vector<std::vector<IndexedDBMsg_BlobOrFileInfo> >::iterator blob_iter; |
279 for (value_iter = values.begin(), blob_iter = | 279 for (value_iter = values.begin(), blob_iter = |
280 params->blob_or_file_infos.begin(); value_iter != values.end(); | 280 params->blob_or_file_infos.begin(); value_iter != values.end(); |
281 ++value_iter, ++blob_iter) { | 281 ++value_iter, ++blob_iter) { |
282 if (!CreateAllBlobs(value_iter->blob_info, &*blob_iter, dispatcher_host)) | 282 if (!CreateAllBlobs(value_iter->blob_info, &*blob_iter, dispatcher_host)) |
283 return; | 283 return; |
284 } | 284 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 ipc_thread_id_, ipc_callbacks_id_)); | 583 ipc_thread_id_, ipc_callbacks_id_)); |
584 dispatcher_host_ = NULL; | 584 dispatcher_host_ = NULL; |
585 } | 585 } |
586 | 586 |
587 void IndexedDBCallbacks::SetConnectionOpenStartTime( | 587 void IndexedDBCallbacks::SetConnectionOpenStartTime( |
588 const base::TimeTicks& start_time) { | 588 const base::TimeTicks& start_time) { |
589 connection_open_start_time_ = start_time; | 589 connection_open_start_time_ = start_time; |
590 } | 590 } |
591 | 591 |
592 } // namespace content | 592 } // namespace content |
OLD | NEW |