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 #include "chrome/browser/net/chrome_cookie_policy.h" | 5 #include "chrome/browser/net/chrome_cookie_policy.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
10 #include "chrome/browser/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/base/static_cookie_policy.h" | 12 #include "net/base/static_cookie_policy.h" |
13 | 13 |
14 // If we queue up more than this number of completions, then switch from ASK to | 14 // If we queue up more than this number of completions, then switch from ASK to |
15 // BLOCK. More than this number of requests at once seems like it could be a | 15 // BLOCK. More than this number of requests at once seems like it could be a |
16 // sign of trouble anyways. | 16 // sign of trouble anyways. |
17 static const size_t kMaxCompletionsPerHost = 10000; | 17 static const size_t kMaxCompletionsPerHost = 10000; |
18 | 18 |
19 // ---------------------------------------------------------------------------- | 19 // ---------------------------------------------------------------------------- |
20 | 20 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 url, CONTENT_SETTINGS_TYPE_COOKIES, ""); | 99 url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
100 if (setting == CONTENT_SETTING_BLOCK) | 100 if (setting == CONTENT_SETTING_BLOCK) |
101 return net::ERR_ACCESS_DENIED; | 101 return net::ERR_ACCESS_DENIED; |
102 if (setting == CONTENT_SETTING_ALLOW) | 102 if (setting == CONTENT_SETTING_ALLOW) |
103 return net::OK; | 103 return net::OK; |
104 if (setting == CONTENT_SETTING_SESSION_ONLY) | 104 if (setting == CONTENT_SETTING_SESSION_ONLY) |
105 return net::OK_FOR_SESSION_ONLY; | 105 return net::OK_FOR_SESSION_ONLY; |
106 return net::ERR_IO_PENDING; // Need to prompt. | 106 return net::ERR_IO_PENDING; // Need to prompt. |
107 } | 107 } |
108 | 108 |
OLD | NEW |