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

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

Issue 2624443003: Enable ThreadRestrictionVerifier for StringImpl (Closed)
Patch Set: Get rid of vestigial debugging code Created 3 years, 11 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
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 28 matching lines...) Expand all
39 #include "public/platform/Platform.h" 39 #include "public/platform/Platform.h"
40 #include "public/platform/WebDatabaseObserver.h" 40 #include "public/platform/WebDatabaseObserver.h"
41 #include "public/platform/WebSecurityOrigin.h" 41 #include "public/platform/WebSecurityOrigin.h"
42 #include "public/platform/WebTraceLocation.h" 42 #include "public/platform/WebTraceLocation.h"
43 #include "wtf/Functional.h" 43 #include "wtf/Functional.h"
44 44
45 namespace blink { 45 namespace blink {
46 46
47 namespace { 47 namespace {
48 48
49 void databaseModified(const WebSecurityOrigin& origin, 49 void databaseModified(SecurityOrigin* origin, const String& databaseName) {
50 const String& databaseName) { 50 if (Platform::current()->databaseObserver()) {
51 if (Platform::current()->databaseObserver()) 51 Platform::current()->databaseObserver()->databaseModified(
52 Platform::current()->databaseObserver()->databaseModified(origin, 52 WebSecurityOrigin(origin), databaseName);
53 databaseName); 53 }
54 }
55
56 void databaseModifiedCrossThread(const String& originString,
57 const String& databaseName) {
58 databaseModified(WebSecurityOrigin::createFromString(originString),
59 databaseName);
60 } 54 }
61 55
62 } // namespace 56 } // namespace
63 57
64 void SQLTransactionClient::didCommitWriteTransaction(Database* database) { 58 void SQLTransactionClient::didCommitWriteTransaction(Database* database) {
65 String databaseName = database->stringIdentifier(); 59 String databaseName = database->stringIdentifier();
66 ExecutionContext* executionContext = 60 ExecutionContext* executionContext =
67 database->getDatabaseContext()->getExecutionContext(); 61 database->getDatabaseContext()->getExecutionContext();
68 if (!executionContext->isContextThread()) { 62 if (!executionContext->isContextThread()) {
63 // TODO(csharrison): Is using crossThreadUnretained safe here?
69 executionContext->postTask( 64 executionContext->postTask(
70 TaskType::DatabaseAccess, BLINK_FROM_HERE, 65 TaskType::DatabaseAccess, BLINK_FROM_HERE,
71 createCrossThreadTask( 66 createCrossThreadTask(
72 &databaseModifiedCrossThread, 67 &databaseModified,
73 executionContext->getSecurityOrigin()->toRawString(), 68 crossThreadUnretained(executionContext->getSecurityOrigin()),
74 databaseName)); 69 databaseName));
75 } else { 70 } else {
76 databaseModified(WebSecurityOrigin(executionContext->getSecurityOrigin()), 71 databaseModified(executionContext->getSecurityOrigin(), databaseName);
77 databaseName);
78 } 72 }
79 } 73 }
80 74
81 bool SQLTransactionClient::didExceedQuota(Database* database) { 75 bool SQLTransactionClient::didExceedQuota(Database* database) {
82 // Chromium does not allow users to manually change the quota for an origin 76 // Chromium does not allow users to manually change the quota for an origin
83 // (for now, at least). Don't do anything. 77 // (for now, at least). Don't do anything.
84 ASSERT( 78 DCHECK(
85 database->getDatabaseContext()->getExecutionContext()->isContextThread()); 79 database->getDatabaseContext()->getExecutionContext()->isContextThread());
86 return false; 80 return false;
87 } 81 }
88 82
89 } // namespace blink 83 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698