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 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 5 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "android_webview/browser/aw_contents_io_thread_client.h" | 9 #include "android_webview/browser/aw_contents_io_thread_client.h" |
10 #include "android_webview/browser/aw_login_delegate.h" | 10 #include "android_webview/browser/aw_login_delegate.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Calls through the IoThreadClient to check the embedders settings to determine | 56 // Calls through the IoThreadClient to check the embedders settings to determine |
57 // if the request should be cancelled. There may not always be an IoThreadClient | 57 // if the request should be cancelled. There may not always be an IoThreadClient |
58 // available for the |render_process_id|, |render_frame_id| pair (in the case of | 58 // available for the |render_process_id|, |render_frame_id| pair (in the case of |
59 // newly created pop up windows, for example) and in that case the request and | 59 // newly created pop up windows, for example) and in that case the request and |
60 // the client callbacks will be deferred the request until a client is ready. | 60 // the client callbacks will be deferred the request until a client is ready. |
61 class IoThreadClientThrottle : public content::ResourceThrottle { | 61 class IoThreadClientThrottle : public content::ResourceThrottle { |
62 public: | 62 public: |
63 IoThreadClientThrottle(int render_process_id, | 63 IoThreadClientThrottle(int render_process_id, |
64 int render_frame_id, | 64 int render_frame_id, |
65 net::URLRequest* request); | 65 net::URLRequest* request); |
66 virtual ~IoThreadClientThrottle(); | 66 ~IoThreadClientThrottle() override; |
67 | 67 |
68 // From content::ResourceThrottle | 68 // From content::ResourceThrottle |
69 virtual void WillStartRequest(bool* defer) override; | 69 void WillStartRequest(bool* defer) override; |
70 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) override; | 70 void WillRedirectRequest(const GURL& new_url, bool* defer) override; |
71 virtual const char* GetNameForLogging() const override; | 71 const char* GetNameForLogging() const override; |
72 | 72 |
73 void OnIoThreadClientReady(int new_render_process_id, | 73 void OnIoThreadClientReady(int new_render_process_id, |
74 int new_render_frame_id); | 74 int new_render_frame_id); |
75 bool MaybeBlockRequest(); | 75 bool MaybeBlockRequest(); |
76 bool ShouldBlockRequest(); | 76 bool ShouldBlockRequest(); |
77 int render_process_id() const { return render_process_id_; } | 77 int render_process_id() const { return render_process_id_; } |
78 int render_frame_id() const { return render_frame_id_; } | 78 int render_frame_id() const { return render_frame_id_; } |
79 | 79 |
80 private: | 80 private: |
81 int render_process_id_; | 81 int render_process_id_; |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 net::HttpRequestHeaders headers; | 416 net::HttpRequestHeaders headers; |
417 headers.AddHeadersFromString(extra_headers); | 417 headers.AddHeadersFromString(extra_headers); |
418 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { | 418 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { |
419 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); | 419 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); |
420 } | 420 } |
421 } | 421 } |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
425 } // namespace android_webview | 425 } // namespace android_webview |
OLD | NEW |