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

Side by Side Diff: webkit/browser/fileapi/sandbox_mount_point_provider.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h" 5 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 enable_usage_tracking_( 164 enable_usage_tracking_(
165 !CommandLine::ForCurrentProcess()->HasSwitch( 165 !CommandLine::ForCurrentProcess()->HasSwitch(
166 kDisableUsageTracking)), 166 kDisableUsageTracking)),
167 special_storage_policy_(special_storage_policy), 167 special_storage_policy_(special_storage_policy),
168 weak_factory_(this) { 168 weak_factory_(this) {
169 // Set quota observers. 169 // Set quota observers.
170 UpdateObserverList::Source update_observers_src; 170 UpdateObserverList::Source update_observers_src;
171 AccessObserverList::Source access_observers_src; 171 AccessObserverList::Source access_observers_src;
172 172
173 if (enable_usage_tracking_) { 173 if (enable_usage_tracking_) {
174 update_observers_src.AddObserver(quota_observer_.get(), file_task_runner_); 174 update_observers_src.AddObserver(quota_observer_.get(),
175 file_task_runner_.get());
175 access_observers_src.AddObserver(quota_observer_.get(), NULL); 176 access_observers_src.AddObserver(quota_observer_.get(), NULL);
176 } 177 }
177 178
178 update_observers_ = UpdateObserverList(update_observers_src); 179 update_observers_ = UpdateObserverList(update_observers_src);
179 access_observers_ = AccessObserverList(access_observers_src); 180 access_observers_ = AccessObserverList(access_observers_src);
180 syncable_update_observers_ = UpdateObserverList(update_observers_src); 181 syncable_update_observers_ = UpdateObserverList(update_observers_src);
181 } 182 }
182 183
183 SandboxMountPointProvider::~SandboxMountPointProvider() { 184 SandboxMountPointProvider::~SandboxMountPointProvider() {
184 if (!file_task_runner_->RunsTasksOnCurrentThread()) { 185 if (!file_task_runner_->RunsTasksOnCurrentThread()) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 operation_context->set_change_observers(syncable_change_observers_); 311 operation_context->set_change_observers(syncable_change_observers_);
311 operation_context->set_access_observers(access_observers_); 312 operation_context->set_access_observers(access_observers_);
312 return new sync_file_system::SyncableFileSystemOperation( 313 return new sync_file_system::SyncableFileSystemOperation(
313 context, operation_context.Pass()); 314 context, operation_context.Pass());
314 } 315 }
315 316
316 // For regular sandboxed types. 317 // For regular sandboxed types.
317 operation_context->set_update_observers(update_observers_); 318 operation_context->set_update_observers(update_observers_);
318 operation_context->set_access_observers(access_observers_); 319 operation_context->set_access_observers(access_observers_);
319 320
320 if (special_storage_policy_ && 321 if (special_storage_policy_.get() &&
321 special_storage_policy_->IsStorageUnlimited(url.origin())) { 322 special_storage_policy_->IsStorageUnlimited(url.origin())) {
322 operation_context->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited); 323 operation_context->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited);
323 } else { 324 } else {
324 operation_context->set_quota_limit_type(quota::kQuotaLimitTypeLimited); 325 operation_context->set_quota_limit_type(quota::kQuotaLimitTypeLimited);
325 } 326 }
326 327
327 return new LocalFileSystemOperation(context, operation_context.Pass()); 328 return new LocalFileSystemOperation(context, operation_context.Pass());
328 } 329 }
329 330
330 scoped_ptr<webkit_blob::FileStreamReader> 331 scoped_ptr<webkit_blob::FileStreamReader>
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 666
666 while (!(file_path_each = enumerator->Next()).empty()) { 667 while (!(file_path_each = enumerator->Next()).empty()) {
667 usage += enumerator->Size(); 668 usage += enumerator->Size();
668 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); 669 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each);
669 } 670 }
670 671
671 return usage; 672 return usage;
672 } 673 }
673 674
674 } // namespace fileapi 675 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/sandbox_file_system_test_helper.cc ('k') | webkit/browser/fileapi/sandbox_quota_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698