| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/chrome/browser/ui/chrome_web_view_factory.h" | 5 #import "ios/chrome/browser/ui/chrome_web_view_factory.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/base64.h" | 9 #include "base/base64.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 10 #include "ios/web/net/request_group_util.h" | 12 #include "ios/web/net/request_group_util.h" |
| 11 #include "ios/web/net/request_tracker_impl.h" | 13 #include "ios/web/net/request_tracker_impl.h" |
| 12 #include "ios/web/public/web_thread.h" | 14 #include "ios/web/public/web_thread.h" |
| 13 #include "net/cookies/cookie_store.h" | 15 #include "net/cookies/cookie_store.h" |
| 14 #include "net/url_request/url_request_context.h" | 16 #include "net/url_request/url_request_context.h" |
| 15 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
| 16 | 18 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 45 return path.Append("ExternalUnknownService"); | 47 return path.Append("ExternalUnknownService"); |
| 46 } | 48 } |
| 47 } | 49 } |
| 48 } // namespace ChromeWebView | 50 } // namespace ChromeWebView |
| 49 | 51 |
| 50 namespace { | 52 namespace { |
| 51 ios::ChromeBrowserState* g_external_browser_state = nullptr; | 53 ios::ChromeBrowserState* g_external_browser_state = nullptr; |
| 52 scoped_refptr<web::RequestTrackerImpl> g_request_tracker; | 54 scoped_refptr<web::RequestTrackerImpl> g_request_tracker; |
| 53 | 55 |
| 54 // Empty callback used by ClearCookiesOnIOThread below. | 56 // Empty callback used by ClearCookiesOnIOThread below. |
| 55 void DoNothing(int n) {} | 57 void DoNothing(uint32_t n) {} |
| 56 | 58 |
| 57 // Clears the cookies. | 59 // Clears the cookies. |
| 58 void ClearCookiesOnIOThread(net::URLRequestContextGetter* context_getter, | 60 void ClearCookiesOnIOThread(net::URLRequestContextGetter* context_getter, |
| 59 base::Time delete_begin, | 61 base::Time delete_begin, |
| 60 base::Time delete_end) { | 62 base::Time delete_end) { |
| 61 DCHECK(context_getter); | 63 DCHECK(context_getter); |
| 62 DCHECK_CURRENTLY_ON(web::WebThread::IO); | 64 DCHECK_CURRENTLY_ON(web::WebThread::IO); |
| 63 net::CookieStore* cookie_store = | 65 net::CookieStore* cookie_store = |
| 64 context_getter->GetURLRequestContext()->cookie_store(); | 66 context_getter->GetURLRequestContext()->cookie_store(); |
| 65 cookie_store->DeleteAllCreatedBetweenAsync(delete_begin, delete_end, | 67 cookie_store->DeleteAllCreatedBetweenAsync(delete_begin, delete_end, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 if (!g_request_tracker.get()) { | 159 if (!g_request_tracker.get()) { |
| 158 DCHECK(g_external_browser_state); | 160 DCHECK(g_external_browser_state); |
| 159 g_request_tracker = web::RequestTrackerImpl::CreateTrackerForRequestGroupID( | 161 g_request_tracker = web::RequestTrackerImpl::CreateTrackerForRequestGroupID( |
| 160 ChromeWebView::kExternalRequestGroupID, g_external_browser_state, | 162 ChromeWebView::kExternalRequestGroupID, g_external_browser_state, |
| 161 [self requestContextForExternalService:externalService], nil); | 163 [self requestContextForExternalService:externalService], nil); |
| 162 } | 164 } |
| 163 return [[UIWebView alloc] initWithFrame:CGRectZero]; | 165 return [[UIWebView alloc] initWithFrame:CGRectZero]; |
| 164 } | 166 } |
| 165 | 167 |
| 166 @end | 168 @end |
| OLD | NEW |