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

Side by Side Diff: Source/modules/webdatabase/DatabaseContext.cpp

Issue 564713002: Web SQL: Remove more worker-related code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Windows build Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. 3 * Copyright (C) 2011 Google, Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // because the database closing process may still make use of this context. 127 // because the database closing process may still make use of this context.
128 // It is not safe to just delete the context here. 128 // It is not safe to just delete the context here.
129 void DatabaseContext::contextDestroyed() 129 void DatabaseContext::contextDestroyed()
130 { 130 {
131 RefPtrWillBeRawPtr<DatabaseContext> protector(this); 131 RefPtrWillBeRawPtr<DatabaseContext> protector(this);
132 stopDatabases(); 132 stopDatabases();
133 DatabaseManager::manager().unregisterDatabaseContext(this); 133 DatabaseManager::manager().unregisterDatabaseContext(this);
134 ActiveDOMObject::contextDestroyed(); 134 ActiveDOMObject::contextDestroyed();
135 } 135 }
136 136
137 // stop() is from stopActiveDOMObjects() which indicates that the owner LocalFra me 137 // stop() is from stopActiveDOMObjects() which indicates that the owner
138 // or WorkerThread is shutting down. Initiate the orderly shutdown by stopping 138 // LocalFrame is shutting down. Initiate the orderly shutdown by stopping the
139 // the associated databases. 139 // associated databases.
140 void DatabaseContext::stop() 140 void DatabaseContext::stop()
141 { 141 {
142 stopDatabases(); 142 stopDatabases();
143 } 143 }
144 144
145 DatabaseContext* DatabaseContext::backend() 145 DatabaseContext* DatabaseContext::backend()
146 { 146 {
147 return this; 147 return this;
148 } 148 }
149 149
(...skipping 30 matching lines...) Expand all
180 if (m_databaseThread && !m_hasRequestedTermination) { 180 if (m_databaseThread && !m_hasRequestedTermination) {
181 TaskSynchronizer sync; 181 TaskSynchronizer sync;
182 m_databaseThread->requestTermination(&sync); 182 m_databaseThread->requestTermination(&sync);
183 m_hasRequestedTermination = true; 183 m_hasRequestedTermination = true;
184 sync.waitForTaskCompletion(); 184 sync.waitForTaskCompletion();
185 } 185 }
186 } 186 }
187 187
188 bool DatabaseContext::allowDatabaseAccess() const 188 bool DatabaseContext::allowDatabaseAccess() const
189 { 189 {
190 if (executionContext()->isDocument()) 190 return toDocument(executionContext())->isActive();
191 return toDocument(executionContext())->isActive();
192 ASSERT(executionContext()->isWorkerGlobalScope());
193 // allowDatabaseAccess is not yet implemented for workers.
194 return true;
195 } 191 }
196 192
197 SecurityOrigin* DatabaseContext::securityOrigin() const 193 SecurityOrigin* DatabaseContext::securityOrigin() const
198 { 194 {
199 return executionContext()->securityOrigin(); 195 return executionContext()->securityOrigin();
200 } 196 }
201 197
202 bool DatabaseContext::isContextThread() const 198 bool DatabaseContext::isContextThread() const
203 { 199 {
204 return executionContext()->isContextThread(); 200 return executionContext()->isContextThread();
205 } 201 }
206 202
207 } // namespace blink 203 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DatabaseContext.h ('k') | Source/modules/webdatabase/DatabaseManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698