OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 URLRequest, meaning it is a "simple" version | 6 // The class is implemented using URLRequest, meaning it is a "simple" version |
7 // that directly issues requests. The more complicated one used in the | 7 // that directly issues requests. The more complicated one used in the |
8 // browser uses IPC. | 8 // browser uses IPC. |
9 // | 9 // |
10 // Because URLRequest only provides an asynchronous resource loading API, this | 10 // Because URLRequest only provides an asynchronous resource loading API, this |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 IOThread() : base::Thread("IOThread") { | 68 IOThread() : base::Thread("IOThread") { |
69 } | 69 } |
70 | 70 |
71 ~IOThread() { | 71 ~IOThread() { |
72 // We cannot rely on our base class to stop the thread since we want our | 72 // We cannot rely on our base class to stop the thread since we want our |
73 // CleanUp function to run. | 73 // CleanUp function to run. |
74 Stop(); | 74 Stop(); |
75 } | 75 } |
76 | 76 |
77 virtual void Init() { | 77 virtual void Init() { |
78 SimpleAppCacheSystem::InitializeOnIOThread(); | 78 SimpleAppCacheSystem::InitializeOnIOThread(request_context); |
79 } | 79 } |
80 | 80 |
81 virtual void CleanUp() { | 81 virtual void CleanUp() { |
82 if (request_context) { | 82 if (request_context) { |
83 request_context->Release(); | 83 request_context->Release(); |
84 request_context = NULL; | 84 request_context = NULL; |
85 } | 85 } |
86 } | 86 } |
87 }; | 87 }; |
88 | 88 |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 options.message_loop_type = MessageLoop::TYPE_IO; | 722 options.message_loop_type = MessageLoop::TYPE_IO; |
723 return io_thread->StartWithOptions(options); | 723 return io_thread->StartWithOptions(options); |
724 } | 724 } |
725 | 725 |
726 // static | 726 // static |
727 void SimpleResourceLoaderBridge::SetAcceptAllCookies(bool accept_all_cookies) { | 727 void SimpleResourceLoaderBridge::SetAcceptAllCookies(bool accept_all_cookies) { |
728 CookiePolicy::Type policy_type = accept_all_cookies ? | 728 CookiePolicy::Type policy_type = accept_all_cookies ? |
729 CookiePolicy::ALLOW_ALL_COOKIES : CookiePolicy::BLOCK_THIRD_PARTY_COOKIES; | 729 CookiePolicy::ALLOW_ALL_COOKIES : CookiePolicy::BLOCK_THIRD_PARTY_COOKIES; |
730 request_context->cookie_policy()->set_type(policy_type); | 730 request_context->cookie_policy()->set_type(policy_type); |
731 } | 731 } |
OLD | NEW |