| OLD | NEW |
| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 m_hasRequestedTermination = true; | 197 m_hasRequestedTermination = true; |
| 198 return true; | 198 return true; |
| 199 } | 199 } |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 | 202 |
| 203 bool DatabaseContext::allowDatabaseAccess() const | 203 bool DatabaseContext::allowDatabaseAccess() const |
| 204 { | 204 { |
| 205 if (m_scriptExecutionContext->isDocument()) { | 205 if (m_scriptExecutionContext->isDocument()) { |
| 206 Document* document = toDocument(m_scriptExecutionContext); | 206 Document* document = toDocument(m_scriptExecutionContext); |
| 207 if (!document->page() || (document->page()->settings()->privateBrowsingE
nabled() && !SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document->sec
urityOrigin()->protocol()))) | 207 return document->page(); |
| 208 return false; | |
| 209 return true; | |
| 210 } | 208 } |
| 211 ASSERT(m_scriptExecutionContext->isWorkerContext()); | 209 ASSERT(m_scriptExecutionContext->isWorkerContext()); |
| 212 // allowDatabaseAccess is not yet implemented for workers. | 210 // allowDatabaseAccess is not yet implemented for workers. |
| 213 return true; | 211 return true; |
| 214 } | 212 } |
| 215 | 213 |
| 216 void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails
details) | 214 void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails
details) |
| 217 { | 215 { |
| 218 if (m_scriptExecutionContext->isDocument()) { | 216 if (m_scriptExecutionContext->isDocument()) { |
| 219 Document* document = toDocument(m_scriptExecutionContext); | 217 Document* document = toDocument(m_scriptExecutionContext); |
| 220 if (Page* page = document->page()) | 218 if (Page* page = document->page()) |
| 221 page->chrome()->client()->exceededDatabaseQuota(document->frame(), n
ame, details); | 219 page->chrome()->client()->exceededDatabaseQuota(document->frame(), n
ame, details); |
| 222 return; | 220 return; |
| 223 } | 221 } |
| 224 ASSERT(m_scriptExecutionContext->isWorkerContext()); | 222 ASSERT(m_scriptExecutionContext->isWorkerContext()); |
| 225 } | 223 } |
| 226 | 224 |
| 227 } // namespace WebCore | 225 } // namespace WebCore |
| OLD | NEW |