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

Side by Side Diff: Source/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: Repatch to ToT 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
« no previous file with comments | « Source/WebCore/storage/StorageAreaImpl.cpp ('k') | Tools/DumpRenderTree/DumpRenderTree.gypi » ('j') | 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) 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 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
OLDNEW
« no previous file with comments | « Source/WebCore/storage/StorageAreaImpl.cpp ('k') | Tools/DumpRenderTree/DumpRenderTree.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698