OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/blob/blob_storage_controller.h" | 5 #include "webkit/blob/blob_storage_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "net/base/upload_data.h" | 9 #include "net/base/upload_data.h" |
10 #include "webkit/blob/blob_data.h" | 10 #include "webkit/blob/blob_data.h" |
11 | 11 |
12 namespace webkit_blob { | 12 namespace webkit_blob { |
13 | 13 |
14 BlobStorageController::BlobStorageController() { | 14 BlobStorageController::BlobStorageController() { |
15 } | 15 } |
16 | 16 |
17 BlobStorageController::~BlobStorageController() { | 17 BlobStorageController::~BlobStorageController() { |
18 } | 18 } |
19 | 19 |
20 void BlobStorageController::RegisterBlobUrl( | 20 void BlobStorageController::RegisterBlobUrl( |
21 const GURL& url, const BlobData* blob_data) { | 21 const GURL& url, const BlobData* blob_data) { |
22 scoped_refptr<BlobData> target_blob_data = new BlobData(); | 22 scoped_refptr<BlobData> target_blob_data(new BlobData()); |
23 target_blob_data->set_content_type(blob_data->content_type()); | 23 target_blob_data->set_content_type(blob_data->content_type()); |
24 target_blob_data->set_content_disposition(blob_data->content_disposition()); | 24 target_blob_data->set_content_disposition(blob_data->content_disposition()); |
25 | 25 |
26 // The blob data is stored in the "canonical" way. That is, it only contains a | 26 // The blob data is stored in the "canonical" way. That is, it only contains a |
27 // list of Data and File items. | 27 // list of Data and File items. |
28 // 1) The Data item is denoted by the raw data and the range. | 28 // 1) The Data item is denoted by the raw data and the range. |
29 // 2) The File item is denoted by the file path, the range and the expected | 29 // 2) The File item is denoted by the file path, the range and the expected |
30 // modification time. | 30 // modification time. |
31 // All the Blob items in the passing blob data are resolved and expanded into | 31 // All the Blob items in the passing blob data are resolved and expanded into |
32 // a set of Data and File items. | 32 // a set of Data and File items. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 expected_modification_time); | 189 expected_modification_time); |
190 | 190 |
191 // It may be a temporary file that should be deleted when no longer needed. | 191 // It may be a temporary file that should be deleted when no longer needed. |
192 scoped_refptr<DeletableFileReference> deletable_file = | 192 scoped_refptr<DeletableFileReference> deletable_file = |
193 DeletableFileReference::Get(file_path); | 193 DeletableFileReference::Get(file_path); |
194 if (deletable_file) | 194 if (deletable_file) |
195 target_blob_data->AttachDeletableFileReference(deletable_file); | 195 target_blob_data->AttachDeletableFileReference(deletable_file); |
196 } | 196 } |
197 | 197 |
198 } // namespace webkit_blob | 198 } // namespace webkit_blob |
OLD | NEW |