OLD | NEW |
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 #ifndef COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | 5 #ifndef COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ |
6 #define COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | 6 #define COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/time/time.h" |
11 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 12 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
13 | 14 |
14 namespace web_view { | 15 namespace web_view { |
15 | 16 |
16 class FrameConnection; | 17 class FrameConnection; |
17 class WebViewImpl; | 18 class WebViewImpl; |
18 | 19 |
19 // PendingWebViewLoad holds the state necessary to service a load of the main | 20 // PendingWebViewLoad holds the state necessary to service a load of the main |
20 // frame. Once the necessary state has been obtained the load is started. | 21 // frame. Once the necessary state has been obtained the load is started. |
21 class PendingWebViewLoad { | 22 class PendingWebViewLoad { |
22 public: | 23 public: |
23 explicit PendingWebViewLoad(WebViewImpl* web_view); | 24 explicit PendingWebViewLoad(WebViewImpl* web_view); |
24 ~PendingWebViewLoad(); | 25 ~PendingWebViewLoad(); |
25 | 26 |
26 void Init(mojo::URLRequestPtr request); | 27 void Init(mojo::URLRequestPtr request); |
27 | 28 |
28 scoped_ptr<FrameConnection> frame_connection() { | 29 scoped_ptr<FrameConnection> frame_connection() { |
29 return frame_connection_.Pass(); | 30 return frame_connection_.Pass(); |
30 } | 31 } |
31 | 32 |
32 bool is_content_handler_id_valid() const { | 33 bool is_content_handler_id_valid() const { |
33 return is_content_handler_id_valid_; | 34 return is_content_handler_id_valid_; |
34 } | 35 } |
35 | 36 |
36 const GURL& pending_url() const { return pending_url_; } | 37 const GURL& pending_url() const { return pending_url_; } |
37 | 38 |
| 39 base::TimeTicks navigation_start_time() const { |
| 40 return navigation_start_time_; |
| 41 } |
| 42 |
38 private: | 43 private: |
39 void OnGotContentHandlerID(); | 44 void OnGotContentHandlerID(); |
40 | 45 |
41 WebViewImpl* web_view_; | 46 WebViewImpl* web_view_; |
42 | 47 |
43 GURL pending_url_; | 48 GURL pending_url_; |
44 bool is_content_handler_id_valid_; | 49 bool is_content_handler_id_valid_; |
45 | 50 |
46 scoped_ptr<FrameConnection> frame_connection_; | 51 scoped_ptr<FrameConnection> frame_connection_; |
47 | 52 |
| 53 base::TimeTicks navigation_start_time_; |
| 54 |
48 DISALLOW_COPY_AND_ASSIGN(PendingWebViewLoad); | 55 DISALLOW_COPY_AND_ASSIGN(PendingWebViewLoad); |
49 }; | 56 }; |
50 | 57 |
51 } // namespace web_view | 58 } // namespace web_view |
52 | 59 |
53 #endif // COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | 60 #endif // COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ |
OLD | NEW |