| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
| 6 // The class is implemented using net::URLRequest, meaning it is a "simple" | 6 // The class is implemented using net::URLRequest, meaning it is a "simple" |
| 7 // version that directly issues requests. The more complicated one used in the | 7 // version that directly issues requests. The more complicated one used in the |
| 8 // browser uses IPC. | 8 // browser uses IPC. |
| 9 // | 9 // |
| 10 // Because net::URLRequest only provides an asynchronous resource loading API, | 10 // Because net::URLRequest only provides an asynchronous resource loading API, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 if (g_request_context) { | 160 if (g_request_context) { |
| 161 g_request_context->Release(); | 161 g_request_context->Release(); |
| 162 g_request_context = NULL; | 162 g_request_context = NULL; |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 void SetAcceptAllCookies(bool accept_all_cookies) { | 166 void SetAcceptAllCookies(bool accept_all_cookies) { |
| 167 StaticCookiePolicy::Type policy_type = accept_all_cookies ? | 167 StaticCookiePolicy::Type policy_type = accept_all_cookies ? |
| 168 StaticCookiePolicy::ALLOW_ALL_COOKIES : | 168 StaticCookiePolicy::ALLOW_ALL_COOKIES : |
| 169 StaticCookiePolicy::BLOCK_THIRD_PARTY_COOKIES; | 169 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; |
| 170 static_cast<StaticCookiePolicy*>(g_request_context->cookie_policy())-> | 170 static_cast<StaticCookiePolicy*>(g_request_context->cookie_policy())-> |
| 171 set_type(policy_type); | 171 set_type(policy_type); |
| 172 } | 172 } |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 IOThread* g_io_thread = NULL; | 175 IOThread* g_io_thread = NULL; |
| 176 | 176 |
| 177 //----------------------------------------------------------------------------- | 177 //----------------------------------------------------------------------------- |
| 178 | 178 |
| 179 struct RequestParams { | 179 struct RequestParams { |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 | 928 |
| 929 // static | 929 // static |
| 930 scoped_refptr<base::MessageLoopProxy> | 930 scoped_refptr<base::MessageLoopProxy> |
| 931 SimpleResourceLoaderBridge::GetIoThread() { | 931 SimpleResourceLoaderBridge::GetIoThread() { |
| 932 if (!EnsureIOThread()) { | 932 if (!EnsureIOThread()) { |
| 933 LOG(DFATAL) << "Failed to create IO thread."; | 933 LOG(DFATAL) << "Failed to create IO thread."; |
| 934 return NULL; | 934 return NULL; |
| 935 } | 935 } |
| 936 return g_io_thread->message_loop_proxy(); | 936 return g_io_thread->message_loop_proxy(); |
| 937 } | 937 } |
| OLD | NEW |