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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp

Issue 2741443003: Replace createCrossThreadTask with crossThreadBind in webdatabase (Closed)
Patch Set: comment Created 3 years, 9 months 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
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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"
35 #include "core/dom/TaskRunnerHelper.h" 34 #include "core/dom/TaskRunnerHelper.h"
36 #include "modules/webdatabase/Database.h" 35 #include "modules/webdatabase/Database.h"
37 #include "modules/webdatabase/DatabaseContext.h" 36 #include "modules/webdatabase/DatabaseContext.h"
37 #include "platform/CrossThreadFunctional.h"
38 #include "platform/WebTaskRunner.h"
38 #include "platform/weborigin/SecurityOrigin.h" 39 #include "platform/weborigin/SecurityOrigin.h"
39 #include "public/platform/Platform.h" 40 #include "public/platform/Platform.h"
40 #include "public/platform/WebDatabaseObserver.h" 41 #include "public/platform/WebDatabaseObserver.h"
41 #include "public/platform/WebSecurityOrigin.h" 42 #include "public/platform/WebSecurityOrigin.h"
42 #include "public/platform/WebTraceLocation.h" 43 #include "public/platform/WebTraceLocation.h"
43 #include "wtf/Functional.h" 44 #include "wtf/Functional.h"
44 45
45 namespace blink { 46 namespace blink {
46 47
47 namespace { 48 namespace {
(...skipping 12 matching lines...) Expand all
60 } 61 }
61 62
62 } // namespace 63 } // namespace
63 64
64 void SQLTransactionClient::didCommitWriteTransaction(Database* database) { 65 void SQLTransactionClient::didCommitWriteTransaction(Database* database) {
65 String databaseName = database->stringIdentifier(); 66 String databaseName = database->stringIdentifier();
66 ExecutionContext* executionContext = 67 ExecutionContext* executionContext =
67 database->getDatabaseContext()->getExecutionContext(); 68 database->getDatabaseContext()->getExecutionContext();
68 SecurityOrigin* origin = database->getSecurityOrigin(); 69 SecurityOrigin* origin = database->getSecurityOrigin();
69 if (!executionContext->isContextThread()) { 70 if (!executionContext->isContextThread()) {
70 executionContext->postTask( 71 database->getDatabaseTaskRunner()->postTask(
71 TaskType::DatabaseAccess, BLINK_FROM_HERE, 72 BLINK_FROM_HERE, crossThreadBind(&databaseModifiedCrossThread,
72 createCrossThreadTask(&databaseModifiedCrossThread, 73 origin->toRawString(), databaseName));
73 origin->toRawString(), databaseName));
74 } else { 74 } else {
75 databaseModified(WebSecurityOrigin(origin), databaseName); 75 databaseModified(WebSecurityOrigin(origin), databaseName);
76 } 76 }
77 } 77 }
78 78
79 bool SQLTransactionClient::didExceedQuota(Database* database) { 79 bool SQLTransactionClient::didExceedQuota(Database* database) {
80 // Chromium does not allow users to manually change the quota for an origin 80 // Chromium does not allow users to manually change the quota for an origin
81 // (for now, at least). Don't do anything. 81 // (for now, at least). Don't do anything.
82 ASSERT( 82 ASSERT(
83 database->getDatabaseContext()->getExecutionContext()->isContextThread()); 83 database->getDatabaseContext()->getExecutionContext()->isContextThread());
84 return false; 84 return false;
85 } 85 }
86 86
87 } // namespace blink 87 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698