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

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

Issue 705003002: Change the return type of WTF::bind() to |OwnPtr<Function>| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reflect comments from yhirano Created 6 years, 1 month 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
« no previous file with comments | « Source/modules/filesystem/LocalFileSystem.h ('k') | Source/platform/PermissionCallbacks.h » ('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) 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 WebFileSystem* LocalFileSystem::fileSystem() const 117 WebFileSystem* LocalFileSystem::fileSystem() const
118 { 118 {
119 Platform* platform = Platform::current(); 119 Platform* platform = Platform::current();
120 if (!platform) 120 if (!platform)
121 return nullptr; 121 return nullptr;
122 return Platform::current()->fileSystem(); 122 return Platform::current()->fileSystem();
123 } 123 }
124 124
125 void LocalFileSystem::requestFileSystemAccessInternal(ExecutionContext* context, const Closure& allowed, const Closure& denied) 125 void LocalFileSystem::requestFileSystemAccessInternal(ExecutionContext* context, PassOwnPtr<Closure> allowed, PassOwnPtr<Closure> denied)
126 { 126 {
127 if (!client()) { 127 if (!client()) {
128 denied(); 128 (*denied)();
129 return; 129 return;
130 } 130 }
131 if (!context->isDocument()) { 131 if (!context->isDocument()) {
132 if (!client()->requestFileSystemAccessSync(context)) { 132 if (!client()->requestFileSystemAccessSync(context)) {
133 denied(); 133 (*denied)();
134 return; 134 return;
135 } 135 }
136 allowed(); 136 (*allowed)();
137 return; 137 return;
138 } 138 }
139 client()->requestFileSystemAccessAsync(context, PermissionCallbacks::create( allowed, denied)); 139 client()->requestFileSystemAccessAsync(context, PermissionCallbacks::create( allowed, denied));
140 } 140 }
141 141
142 void LocalFileSystem::fileSystemNotAvailable( 142 void LocalFileSystem::fileSystemNotAvailable(
143 PassRefPtrWillBeRawPtr<ExecutionContext> context, 143 PassRefPtrWillBeRawPtr<ExecutionContext> context,
144 CallbackWrapper* callbacks) 144 CallbackWrapper* callbacks)
145 { 145 {
146 context->postTask(createCrossThreadTask(&reportFailure, callbacks->release() , FileError::ABORT_ERR)); 146 context->postTask(createCrossThreadTask(&reportFailure, callbacks->release() , FileError::ABORT_ERR));
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 { 215 {
216 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem:: create(client)); 216 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem:: create(client));
217 } 217 }
218 218
219 void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSyste mClient> client) 219 void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSyste mClient> client)
220 { 220 {
221 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste m::create(client)); 221 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste m::create(client));
222 } 222 }
223 223
224 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/filesystem/LocalFileSystem.h ('k') | Source/platform/PermissionCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698