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

Side by Side Diff: Source/WebCore/Modules/webdatabase/DatabaseContext.cpp

Issue 13861033: Remove Apple's unused implementation of private browsing from WebCore (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (!document->page())
208 return false; 208 return false;
209 return true; 209 return true;
abarth-chromium 2013/04/10 18:40:03 This can be simplified to just "return document->p
210 } 210 }
211 ASSERT(m_scriptExecutionContext->isWorkerContext()); 211 ASSERT(m_scriptExecutionContext->isWorkerContext());
212 // allowDatabaseAccess is not yet implemented for workers. 212 // allowDatabaseAccess is not yet implemented for workers.
213 return true; 213 return true;
214 } 214 }
215 215
216 void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails details) 216 void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails details)
217 { 217 {
218 if (m_scriptExecutionContext->isDocument()) { 218 if (m_scriptExecutionContext->isDocument()) {
219 Document* document = toDocument(m_scriptExecutionContext); 219 Document* document = toDocument(m_scriptExecutionContext);
220 if (Page* page = document->page()) 220 if (Page* page = document->page())
221 page->chrome()->client()->exceededDatabaseQuota(document->frame(), n ame, details); 221 page->chrome()->client()->exceededDatabaseQuota(document->frame(), n ame, details);
222 return; 222 return;
223 } 223 }
224 ASSERT(m_scriptExecutionContext->isWorkerContext()); 224 ASSERT(m_scriptExecutionContext->isWorkerContext());
225 #if !PLATFORM(CHROMIUM) 225 #if !PLATFORM(CHROMIUM)
226 // FIXME: This needs a real implementation; this is a temporary solution for testing. 226 // FIXME: This needs a real implementation; this is a temporary solution for testing.
227 const unsigned long long defaultQuota = 5 * 1024 * 1024; 227 const unsigned long long defaultQuota = 5 * 1024 * 1024;
228 DatabaseManager::manager().setQuota(m_scriptExecutionContext->securityOrigin (), defaultQuota); 228 DatabaseManager::manager().setQuota(m_scriptExecutionContext->securityOrigin (), defaultQuota);
229 #endif 229 #endif
230 } 230 }
231 231
232 } // namespace WebCore 232 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698