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

Side by Side Diff: Source/modules/filesystem/LocalFileSystem.cpp

Issue 23537011: FileAPI: Add WebFileSystem::resolveURL (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 { 51 {
52 callbacks->didFail(FileError::ABORT_ERR); 52 callbacks->didFail(FileError::ABORT_ERR);
53 } 53 }
54 54
55 } // namespace 55 } // namespace
56 56
57 LocalFileSystemBase::~LocalFileSystemBase() 57 LocalFileSystemBase::~LocalFileSystemBase()
58 { 58 {
59 } 59 }
60 60
61 void LocalFileSystemBase::readFileSystem(ScriptExecutionContext* context, FileSy stemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 61 void LocalFileSystemBase::resolveURL(ScriptExecutionContext* context, KURL fileS ystemURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
62 { 62 {
63 if (!client() || !client()->allowFileSystem(context)) { 63 if (!client() || !client()->allowFileSystem(context)) {
64 context->postTask(createCallbackTask(&fileSystemNotAllowed, callbacks)); 64 context->postTask(createCallbackTask(&fileSystemNotAllowed, callbacks));
65 return; 65 return;
66 } 66 }
67 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); 67 WebKit::Platform::current()->fileSystem()->resolveURL(fileSystemURL, callbac ks);
68 WebKit::Platform::current()->fileSystem()->openFileSystem(storagePartition, static_cast<WebKit::WebFileSystemType>(type), false, callbacks);
69 } 68 }
70 69
71 void LocalFileSystemBase::requestFileSystem(ScriptExecutionContext* context, Fil eSystemType type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks ) 70 void LocalFileSystemBase::requestFileSystem(ScriptExecutionContext* context, Fil eSystemType type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks )
72 { 71 {
73 if (!client() || !client()->allowFileSystem(context)) { 72 if (!client() || !client()->allowFileSystem(context)) {
74 context->postTask(createCallbackTask(&fileSystemNotAllowed, callbacks)); 73 context->postTask(createCallbackTask(&fileSystemNotAllowed, callbacks));
75 return; 74 return;
76 } 75 }
77 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); 76 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString());
78 WebKit::Platform::current()->fileSystem()->openFileSystem(storagePartition, static_cast<WebKit::WebFileSystemType>(type), true, callbacks); 77 WebKit::Platform::current()->fileSystem()->openFileSystem(storagePartition, static_cast<WebKit::WebFileSystemType>(type), true, callbacks);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 { 118 {
120 return static_cast<LocalFileSystem*>(Supplement<Page>::from(toDocument(conte xt)->page(), supplementName())); 119 return static_cast<LocalFileSystem*>(Supplement<Page>::from(toDocument(conte xt)->page(), supplementName()));
121 } 120 }
122 121
123 void provideLocalFileSystemTo(Page* page, PassOwnPtr<FileSystemClient> client) 122 void provideLocalFileSystemTo(Page* page, PassOwnPtr<FileSystemClient> client)
124 { 123 {
125 LocalFileSystem::provideTo(page, LocalFileSystem::supplementName(), LocalFil eSystem::create(client)); 124 LocalFileSystem::provideTo(page, LocalFileSystem::supplementName(), LocalFil eSystem::create(client));
126 } 125 }
127 126
128 } // namespace WebCore 127 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698