| OLD | NEW |
| 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 "content/common/fileapi/webblobregistry_impl.h" | 5 #include "content/common/fileapi/webblobregistry_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "content/common/child_thread.h" | 9 #include "content/common/child_thread.h" |
| 10 #include "content/common/fileapi/webblob_messages.h" | 10 #include "content/common/fileapi/webblob_messages.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 break; | 77 break; |
| 78 case WebBlobData::Item::TypeBlob: | 78 case WebBlobData::Item::TypeBlob: |
| 79 if (data_item.length) { | 79 if (data_item.length) { |
| 80 item.SetToBlobUrlRange( | 80 item.SetToBlobUrlRange( |
| 81 data_item.blobURL, | 81 data_item.blobURL, |
| 82 static_cast<uint64>(data_item.offset), | 82 static_cast<uint64>(data_item.offset), |
| 83 static_cast<uint64>(data_item.length)); | 83 static_cast<uint64>(data_item.length)); |
| 84 child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); | 84 child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); |
| 85 } | 85 } |
| 86 break; | 86 break; |
| 87 case WebBlobData::Item::TypeURL: |
| 88 if (data_item.length) { |
| 89 // We only support filesystem URL as of now. |
| 90 DCHECK(GURL(data_item.url).SchemeIsFileSystem()); |
| 91 item.SetToFileSystemUrlRange( |
| 92 data_item.url, |
| 93 static_cast<uint64>(data_item.offset), |
| 94 static_cast<uint64>(data_item.length), |
| 95 base::Time::FromDoubleT(data_item.expectedModificationTime)); |
| 96 child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); |
| 97 } |
| 98 break; |
| 87 default: | 99 default: |
| 88 NOTREACHED(); | 100 NOTREACHED(); |
| 89 } | 101 } |
| 90 } | 102 } |
| 91 child_thread_->Send(new BlobHostMsg_FinishBuildingBlob( | 103 child_thread_->Send(new BlobHostMsg_FinishBuildingBlob( |
| 92 url, data.contentType().utf8().data())); | 104 url, data.contentType().utf8().data())); |
| 93 } | 105 } |
| 94 | 106 |
| 95 void WebBlobRegistryImpl::registerBlobURL( | 107 void WebBlobRegistryImpl::registerBlobURL( |
| 96 const WebURL& url, const WebURL& src_url) { | 108 const WebURL& url, const WebURL& src_url) { |
| 97 child_thread_->Send(new BlobHostMsg_CloneBlob(url, src_url)); | 109 child_thread_->Send(new BlobHostMsg_CloneBlob(url, src_url)); |
| 98 } | 110 } |
| 99 | 111 |
| 100 void WebBlobRegistryImpl::unregisterBlobURL(const WebURL& url) { | 112 void WebBlobRegistryImpl::unregisterBlobURL(const WebURL& url) { |
| 101 child_thread_->Send(new BlobHostMsg_RemoveBlob(url)); | 113 child_thread_->Send(new BlobHostMsg_RemoveBlob(url)); |
| 102 } | 114 } |
| OLD | NEW |