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

Unified Diff: mojo/services/network/url_loader_impl.h

Issue 858093002: Update the network service from the Mojo repo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/network/udp_socket_apptest.cc ('k') | mojo/services/network/url_loader_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/url_loader_impl.h
diff --git a/mojo/services/network/url_loader_impl.h b/mojo/services/network/url_loader_impl.h
index 54d7f2af302b64835eacf226ecb074ae09cbdafd..40d087dffbf8e29deb6dbb4c43537db8d4860657 100644
--- a/mojo/services/network/url_loader_impl.h
+++ b/mojo/services/network/url_loader_impl.h
@@ -8,6 +8,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "mojo/common/handle_watcher.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/error_handler.h"
#include "mojo/public/cpp/bindings/interface_impl.h"
#include "mojo/services/network/public/interfaces/url_loader.mojom.h"
#include "net/base/net_errors.h"
@@ -18,11 +20,12 @@ namespace mojo {
class NetworkContext;
class NetToMojoPendingBuffer;
-class URLLoaderImpl : public InterfaceImpl<URLLoader>,
+class URLLoaderImpl : public URLLoader,
+ public ErrorHandler,
public net::URLRequest::Delegate {
public:
- explicit URLLoaderImpl(NetworkContext* context);
- ~URLLoaderImpl() override;
+ URLLoaderImpl(NetworkContext* context, InterfaceRequest<URLLoader> request);
+ ~URLLoaderImpl();
private:
// URLLoader methods:
@@ -31,6 +34,9 @@ class URLLoaderImpl : public InterfaceImpl<URLLoader>,
void FollowRedirect(const Callback<void(URLResponsePtr)>& callback) override;
void QueryStatus(const Callback<void(URLLoaderStatusPtr)>& callback) override;
+ // ErrorHandler methods:
+ void OnConnectionError() override;
+
// net::URLRequest::Delegate methods:
void OnReceivedRedirect(net::URLRequest* url_request,
const net::RedirectInfo& redirect_info,
@@ -43,8 +49,11 @@ class URLLoaderImpl : public InterfaceImpl<URLLoader>,
const Callback<void(URLResponsePtr)>& callback);
void SendResponse(URLResponsePtr response);
void OnResponseBodyStreamReady(MojoResult result);
+ void OnResponseBodyStreamClosed(MojoResult result);
void ReadMore();
void DidRead(uint32_t num_bytes, bool completed_synchronously);
+ void ListenForPeerClosed();
+ void DeleteIfNeeded();
NetworkContext* context_;
scoped_ptr<net::URLRequest> url_request_;
@@ -54,6 +63,8 @@ class URLLoaderImpl : public InterfaceImpl<URLLoader>,
common::HandleWatcher handle_watcher_;
uint32 response_body_buffer_size_;
bool auto_follow_redirects_;
+ bool connected_;
+ Binding<URLLoader> binding_;
base::WeakPtrFactory<URLLoaderImpl> weak_ptr_factory_;
};
« no previous file with comments | « mojo/services/network/udp_socket_apptest.cc ('k') | mojo/services/network/url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698