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

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

Issue 2049003002: Wrap GCed raw pointer parameters of WTF::bind with Persistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert "unretained" part and "disallow pointers" part Created 4 years, 6 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 LocalFileSystem::~LocalFileSystem() 80 LocalFileSystem::~LocalFileSystem()
81 { 81 {
82 } 82 }
83 83
84 void LocalFileSystem::resolveURL(ExecutionContext* context, const KURL& fileSyst emURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 84 void LocalFileSystem::resolveURL(ExecutionContext* context, const KURL& fileSyst emURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
85 { 85 {
86 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); 86 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks));
87 requestFileSystemAccessInternal(context, 87 requestFileSystemAccessInternal(context,
88 bind(&LocalFileSystem::resolveURLInternal, this, context, fileSystemURL, wrapper), 88 bind(&LocalFileSystem::resolveURLInternal, wrapCrossThreadPersistent(thi s), wrapCrossThreadPersistent(context), fileSystemURL, wrapCrossThreadPersistent (wrapper)),
89 bind(&LocalFileSystem::fileSystemNotAllowedInternal, this, context, wrap per)); 89 bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapCrossThreadPers istent(this), wrapCrossThreadPersistent(context), wrapCrossThreadPersistent(wrap per)));
90 } 90 }
91 91
92 void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemTyp e type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 92 void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemTyp e type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
93 { 93 {
94 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); 94 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks));
95 requestFileSystemAccessInternal(context, 95 requestFileSystemAccessInternal(context,
96 bind(&LocalFileSystem::fileSystemAllowedInternal, this, context, type, w rapper), 96 bind(&LocalFileSystem::fileSystemAllowedInternal, wrapCrossThreadPersist ent(this), wrapCrossThreadPersistent(context), type, wrapCrossThreadPersistent(w rapper)),
97 bind(&LocalFileSystem::fileSystemNotAllowedInternal, this, context, wrap per)); 97 bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapCrossThreadPers istent(this), wrapCrossThreadPersistent(context), wrapCrossThreadPersistent(wrap per)));
98 } 98 }
99 99
100 void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 100 void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
101 { 101 {
102 ASSERT(context); 102 ASSERT(context);
103 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); 103 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument());
104 104
105 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); 105 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks));
106 requestFileSystemAccessInternal(context, 106 requestFileSystemAccessInternal(context,
107 bind(&LocalFileSystem::deleteFileSystemInternal, this, context, type, wr apper), 107 bind(&LocalFileSystem::deleteFileSystemInternal, wrapCrossThreadPersiste nt(this), wrapCrossThreadPersistent(context), type, wrapCrossThreadPersistent(wr apper)),
108 bind(&LocalFileSystem::fileSystemNotAllowedInternal, this, context, wrap per)); 108 bind(&LocalFileSystem::fileSystemNotAllowedInternal, wrapCrossThreadPers istent(this), wrapCrossThreadPersistent(context), wrapCrossThreadPersistent(wrap per)));
109 } 109 }
110 110
111 WebFileSystem* LocalFileSystem::getFileSystem() const 111 WebFileSystem* LocalFileSystem::getFileSystem() const
112 { 112 {
113 Platform* platform = Platform::current(); 113 Platform* platform = Platform::current();
114 if (!platform) 114 if (!platform)
115 return nullptr; 115 return nullptr;
116 116
117 return platform->fileSystem(); 117 return platform->fileSystem();
118 } 118 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 { 213 {
214 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem:: create(std::move(client))); 214 frame.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem:: create(std::move(client)));
215 } 215 }
216 216
217 void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSyste mClient> client) 217 void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSyste mClient> client)
218 { 218 {
219 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste m::create(std::move(client))); 219 clients->provideSupplement(LocalFileSystem::supplementName(), LocalFileSyste m::create(std::move(client)));
220 } 220 }
221 221
222 } // namespace blink 222 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698