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

Side by Side Diff: components/web_view/url_request_cloneable.h

Issue 1333173004: mandoline: Add back/forward support and UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 5 years, 3 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 2015 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 COMPONENTS_WEB_VIEW_URL_REQUEST_CLONEABLE_H_
6 #define COMPONENTS_WEB_VIEW_URL_REQUEST_CLONEABLE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "mojo/services/network/public/interfaces/url_loader.mojom.h"
13
14 namespace web_view {
15
16 // This class caches data associated with a mojo::URLRequest and vends copies
17 // of the request for the WebView system. Copies are used for repeated
18 // navigations, but URLRequest structs are not copyable, as they contain
19 // handles to transfer large amounts of data between processes, so we
20 // immediately read the data from pipes and keep a copy here.
21 class URLRequestCloneable {
22 public:
23 explicit URLRequestCloneable(mojo::URLRequestPtr original_request);
24 ~URLRequestCloneable();
25
26 // Creates a new URLRequest.
27 mojo::URLRequestPtr Clone() const;
28
29 private:
30 // All of these are straight from mojo::URLRequest.
31 mojo::String url_;
32 mojo::String method_;
33 mojo::Array<mojo::HttpHeaderPtr> headers_;
34 uint32_t response_body_buffer_size_;
35 bool auto_follow_redirects_;
36 bool bypass_cache_;
37
38 // Whether the body mojo array in the |original_request| was null. We keep
39 // track of this so we can differentiate between null arrays and empty
40 // arrays.
41 bool original_body_null_;
42
43 // This is a serialized version of the data from mojo::URLRequest. We copy
44 // this data straight out of the data pipes, and then serve it any time that
45 // AsURLRequest() is called.
46 std::vector<std::string> body_;
47
48 DISALLOW_COPY_AND_ASSIGN(URLRequestCloneable);
49 };
50
51 } // namespace web_view
52
53 #endif // COMPONENTS_WEB_VIEW_URL_REQUEST_CLONEABLE_H_
OLDNEW
« no previous file with comments | « components/web_view/test_runner/test_runner_application_delegate.cc ('k') | components/web_view/url_request_cloneable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698