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/in_process_webkit/indexed_db_dispatcher_host.h" | 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" | 10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" |
11 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" | 11 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" |
12 #include "content/browser/in_process_webkit/indexed_db_database_callbacks.h" | 12 #include "content/browser/in_process_webkit/indexed_db_database_callbacks.h" |
13 #include "content/browser/in_process_webkit/indexed_db_transaction_callbacks.h" | 13 #include "content/browser/in_process_webkit/indexed_db_transaction_callbacks.h" |
14 #include "content/browser/renderer_host/render_message_filter.h" | 14 #include "content/browser/renderer_host/render_message_filter.h" |
15 #include "content/common/indexed_db/indexed_db_messages.h" | 15 #include "content/common/indexed_db/indexed_db_messages.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/user_metrics.h" | 17 #include "content/public/browser/user_metrics.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 #include "content/public/common/result_codes.h" | 19 #include "content/public/common/result_codes.h" |
20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMStringList.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMStringList.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h
" | |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBIndex.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBIndex.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyRange.h" | |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBMetadata.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBMetadata.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
34 #include "webkit/database/database_util.h" | 31 #include "webkit/database/database_util.h" |
35 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
36 | 33 |
37 using content::BrowserMessageFilter; | 34 using content::BrowserMessageFilter; |
38 using content::BrowserThread; | 35 using content::BrowserThread; |
39 using content::IndexedDBKey; | 36 using content::IndexedDBKey; |
40 using content::IndexedDBKeyPath; | 37 using content::IndexedDBKeyPath; |
41 using content::IndexedDBKeyRange; | 38 using content::IndexedDBKeyRange; |
42 using content::UserMetricsAction; | 39 using content::UserMetricsAction; |
43 using content::SerializedScriptValue; | 40 using content::SerializedScriptValue; |
44 using webkit_database::DatabaseUtil; | 41 using webkit_database::DatabaseUtil; |
45 using WebKit::WebDOMStringList; | 42 using WebKit::WebDOMStringList; |
46 using WebKit::WebExceptionCode; | 43 using WebKit::WebExceptionCode; |
47 using WebKit::WebIDBCallbacks; | 44 using WebKit::WebIDBCallbacks; |
48 using WebKit::WebIDBCursor; | 45 using WebKit::WebIDBCursor; |
49 using WebKit::WebIDBDatabase; | 46 using WebKit::WebIDBDatabase; |
50 using WebKit::WebIDBDatabaseError; | |
51 using WebKit::WebIDBIndex; | 47 using WebKit::WebIDBIndex; |
52 using WebKit::WebIDBKey; | 48 using WebKit::WebIDBKey; |
53 using WebKit::WebIDBKeyPath; | |
54 using WebKit::WebIDBKeyRange; | |
55 using WebKit::WebIDBMetadata; | 49 using WebKit::WebIDBMetadata; |
56 using WebKit::WebIDBObjectStore; | 50 using WebKit::WebIDBObjectStore; |
57 using WebKit::WebIDBTransaction; | 51 using WebKit::WebIDBTransaction; |
58 using WebKit::WebSecurityOrigin; | 52 using WebKit::WebSecurityOrigin; |
59 using WebKit::WebSerializedScriptValue; | 53 using WebKit::WebSerializedScriptValue; |
60 using WebKit::WebVector; | 54 using WebKit::WebVector; |
61 | 55 |
62 namespace { | 56 namespace { |
63 | 57 |
64 template <class T> | 58 template <class T> |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 } | 1138 } |
1145 | 1139 |
1146 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( | 1140 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
1147 int32 object_id) { | 1141 int32 object_id) { |
1148 // TODO(dgrogan): This doesn't seem to be happening with some version change | 1142 // TODO(dgrogan): This doesn't seem to be happening with some version change |
1149 // transactions. Possibly introduced with integer version support. | 1143 // transactions. Possibly introduced with integer version support. |
1150 transaction_size_map_.erase(object_id); | 1144 transaction_size_map_.erase(object_id); |
1151 transaction_url_map_.erase(object_id); | 1145 transaction_url_map_.erase(object_id); |
1152 parent_->DestroyObject(&map_, object_id); | 1146 parent_->DestroyObject(&map_, object_id); |
1153 } | 1147 } |
OLD | NEW |