| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 4210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4221 | 4221 |
| 4222 WebSecurityOrigin origin = frame->document().securityOrigin(); | 4222 WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 4223 if (origin.isUnique()) { | 4223 if (origin.isUnique()) { |
| 4224 // Unique origins cannot store persistent state. | 4224 // Unique origins cannot store persistent state. |
| 4225 callbacks->didFail(WebKit::WebFileErrorAbort); | 4225 callbacks->didFail(WebKit::WebFileErrorAbort); |
| 4226 return; | 4226 return; |
| 4227 } | 4227 } |
| 4228 | 4228 |
| 4229 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( | 4229 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( |
| 4230 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type), | 4230 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type), |
| 4231 size, create, new WebFileSystemCallbackDispatcher(callbacks)); | 4231 size, create, |
| 4232 base::Bind(&WebFileSystemCallbackDispatcher::DidOpenFileSystem, |
| 4233 base::Owned(new WebFileSystemCallbackDispatcher(callbacks)))); |
| 4232 } | 4234 } |
| 4233 | 4235 |
| 4234 void RenderViewImpl::deleteFileSystem( | 4236 void RenderViewImpl::deleteFileSystem( |
| 4235 WebFrame* frame, | 4237 WebFrame* frame, |
| 4236 WebKit::WebFileSystemType type , | 4238 WebKit::WebFileSystemType type , |
| 4237 WebFileSystemCallbacks* callbacks) { | 4239 WebFileSystemCallbacks* callbacks) { |
| 4238 DCHECK(callbacks); | 4240 DCHECK(callbacks); |
| 4239 | 4241 |
| 4240 WebSecurityOrigin origin = frame->document().securityOrigin(); | 4242 WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 4241 if (origin.isUnique()) { | 4243 if (origin.isUnique()) { |
| 4242 // Unique origins cannot store persistent state. | 4244 // Unique origins cannot store persistent state. |
| 4243 callbacks->didSucceed(); | 4245 callbacks->didSucceed(); |
| 4244 return; | 4246 return; |
| 4245 } | 4247 } |
| 4246 | 4248 |
| 4247 ChildThread::current()->file_system_dispatcher()->DeleteFileSystem( | 4249 ChildThread::current()->file_system_dispatcher()->DeleteFileSystem( |
| 4248 GURL(origin.toString()), | 4250 GURL(origin.toString()), |
| 4249 static_cast<fileapi::FileSystemType>(type), | 4251 static_cast<fileapi::FileSystemType>(type), |
| 4250 new WebFileSystemCallbackDispatcher(callbacks)); | 4252 base::Bind(&WebFileSystemCallbackDispatcher::DidFinish, |
| 4253 base::Owned(new WebFileSystemCallbackDispatcher(callbacks)))); |
| 4251 } | 4254 } |
| 4252 | 4255 |
| 4253 void RenderViewImpl::queryStorageUsageAndQuota( | 4256 void RenderViewImpl::queryStorageUsageAndQuota( |
| 4254 WebFrame* frame, | 4257 WebFrame* frame, |
| 4255 WebStorageQuotaType type, | 4258 WebStorageQuotaType type, |
| 4256 WebStorageQuotaCallbacks* callbacks) { | 4259 WebStorageQuotaCallbacks* callbacks) { |
| 4257 DCHECK(frame); | 4260 DCHECK(frame); |
| 4258 WebSecurityOrigin origin = frame->document().securityOrigin(); | 4261 WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 4259 if (origin.isUnique()) { | 4262 if (origin.isUnique()) { |
| 4260 // Unique origins cannot store persistent state. | 4263 // Unique origins cannot store persistent state. |
| (...skipping 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6530 WebURL url = icon_urls[i].iconURL(); | 6533 WebURL url = icon_urls[i].iconURL(); |
| 6531 if (!url.isEmpty()) | 6534 if (!url.isEmpty()) |
| 6532 urls.push_back(FaviconURL(url, | 6535 urls.push_back(FaviconURL(url, |
| 6533 ToFaviconType(icon_urls[i].iconType()))); | 6536 ToFaviconType(icon_urls[i].iconType()))); |
| 6534 } | 6537 } |
| 6535 SendUpdateFaviconURL(urls); | 6538 SendUpdateFaviconURL(urls); |
| 6536 } | 6539 } |
| 6537 | 6540 |
| 6538 | 6541 |
| 6539 } // namespace content | 6542 } // namespace content |
| OLD | NEW |