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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ExecutionContext* contextPtr(context); 86 ExecutionContext* contextPtr(context);
87 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); 87 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks));
88 requestFileSystemAccessInternal(context, 88 requestFileSystemAccessInternal(context,
89 bind(&LocalFileSystem::resolveURLInternal, this, contextPtr, fileSystemU RL, wrapper), 89 bind(&LocalFileSystem::resolveURLInternal, retainedRef(this), retainedRe f(contextPtr), fileSystemURL, retainedRef(wrapper)),
90 bind(&LocalFileSystem::fileSystemNotAllowedInternal, this, contextPtr, w rapper)); 90 bind(&LocalFileSystem::fileSystemNotAllowedInternal, retainedRef(this), retainedRef(contextPtr), retainedRef(wrapper)));
91 } 91 }
92 92
93 void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemTyp e type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 93 void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemTyp e type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
94 { 94 {
95 ExecutionContext* contextPtr(context); 95 ExecutionContext* contextPtr(context);
96 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); 96 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks));
97 requestFileSystemAccessInternal(context, 97 requestFileSystemAccessInternal(context,
98 bind(&LocalFileSystem::fileSystemAllowedInternal, this, contextPtr, type , wrapper), 98 bind(&LocalFileSystem::fileSystemAllowedInternal, retainedRef(this), ret ainedRef(contextPtr), type, retainedRef(wrapper)),
99 bind(&LocalFileSystem::fileSystemNotAllowedInternal, this, contextPtr, w rapper)); 99 bind(&LocalFileSystem::fileSystemNotAllowedInternal, retainedRef(this), retainedRef(contextPtr), retainedRef(wrapper)));
100 } 100 }
101 101
102 void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 102 void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
103 { 103 {
104 ExecutionContext* contextPtr(context); 104 ExecutionContext* contextPtr(context);
105 ASSERT(context); 105 ASSERT(context);
106 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); 106 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument());
107 107
108 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks)); 108 CallbackWrapper* wrapper = new CallbackWrapper(std::move(callbacks));
109 requestFileSystemAccessInternal(context, 109 requestFileSystemAccessInternal(context,
110 bind(&LocalFileSystem::deleteFileSystemInternal, this, contextPtr, type, wrapper), 110 bind(&LocalFileSystem::deleteFileSystemInternal, retainedRef(this), reta inedRef(contextPtr), type, retainedRef(wrapper)),
111 bind(&LocalFileSystem::fileSystemNotAllowedInternal, this, contextPtr, w rapper)); 111 bind(&LocalFileSystem::fileSystemNotAllowedInternal, retainedRef(this), retainedRef(contextPtr), retainedRef(wrapper)));
112 } 112 }
113 113
114 WebFileSystem* LocalFileSystem::fileSystem() const 114 WebFileSystem* LocalFileSystem::fileSystem() const
115 { 115 {
116 Platform* platform = Platform::current(); 116 Platform* platform = Platform::current();
117 if (!platform) 117 if (!platform)
118 return nullptr; 118 return nullptr;
119 return Platform::current()->fileSystem(); 119 return Platform::current()->fileSystem();
120 } 120 }
121 121
(...skipping 91 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