OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H
_ | 5 #ifndef ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H
_ |
6 #define ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H
_ | 6 #define ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H
_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 void RemovePendingThrottleOnIoThread(IoThreadClientThrottle* throttle); | 62 void RemovePendingThrottleOnIoThread(IoThreadClientThrottle* throttle); |
63 | 63 |
64 static void OnIoThreadClientReady(int new_render_process_id, | 64 static void OnIoThreadClientReady(int new_render_process_id, |
65 int new_render_frame_id); | 65 int new_render_frame_id); |
66 static void AddPendingThrottle(int render_process_id, | 66 static void AddPendingThrottle(int render_process_id, |
67 int render_frame_id, | 67 int render_frame_id, |
68 IoThreadClientThrottle* pending_throttle); | 68 IoThreadClientThrottle* pending_throttle); |
69 | 69 |
70 private: | 70 private: |
71 friend struct base::DefaultLazyInstanceTraits< | 71 friend struct base::LazyInstanceTraitsBase<AwResourceDispatcherHostDelegate>; |
72 AwResourceDispatcherHostDelegate>; | |
73 AwResourceDispatcherHostDelegate(); | 72 AwResourceDispatcherHostDelegate(); |
74 ~AwResourceDispatcherHostDelegate() override; | 73 ~AwResourceDispatcherHostDelegate() override; |
75 | 74 |
76 // These methods must be called on IO thread. | 75 // These methods must be called on IO thread. |
77 void OnIoThreadClientReadyInternal(int new_render_process_id, | 76 void OnIoThreadClientReadyInternal(int new_render_process_id, |
78 int new_render_frame_id); | 77 int new_render_frame_id); |
79 void AddPendingThrottleOnIoThread(int render_process_id, | 78 void AddPendingThrottleOnIoThread(int render_process_id, |
80 int render_frame_id, | 79 int render_frame_id, |
81 IoThreadClientThrottle* pending_throttle); | 80 IoThreadClientThrottle* pending_throttle); |
82 void AddExtraHeadersIfNeeded(net::URLRequest* request, | 81 void AddExtraHeadersIfNeeded(net::URLRequest* request, |
83 content::ResourceContext* resource_context); | 82 content::ResourceContext* resource_context); |
84 | 83 |
85 // Pair of render_process_id and render_frame_id. | 84 // Pair of render_process_id and render_frame_id. |
86 typedef std::pair<int, int> FrameRouteIDPair; | 85 typedef std::pair<int, int> FrameRouteIDPair; |
87 typedef std::map<FrameRouteIDPair, IoThreadClientThrottle*> | 86 typedef std::map<FrameRouteIDPair, IoThreadClientThrottle*> |
88 PendingThrottleMap; | 87 PendingThrottleMap; |
89 | 88 |
90 // Only accessed on the IO thread. | 89 // Only accessed on the IO thread. |
91 PendingThrottleMap pending_throttles_; | 90 PendingThrottleMap pending_throttles_; |
92 | 91 |
93 DISALLOW_COPY_AND_ASSIGN(AwResourceDispatcherHostDelegate); | 92 DISALLOW_COPY_AND_ASSIGN(AwResourceDispatcherHostDelegate); |
94 }; | 93 }; |
95 | 94 |
96 } // namespace android_webview | 95 } // namespace android_webview |
97 | 96 |
98 #endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_ | 97 #endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_ |
OLD | NEW |