Chromium Code Reviews| Index: components/web_view/navigation_entry.h |
| diff --git a/components/web_view/navigation_entry.h b/components/web_view/navigation_entry.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a1a6aa8283c7215f671fa023cad9ebae5f5440c5 |
| --- /dev/null |
| +++ b/components/web_view/navigation_entry.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_WEB_VIEW_NAVIGATION_ENTRY_H_ |
| +#define COMPONENTS_WEB_VIEW_NAVIGATION_ENTRY_H_ |
| + |
|
msw
2015/09/04 22:05:00
nit: include <vector> and <string>
|
| +#include "base/basictypes.h" |
| +#include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| + |
| +namespace web_view { |
| + |
| +// The WebView system takes incoming mojo::URLRequests and then needs to hand |
| +// them off to other processes. However, moving back and forward requires |
|
msw
2015/09/04 22:05:00
Do you mean "moving back and then forward" (ie. to
|
| +// resending the same url request multiple times. However, the URLRequest |
| +// struct uses handles to transfer large amounts of data between processes, |
| +// which makes it not copyable. This class takes the data, stores it, and then |
| +// vends new URLRequests on demand. |
| +class NavigationEntry { |
|
msw
2015/09/04 22:05:00
As we discussed, I'm surprised we don't have a mor
|
| + public: |
| + NavigationEntry(mojo::URLRequestPtr incoming_mojo_request); |
|
msw
2015/09/04 22:05:00
Explicit
msw
2015/09/04 22:05:00
optional nit: rename incoming_mojo_request to requ
|
| + ~NavigationEntry(); |
| + |
| + // Creates a new URLRequest. |
| + mojo::URLRequestPtr AsURLRequest(); |
|
msw
2015/09/04 22:05:00
Const function
msw
2015/09/04 22:05:00
nit: rename Clone or Copy?
|
| + |
| + private: |
| + // All of these are straight from mojo::URLRequest. |
| + mojo::String url_; |
| + mojo::String method_; |
| + mojo::Array<mojo::HttpHeaderPtr> headers_; |
| + uint32_t response_body_buffer_size_; |
| + bool auto_follow_redirects_; |
| + bool bypass_cache_; |
| + |
| + // This is a serialized version of the data from mojo::URLRequest. We copy |
| + // this data straight out of the data pipes, and then serve it any time that |
| + // AsURLRequest() is called. |
| + std::vector<std::string> body_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NavigationEntry); |
| +}; |
| + |
| +} // namespace web_view |
| + |
| +#endif // COMPONENTS_WEB_VIEW_NAVIGATION_ENTRY_H_ |