Changeset 56548 in webkit
- Timestamp:
- Mar 25, 2010 8:25:40 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56546 r56548 1 2010-03-25 Jochen Eisinger <jochen@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Forward DatabaseTracker::canEstablishDatabase to chromium layer. 6 https://bugs.webkit.org/show_bug.cgi?id=36595 7 8 * storage/chromium/DatabaseObserver.h: 9 * storage/chromium/DatabaseTrackerChromium.cpp: 10 (WebCore::DatabaseTracker::canEstablishDatabase): 11 1 12 2010-03-25 yael aharon <yael.aharon@nokia.com> 2 13 -
trunk/WebCore/storage/chromium/DatabaseObserver.h
r50434 r56548 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 35 35 36 36 class Database; 37 class ScriptExecutionContext; 38 class String; 37 39 38 40 // The implementation of this class is in the WebKit API (Chromium source tree) 39 // in webkit/api/src/DatabaseObserver.cpp.41 // in WebKit/chromium/src/DatabaseObserver.cpp. 40 42 class DatabaseObserver { 41 43 public: 44 static bool canEstablishDatabase(ScriptExecutionContext*, const String&, const String&, unsigned long); 42 45 static void databaseOpened(Database*); 43 46 static void databaseModified(Database*); -
trunk/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
r54506 r56548 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 58 58 } 59 59 60 bool DatabaseTracker::canEstablishDatabase(ScriptExecutionContext* , const String&, const String&, unsigned long)60 bool DatabaseTracker::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize) 61 61 { 62 // In Chromium, a database can always be established (even though we might not 63 // be able to write anything to it if the quota for this origin was exceeded) 64 return true; 62 return DatabaseObserver::canEstablishDatabase(scriptExecutionContext, name, displayName, estimatedSize); 65 63 } 66 64 -
trunk/WebKit/chromium/ChangeLog
r56515 r56548 1 2010-03-25 Jochen Eisinger <jochen@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Forward DatabaseTracker::canEstablishDatabase to chromium layer. 6 https://bugs.webkit.org/show_bug.cgi?id=36595 7 8 * public/WebFrameClient.h: 9 (WebKit::WebFrameClient::allowDatabase): 10 * src/DatabaseObserver.cpp: 11 (WebCore::DatabaseObserver::canEstablishDatabase): 12 * src/WebWorkerBase.h: 13 (WebKit::WebWorkerBase::allowDatabase): 14 1 15 2010-03-10 John Abd-El-Malek <jam@chromium.org> 2 16 -
trunk/WebKit/chromium/public/WebFrameClient.h
r56070 r56548 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 264 264 virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } 265 265 266 // Controls whether access to Web Databases is allowed for this frame. 267 virtual bool allowDatabase(const WebSecurityOrigin&, const WebString&, const WebString&, unsigned long) { return true; } 268 266 269 // Notifies the client that the frame would have executed script if script were enabled. 267 270 virtual void didNotAllowScript(WebFrame*) { } -
trunk/WebKit/chromium/src/DatabaseObserver.cpp
r50961 r56548 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 34 34 #include "Database.h" 35 #include "Document.h" 36 #include "ScriptExecutionContext.h" 35 37 #include "WebDatabase.h" 36 38 #include "WebDatabaseObserver.h" 39 #include "WebFrameClient.h" 40 #include "WebFrameImpl.h" 41 #include "WebSecurityOrigin.h" 42 #include "WebWorkerImpl.h" 43 #include "WorkerContext.h" 44 #include "WorkerThread.h" 37 45 38 46 using namespace WebKit; 39 47 40 48 namespace WebCore { 49 50 bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize) 51 { 52 ASSERT(isMainThread()); 53 ASSERT(scriptExecutionContext->isDocument() || scriptExecutionContext->isWorkerContext()); 54 if (scriptExecutionContext->isDocument()) { 55 Document* document = static_cast<Document*>(scriptExecutionContext); 56 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); 57 return webFrame->client()->allowDatabase(WebSecurityOrigin(scriptExecutionContext->securityOrigin()), name, displayName, estimatedSize); 58 } else { 59 WorkerContext* worker = static_cast<WorkerContext*>(scriptExecutionContext); 60 WorkerLoaderProxy* workerLoaderProxy = &worker->thread()->workerLoaderProxy(); 61 WebWorkerImpl* webWorker = reinterpret_cast<WebWorkerImpl*>(workerLoaderProxy); 62 return webWorker->allowDatabase(WebSecurityOrigin(scriptExecutionContext->securityOrigin()), name, displayName, estimatedSize); 63 } 64 } 41 65 42 66 void DatabaseObserver::databaseOpened(Database* database) -
trunk/WebKit/chromium/src/WebWorkerBase.h
r50751 r56548 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 46 46 namespace WebKit { 47 47 class WebCommonWorkerClient; 48 class WebSecurityOrigin; 49 class WebString; 48 50 class WebURL; 49 51 class WebView; 52 class WebWorker; 50 53 class WebWorkerClient; 51 54 … … 77 80 virtual void postTaskForModeToWorkerContext( 78 81 PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const WebCore::String& mode); 82 83 // Controls whether access to Web Databases is allowed for this worker. 84 virtual bool allowDatabase(const WebSecurityOrigin&, const WebString&, const WebString&, unsigned long) { return true; } 79 85 80 86 // Executes the given task on the main thread.
Note: See TracChangeset
for help on using the changeset viewer.