OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/blob_storage/blob_dispatcher_host.h" | 5 #include "content/browser/blob_storage/blob_dispatcher_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 scoped_refptr<storage::FileSystemContext> file_system_context) | 63 scoped_refptr<storage::FileSystemContext> file_system_context) |
64 : BrowserMessageFilter(BlobMsgStart), | 64 : BrowserMessageFilter(BlobMsgStart), |
65 process_id_(process_id), | 65 process_id_(process_id), |
66 file_system_context_(std::move(file_system_context)), | 66 file_system_context_(std::move(file_system_context)), |
67 blob_storage_context_(std::move(blob_storage_context)) {} | 67 blob_storage_context_(std::move(blob_storage_context)) {} |
68 | 68 |
69 BlobDispatcherHost::~BlobDispatcherHost() { | 69 BlobDispatcherHost::~BlobDispatcherHost() { |
70 ClearHostFromBlobStorageContext(); | 70 ClearHostFromBlobStorageContext(); |
71 } | 71 } |
72 | 72 |
| 73 void BlobDispatcherHost::AckBlobRecievedFromIDB(const std::string& uuid) { |
| 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 75 OnDecrementBlobRefCount(uuid); |
| 76 } |
| 77 |
73 void BlobDispatcherHost::OnChannelClosing() { | 78 void BlobDispatcherHost::OnChannelClosing() { |
74 ClearHostFromBlobStorageContext(); | 79 ClearHostFromBlobStorageContext(); |
75 public_blob_urls_.clear(); | 80 public_blob_urls_.clear(); |
76 blobs_inuse_map_.clear(); | 81 blobs_inuse_map_.clear(); |
77 } | 82 } |
78 | 83 |
79 bool BlobDispatcherHost::OnMessageReceived(const IPC::Message& message) { | 84 bool BlobDispatcherHost::OnMessageReceived(const IPC::Message& message) { |
80 bool handled = true; | 85 bool handled = true; |
81 // Note: The only time a renderer sends a blob status message is to cancel. | 86 // Note: The only time a renderer sends a blob status message is to cancel. |
82 IPC_BEGIN_MESSAGE_MAP(BlobDispatcherHost, message) | 87 IPC_BEGIN_MESSAGE_MAP(BlobDispatcherHost, message) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 BlobStorageContext* context = this->context(); | 371 BlobStorageContext* context = this->context(); |
367 for (const auto& url : public_blob_urls_) { | 372 for (const auto& url : public_blob_urls_) { |
368 context->RevokePublicBlobURL(url); | 373 context->RevokePublicBlobURL(url); |
369 } | 374 } |
370 // Keep the blobs alive for the BlobTransportHost call. | 375 // Keep the blobs alive for the BlobTransportHost call. |
371 transport_host_.CancelAll(context); | 376 transport_host_.CancelAll(context); |
372 blobs_inuse_map_.clear(); | 377 blobs_inuse_map_.clear(); |
373 } | 378 } |
374 | 379 |
375 } // namespace content | 380 } // namespace content |
OLD | NEW |