| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 PassOwnPtr<FileSystemClient> LocalFileSystemClient::create() | 48 PassOwnPtr<FileSystemClient> LocalFileSystemClient::create() |
| 49 { | 49 { |
| 50 return adoptPtr(static_cast<FileSystemClient*>(new LocalFileSystemClient()))
; | 50 return adoptPtr(static_cast<FileSystemClient*>(new LocalFileSystemClient()))
; |
| 51 } | 51 } |
| 52 | 52 |
| 53 LocalFileSystemClient::~LocalFileSystemClient() | 53 LocalFileSystemClient::~LocalFileSystemClient() |
| 54 { | 54 { |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool LocalFileSystemClient::allowFileSystem(ExecutionContext* context) | |
| 58 { | |
| 59 ASSERT(context); | |
| 60 if (context->isDocument()) { | |
| 61 Document* document = toDocument(context); | |
| 62 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->fra
me()); | |
| 63 return !webFrame->permissionClient() || webFrame->permissionClient()->al
lowFileSystem(); | |
| 64 } | |
| 65 ASSERT(context->isWorkerGlobalScope()); | |
| 66 return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->allowFil
eSystem(); | |
| 67 } | |
| 68 | |
| 69 bool LocalFileSystemClient::requestFileSystemAccessSync(ExecutionContext* contex
t) | 57 bool LocalFileSystemClient::requestFileSystemAccessSync(ExecutionContext* contex
t) |
| 70 { | 58 { |
| 71 ASSERT(context); | 59 ASSERT(context); |
| 72 if (context->isDocument()) { | 60 if (context->isDocument()) { |
| 73 ASSERT_NOT_REACHED(); | 61 ASSERT_NOT_REACHED(); |
| 74 return false; | 62 return false; |
| 75 } | 63 } |
| 76 | 64 |
| 77 ASSERT(context->isWorkerGlobalScope()); | 65 ASSERT(context->isWorkerGlobalScope()); |
| 78 return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->requestF
ileSystemAccessSync(); | 66 return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->requestF
ileSystemAccessSync(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 93 return; | 81 return; |
| 94 } | 82 } |
| 95 webFrame->permissionClient()->requestFileSystemAccessAsync(callbacks); | 83 webFrame->permissionClient()->requestFileSystemAccessAsync(callbacks); |
| 96 } | 84 } |
| 97 | 85 |
| 98 LocalFileSystemClient::LocalFileSystemClient() | 86 LocalFileSystemClient::LocalFileSystemClient() |
| 99 { | 87 { |
| 100 } | 88 } |
| 101 | 89 |
| 102 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |