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

Side by Side Diff: blimp/engine/renderer/blob_channel_sender_proxy.h

Issue 1985863002: Incorporate BlobChannel into Blimp image encode/decode pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blobchannel-helium
Patch Set: fix gn dependency warning & rebase Created 4 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_ENGINE_RENDERER_BLOB_CHANNEL_SENDER_PROXY_H_
6 #define BLIMP_ENGINE_RENDERER_BLOB_CHANNEL_SENDER_PROXY_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/containers/hash_tables.h"
12 #include "blimp/common/blimp_common_export.h"
13 #include "blimp/engine/mojo/blob_channel.mojom.h"
14 #include "blimp/net/blob_channel/blob_channel_sender.h"
15
16 namespace blimp {
17 namespace engine {
18
19 // Class for sending blobs (e.g. images) from the renderer to the browser
20 // process.
21 class BLIMP_COMMON_EXPORT BlobChannelSenderProxy : public BlobChannelSender {
22 public:
23 BlobChannelSenderProxy();
24 ~BlobChannelSenderProxy() override;
25
26 // Returns true if the blob is known to exist within the Engine cache.
27 bool IsInEngineCache(const std::string& id) const;
28
29 // Returns true if the blob has been delivered to the Client cache.
30 bool IsInClientCache(const std::string& id) const;
31
32 // BlobChannelSender implementation.
33 void PutBlob(const BlobId& id, BlobDataPtr data) override;
34 void DeliverBlob(const BlobId& id) override;
35
36 private:
37 // BlobChannel Mojo IPC stub, used for delivering blobs to the browser
38 // process.
39 mojom::BlobChannelPtr blob_channel_;
40
41 // Local copy of the cache state for the local and remote BlobChannel.
42 // Knowledge of the cache state enables callers to avoid unnecessary
43 // image encoding and transferral if the content is already in the system.
44 base::hash_map<std::string, bool> replication_state_;
45
46 DISALLOW_COPY_AND_ASSIGN(BlobChannelSenderProxy);
47 };
48
49 } // namespace engine
50 } // namespace blimp
51
52 #endif // BLIMP_ENGINE_RENDERER_BLOB_CHANNEL_SENDER_PROXY_H_
OLDNEW
« no previous file with comments | « blimp/engine/renderer/blimp_content_renderer_client.cc ('k') | blimp/engine/renderer/blob_channel_sender_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698