OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "modules/webdatabase/SQLTransactionClient.h" | 31 #include "modules/webdatabase/SQLTransactionClient.h" |
32 | 32 |
33 #include "core/dom/ExecutionContext.h" | 33 #include "core/dom/ExecutionContext.h" |
34 #include "core/dom/ExecutionContextTask.h" | 34 #include "core/dom/ExecutionContextTask.h" |
| 35 #include "core/dom/TaskRunnerHelper.h" |
35 #include "modules/webdatabase/Database.h" | 36 #include "modules/webdatabase/Database.h" |
36 #include "modules/webdatabase/DatabaseContext.h" | 37 #include "modules/webdatabase/DatabaseContext.h" |
37 #include "platform/weborigin/SecurityOrigin.h" | 38 #include "platform/weborigin/SecurityOrigin.h" |
38 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
39 #include "public/platform/WebDatabaseObserver.h" | 40 #include "public/platform/WebDatabaseObserver.h" |
40 #include "public/platform/WebSecurityOrigin.h" | 41 #include "public/platform/WebSecurityOrigin.h" |
41 #include "public/platform/WebTraceLocation.h" | 42 #include "public/platform/WebTraceLocation.h" |
42 #include "wtf/Functional.h" | 43 #include "wtf/Functional.h" |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
(...skipping 14 matching lines...) Expand all Loading... |
59 } | 60 } |
60 | 61 |
61 } // namespace | 62 } // namespace |
62 | 63 |
63 void SQLTransactionClient::didCommitWriteTransaction(Database* database) { | 64 void SQLTransactionClient::didCommitWriteTransaction(Database* database) { |
64 String databaseName = database->stringIdentifier(); | 65 String databaseName = database->stringIdentifier(); |
65 ExecutionContext* executionContext = | 66 ExecutionContext* executionContext = |
66 database->getDatabaseContext()->getExecutionContext(); | 67 database->getDatabaseContext()->getExecutionContext(); |
67 if (!executionContext->isContextThread()) { | 68 if (!executionContext->isContextThread()) { |
68 executionContext->postTask( | 69 executionContext->postTask( |
69 BLINK_FROM_HERE, | 70 TaskType::DatabaseAccess, BLINK_FROM_HERE, |
70 createCrossThreadTask( | 71 createCrossThreadTask( |
71 &databaseModifiedCrossThread, | 72 &databaseModifiedCrossThread, |
72 executionContext->getSecurityOrigin()->toRawString(), | 73 executionContext->getSecurityOrigin()->toRawString(), |
73 databaseName)); | 74 databaseName)); |
74 } else { | 75 } else { |
75 databaseModified(WebSecurityOrigin(executionContext->getSecurityOrigin()), | 76 databaseModified(WebSecurityOrigin(executionContext->getSecurityOrigin()), |
76 databaseName); | 77 databaseName); |
77 } | 78 } |
78 } | 79 } |
79 | 80 |
80 bool SQLTransactionClient::didExceedQuota(Database* database) { | 81 bool SQLTransactionClient::didExceedQuota(Database* database) { |
81 // Chromium does not allow users to manually change the quota for an origin | 82 // Chromium does not allow users to manually change the quota for an origin |
82 // (for now, at least). Don't do anything. | 83 // (for now, at least). Don't do anything. |
83 ASSERT( | 84 ASSERT( |
84 database->getDatabaseContext()->getExecutionContext()->isContextThread()); | 85 database->getDatabaseContext()->getExecutionContext()->isContextThread()); |
85 return false; | 86 return false; |
86 } | 87 } |
87 | 88 |
88 } // namespace blink | 89 } // namespace blink |
OLD | NEW |