| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/blob/blob_data_handle.h" | 5 #include "storage/browser/blob/blob_data_handle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| 11 #include "webkit/browser/blob/blob_storage_context.h" | 11 #include "storage/browser/blob/blob_storage_context.h" |
| 12 #include "webkit/common/blob/blob_data.h" | 12 #include "storage/common/blob/blob_data.h" |
| 13 | 13 |
| 14 namespace webkit_blob { | 14 namespace storage { |
| 15 | 15 |
| 16 BlobDataHandle::BlobDataHandleShared::BlobDataHandleShared( | 16 BlobDataHandle::BlobDataHandleShared::BlobDataHandleShared( |
| 17 BlobData* blob_data, | 17 BlobData* blob_data, |
| 18 BlobStorageContext* context, | 18 BlobStorageContext* context, |
| 19 base::SequencedTaskRunner* task_runner) | 19 base::SequencedTaskRunner* task_runner) |
| 20 : blob_data_(blob_data), | 20 : blob_data_(blob_data), context_(context->AsWeakPtr()) { |
| 21 context_(context->AsWeakPtr()) { | |
| 22 context_->IncrementBlobRefCount(blob_data->uuid()); | 21 context_->IncrementBlobRefCount(blob_data->uuid()); |
| 23 } | 22 } |
| 24 | 23 |
| 25 BlobData* BlobDataHandle::BlobDataHandleShared::data() const { | 24 BlobData* BlobDataHandle::BlobDataHandleShared::data() const { |
| 26 return blob_data_; | 25 return blob_data_; |
| 27 } | 26 } |
| 28 | 27 |
| 29 const std::string& BlobDataHandle::BlobDataHandleShared::uuid() const { | 28 const std::string& BlobDataHandle::BlobDataHandleShared::uuid() const { |
| 30 return blob_data_->uuid(); | 29 return blob_data_->uuid(); |
| 31 } | 30 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 58 | 57 |
| 59 BlobData* BlobDataHandle::data() const { | 58 BlobData* BlobDataHandle::data() const { |
| 60 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); | 59 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); |
| 61 return shared_->data(); | 60 return shared_->data(); |
| 62 } | 61 } |
| 63 | 62 |
| 64 std::string BlobDataHandle::uuid() const { | 63 std::string BlobDataHandle::uuid() const { |
| 65 return shared_->uuid(); | 64 return shared_->uuid(); |
| 66 } | 65 } |
| 67 | 66 |
| 68 } // namespace webkit_blob | 67 } // namespace storage |
| OLD | NEW |