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

Side by Side Diff: content/child/shared_memory_data_consumer_handle.cc

Issue 2540023003: Dispatch encoded_data_length separately in content/child (Closed)
Patch Set: fix Created 4 years 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/child/shared_memory_data_consumer_handle.h" 5 #include "content/child/shared_memory_data_consumer_handle.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 19 matching lines...) Expand all
30 task_runner_(base::ThreadTaskRunnerHandle::Get()) {} 30 task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
31 ~DelegateThreadSafeReceivedData() override { 31 ~DelegateThreadSafeReceivedData() override {
32 if (!task_runner_->BelongsToCurrentThread()) { 32 if (!task_runner_->BelongsToCurrentThread()) {
33 // Delete the data on the original thread. 33 // Delete the data on the original thread.
34 task_runner_->DeleteSoon(FROM_HERE, data_.release()); 34 task_runner_->DeleteSoon(FROM_HERE, data_.release());
35 } 35 }
36 } 36 }
37 37
38 const char* payload() const override { return data_->payload(); } 38 const char* payload() const override { return data_->payload(); }
39 int length() const override { return data_->length(); } 39 int length() const override { return data_->length(); }
40 int encoded_data_length() const override {
41 return data_->encoded_data_length();
42 }
43 40
44 private: 41 private:
45 std::unique_ptr<RequestPeer::ReceivedData> data_; 42 std::unique_ptr<RequestPeer::ReceivedData> data_;
46 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
47 44
48 DISALLOW_COPY_AND_ASSIGN(DelegateThreadSafeReceivedData); 45 DISALLOW_COPY_AND_ASSIGN(DelegateThreadSafeReceivedData);
49 }; 46 };
50 47
51 } // namespace 48 } // namespace
52 49
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 std::unique_ptr<blink::WebDataConsumerHandle::Reader> 451 std::unique_ptr<blink::WebDataConsumerHandle::Reader>
455 SharedMemoryDataConsumerHandle::obtainReader(Client* client) { 452 SharedMemoryDataConsumerHandle::obtainReader(Client* client) {
456 return base::WrapUnique(new ReaderImpl(context_, client)); 453 return base::WrapUnique(new ReaderImpl(context_, client));
457 } 454 }
458 455
459 const char* SharedMemoryDataConsumerHandle::debugName() const { 456 const char* SharedMemoryDataConsumerHandle::debugName() const {
460 return "SharedMemoryDataConsumerHandle"; 457 return "SharedMemoryDataConsumerHandle";
461 } 458 }
462 459
463 } // namespace content 460 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698