OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/child/indexed_db/indexed_db_dispatcher.h" | 5 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace content { | 33 namespace content { |
34 static base::LazyInstance<ThreadLocalPointer<IndexedDBDispatcher> >::Leaky | 34 static base::LazyInstance<ThreadLocalPointer<IndexedDBDispatcher> >::Leaky |
35 g_idb_dispatcher_tls = LAZY_INSTANCE_INITIALIZER; | 35 g_idb_dispatcher_tls = LAZY_INSTANCE_INITIALIZER; |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 IndexedDBDispatcher* const kHasBeenDeleted = | 39 IndexedDBDispatcher* const kHasBeenDeleted = |
40 reinterpret_cast<IndexedDBDispatcher*>(0x1); | 40 reinterpret_cast<IndexedDBDispatcher*>(0x1); |
41 | 41 |
42 int32 CurrentWorkerId() { | |
43 return WorkerTaskRunner::Instance()->CurrentWorkerId(); | |
44 } | |
45 } // unnamed namespace | 42 } // unnamed namespace |
46 | 43 |
47 const size_t kMaxIDBValueSizeInBytes = 64 * 1024 * 1024; | 44 const size_t kMaxIDBValueSizeInBytes = 64 * 1024 * 1024; |
48 | 45 |
49 IndexedDBDispatcher::IndexedDBDispatcher(ThreadSafeSender* thread_safe_sender) | 46 IndexedDBDispatcher::IndexedDBDispatcher(ThreadSafeSender* thread_safe_sender) |
50 : thread_safe_sender_(thread_safe_sender) { | 47 : thread_safe_sender_(thread_safe_sender) { |
51 g_idb_dispatcher_tls.Pointer()->Set(this); | 48 g_idb_dispatcher_tls.Pointer()->Set(this); |
52 } | 49 } |
53 | 50 |
54 IndexedDBDispatcher::~IndexedDBDispatcher() { | 51 IndexedDBDispatcher::~IndexedDBDispatcher() { |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 int32 ipc_exception_cursor_id) { | 711 int32 ipc_exception_cursor_id) { |
715 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; | 712 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; |
716 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { | 713 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { |
717 if (i->first == ipc_exception_cursor_id) | 714 if (i->first == ipc_exception_cursor_id) |
718 continue; | 715 continue; |
719 i->second->ResetPrefetchCache(); | 716 i->second->ResetPrefetchCache(); |
720 } | 717 } |
721 } | 718 } |
722 | 719 |
723 } // namespace content | 720 } // namespace content |
OLD | NEW |