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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp

Issue 1981823002: Remove OwnPtr::release() calls in platform/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 m_private.reset(); 91 m_private.reset();
92 } 92 }
93 93
94 void WebFileSystemCallbacks::didCreateSnapshotFile(const WebFileInfo& webFileInf o) 94 void WebFileSystemCallbacks::didCreateSnapshotFile(const WebFileInfo& webFileInf o)
95 { 95 {
96 ASSERT(!m_private.isNull()); 96 ASSERT(!m_private.isNull());
97 // It's important to create a BlobDataHandle that refers to the platform fil e path prior 97 // It's important to create a BlobDataHandle that refers to the platform fil e path prior
98 // to return from this method so the underlying file will not be deleted. 98 // to return from this method so the underlying file will not be deleted.
99 OwnPtr<BlobData> blobData = BlobData::create(); 99 OwnPtr<BlobData> blobData = BlobData::create();
100 blobData->appendFile(webFileInfo.platformPath, 0, webFileInfo.length, invali dFileTime()); 100 blobData->appendFile(webFileInfo.platformPath, 0, webFileInfo.length, invali dFileTime());
101 RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.releas e(), webFileInfo.length); 101 RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(std::move(blobD ata), webFileInfo.length);
102 102
103 FileMetadata fileMetadata; 103 FileMetadata fileMetadata;
104 fileMetadata.modificationTime = webFileInfo.modificationTime; 104 fileMetadata.modificationTime = webFileInfo.modificationTime;
105 fileMetadata.length = webFileInfo.length; 105 fileMetadata.length = webFileInfo.length;
106 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); 106 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type);
107 fileMetadata.platformPath = webFileInfo.platformPath; 107 fileMetadata.platformPath = webFileInfo.platformPath;
108 m_private->callbacks()->didCreateSnapshotFile(fileMetadata, snapshotBlob); 108 m_private->callbacks()->didCreateSnapshotFile(fileMetadata, snapshotBlob);
109 m_private.reset(); 109 m_private.reset();
110 } 110 }
111 111
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 m_private.reset(); 146 m_private.reset();
147 } 147 }
148 148
149 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const 149 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const
150 { 150 {
151 ASSERT(!m_private.isNull()); 151 ASSERT(!m_private.isNull());
152 return m_private->callbacks()->shouldBlockUntilCompletion(); 152 return m_private->callbacks()->shouldBlockUntilCompletion();
153 } 153 }
154 154
155 } // namespace blink 155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698