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

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

Issue 212263002: remove use of {,un}setPendingActivity from DOMFileSystem. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 rootURL.append("/"); 81 rootURL.append("/");
82 rootURL.append(filesystemId); 82 rootURL.append(filesystemId);
83 rootURL.append("/"); 83 rootURL.append("/");
84 84
85 return DOMFileSystem::create(context, filesystemName.toString(), FileSystemT ypeIsolated, KURL(ParsedURLString, rootURL.toString())); 85 return DOMFileSystem::create(context, filesystemName.toString(), FileSystemT ypeIsolated, KURL(ParsedURLString, rootURL.toString()));
86 } 86 }
87 87
88 DOMFileSystem::DOMFileSystem(ExecutionContext* context, const String& name, File SystemType type, const KURL& rootURL) 88 DOMFileSystem::DOMFileSystem(ExecutionContext* context, const String& name, File SystemType type, const KURL& rootURL)
89 : DOMFileSystemBase(context, name, type, rootURL) 89 : DOMFileSystemBase(context, name, type, rootURL)
90 , ActiveDOMObject(context) 90 , ActiveDOMObject(context)
91 , m_numberOfPendingCallbacks(0)
91 { 92 {
92 ScriptWrappable::init(this); 93 ScriptWrappable::init(this);
93 } 94 }
94 95
95 PassRefPtrWillBeRawPtr<DirectoryEntry> DOMFileSystem::root() 96 PassRefPtrWillBeRawPtr<DirectoryEntry> DOMFileSystem::root()
96 { 97 {
97 return DirectoryEntry::create(this, DOMFilePath::root); 98 return DirectoryEntry::create(this, DOMFilePath::root);
98 } 99 }
99 100
100 void DOMFileSystem::addPendingCallbacks() 101 void DOMFileSystem::addPendingCallbacks()
101 { 102 {
102 setPendingActivity(this); 103 ++m_numberOfPendingCallbacks;
103 } 104 }
104 105
105 void DOMFileSystem::removePendingCallbacks() 106 void DOMFileSystem::removePendingCallbacks()
106 { 107 {
107 unsetPendingActivity(this); 108 ASSERT(m_numberOfPendingCallbacks > 0);
109 --m_numberOfPendingCallbacks;
110 }
111
112 bool DOMFileSystem::hasPendingActivity() const
113 {
114 ASSERT(m_numberOfPendingCallbacks >= 0);
115 return m_numberOfPendingCallbacks;
108 } 116 }
109 117
110 void DOMFileSystem::reportError(PassOwnPtr<ErrorCallback> errorCallback, PassRef PtrWillBeRawPtr<FileError> fileError) 118 void DOMFileSystem::reportError(PassOwnPtr<ErrorCallback> errorCallback, PassRef PtrWillBeRawPtr<FileError> fileError)
111 { 119 {
112 scheduleCallback(errorCallback, fileError); 120 scheduleCallback(errorCallback, fileError);
113 } 121 }
114 122
115 namespace { 123 namespace {
116 124
117 class ConvertToFileWriterCallback : public FileWriterBaseCallback { 125 class ConvertToFileWriterCallback : public FileWriterBaseCallback {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 205
198 } // namespace 206 } // namespace
199 207
200 void DOMFileSystem::createFile(const FileEntry* fileEntry, PassOwnPtr<FileCallba ck> successCallback, PassOwnPtr<ErrorCallback> errorCallback) 208 void DOMFileSystem::createFile(const FileEntry* fileEntry, PassOwnPtr<FileCallba ck> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
201 { 209 {
202 KURL fileSystemURL = createFileSystemURL(fileEntry); 210 KURL fileSystemURL = createFileSystemURL(fileEntry);
203 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa llback)); 211 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa llback));
204 } 212 }
205 213
206 } // namespace WebCore 214 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/filesystem/DOMFileSystem.h ('k') | Source/modules/filesystem/FileSystemCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698