| 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 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 net::URLRequest* request) OVERRIDE; | 57 net::URLRequest* request) OVERRIDE; |
| 58 virtual bool HandleExternalProtocol(const GURL& url, | 58 virtual bool HandleExternalProtocol(const GURL& url, |
| 59 int child_id, | 59 int child_id, |
| 60 int route_id) OVERRIDE; | 60 int route_id) OVERRIDE; |
| 61 virtual void OnResponseStarted( | 61 virtual void OnResponseStarted( |
| 62 net::URLRequest* request, | 62 net::URLRequest* request, |
| 63 content::ResourceContext* resource_context, | 63 content::ResourceContext* resource_context, |
| 64 content::ResourceResponse* response, | 64 content::ResourceResponse* response, |
| 65 IPC::Sender* sender) OVERRIDE; | 65 IPC::Sender* sender) OVERRIDE; |
| 66 | 66 |
| 67 virtual void OnRequestRedirected( |
| 68 const GURL& redirect_url, |
| 69 net::URLRequest* request, |
| 70 content::ResourceContext* resource_context, |
| 71 content::ResourceResponse* response) OVERRIDE; |
| 72 |
| 67 void RemovePendingThrottleOnIoThread(IoThreadClientThrottle* throttle); | 73 void RemovePendingThrottleOnIoThread(IoThreadClientThrottle* throttle); |
| 68 | 74 |
| 69 static void OnIoThreadClientReady(int new_child_id, int new_route_id); | 75 static void OnIoThreadClientReady(int new_child_id, int new_route_id); |
| 70 static void AddPendingThrottle(int child_id, | 76 static void AddPendingThrottle(int child_id, |
| 71 int route_id, | 77 int route_id, |
| 72 IoThreadClientThrottle* pending_throttle); | 78 IoThreadClientThrottle* pending_throttle); |
| 73 | 79 |
| 74 private: | 80 private: |
| 75 friend struct base::DefaultLazyInstanceTraits< | 81 friend struct base::DefaultLazyInstanceTraits< |
| 76 AwResourceDispatcherHostDelegate>; | 82 AwResourceDispatcherHostDelegate>; |
| 77 AwResourceDispatcherHostDelegate(); | 83 AwResourceDispatcherHostDelegate(); |
| 78 virtual ~AwResourceDispatcherHostDelegate(); | 84 virtual ~AwResourceDispatcherHostDelegate(); |
| 79 | 85 |
| 80 // These methods must be called on IO thread. | 86 // These methods must be called on IO thread. |
| 81 void OnIoThreadClientReadyInternal(int child_id, int route_id); | 87 void OnIoThreadClientReadyInternal(int child_id, int route_id); |
| 82 void AddPendingThrottleOnIoThread(int child_id, | 88 void AddPendingThrottleOnIoThread(int child_id, |
| 83 int route_id, | 89 int route_id, |
| 84 IoThreadClientThrottle* pending_throttle); | 90 IoThreadClientThrottle* pending_throttle); |
| 91 void AddExtraHeadersIfNeeded(net::URLRequest* request, |
| 92 content::ResourceContext* resource_context); |
| 85 | 93 |
| 86 typedef std::pair<int, int> ChildRouteIDPair; | 94 typedef std::pair<int, int> ChildRouteIDPair; |
| 87 typedef std::map<ChildRouteIDPair, IoThreadClientThrottle*> | 95 typedef std::map<ChildRouteIDPair, IoThreadClientThrottle*> |
| 88 PendingThrottleMap; | 96 PendingThrottleMap; |
| 89 | 97 |
| 90 // Only accessed on the IO thread. | 98 // Only accessed on the IO thread. |
| 91 PendingThrottleMap pending_throttles_; | 99 PendingThrottleMap pending_throttles_; |
| 92 | 100 |
| 93 DISALLOW_COPY_AND_ASSIGN(AwResourceDispatcherHostDelegate); | 101 DISALLOW_COPY_AND_ASSIGN(AwResourceDispatcherHostDelegate); |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 } // namespace android_webview | 104 } // namespace android_webview |
| 97 | 105 |
| 98 #endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_ | 106 #endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_ |
| OLD | NEW |