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

Side by Side Diff: content/child/url_loader_client_impl.h

Issue 2823803002: Avoid IPC message creation between URLLoaderClientImpl and ResourceDispatcher (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | content/child/url_loader_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 5 #ifndef CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
6 #define CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 6 #define CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void OnUploadProgress(int64_t current_position, 58 void OnUploadProgress(int64_t current_position,
59 int64_t total_size, 59 int64_t total_size,
60 const base::Closure& ack_callback) override; 60 const base::Closure& ack_callback) override;
61 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override; 61 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override;
62 void OnTransferSizeUpdated(int32_t transfer_size_diff) override; 62 void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
63 void OnStartLoadingResponseBody( 63 void OnStartLoadingResponseBody(
64 mojo::ScopedDataPipeConsumerHandle body) override; 64 mojo::ScopedDataPipeConsumerHandle body) override;
65 void OnComplete(const ResourceRequestCompletionStatus& status) override; 65 void OnComplete(const ResourceRequestCompletionStatus& status) override;
66 66
67 private: 67 private:
68 void Dispatch(const IPC::Message& message); 68 bool NeedsStoringMessage() const;
69 void StoreAndDispatch(const IPC::Message& message);
69 70
70 mojo::Binding<mojom::URLLoaderClient> binding_; 71 mojo::Binding<mojom::URLLoaderClient> binding_;
71 scoped_refptr<URLResponseBodyConsumer> body_consumer_; 72 scoped_refptr<URLResponseBodyConsumer> body_consumer_;
72 mojom::DownloadedTempFilePtr downloaded_file_; 73 mojom::DownloadedTempFilePtr downloaded_file_;
73 std::vector<IPC::Message> deferred_messages_; 74 std::vector<IPC::Message> deferred_messages_;
74 const int request_id_; 75 const int request_id_;
75 bool has_received_response_ = false; 76 bool has_received_response_ = false;
76 bool is_deferred_ = false; 77 bool is_deferred_ = false;
77 int32_t accumulated_transfer_size_diff_during_deferred_ = 0; 78 int32_t accumulated_transfer_size_diff_during_deferred_ = 0;
78 ResourceDispatcher* const resource_dispatcher_; 79 ResourceDispatcher* const resource_dispatcher_;
79 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 80 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
80 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_; 81 base::WeakPtrFactory<URLLoaderClientImpl> weak_factory_;
81 }; 82 };
82 83
83 } // namespace content 84 } // namespace content
84 85
85 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_ 86 #endif // CONTENT_CHILD_URL_LOADER_CLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/url_loader_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698