Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Side by Side Diff: content/browser/browser_context.cc

Issue 1815563004: Remove iOS ifdefs in src/content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/public/browser/browser_context.h" 5 #include "content/public/browser/browser_context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/guid.h" 13 #include "base/guid.h"
14 #include "base/lazy_instance.h" 14 #include "base/lazy_instance.h"
15 #include "base/rand_util.h" 15 #include "base/rand_util.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17
18 #if !defined(OS_IOS)
19 #include "components/profile_service/profile_app.h" 17 #include "components/profile_service/profile_app.h"
20 #include "content/browser/download/download_manager_impl.h" 18 #include "content/browser/download/download_manager_impl.h"
21 #include "content/browser/fileapi/chrome_blob_storage_context.h" 19 #include "content/browser/fileapi/chrome_blob_storage_context.h"
22 #include "content/browser/indexed_db/indexed_db_context_impl.h" 20 #include "content/browser/indexed_db/indexed_db_context_impl.h"
23 #include "content/browser/loader/resource_dispatcher_host_impl.h" 21 #include "content/browser/loader/resource_dispatcher_host_impl.h"
24 #include "content/browser/push_messaging/push_messaging_router.h" 22 #include "content/browser/push_messaging/push_messaging_router.h"
25 #include "content/browser/storage_partition_impl_map.h" 23 #include "content/browser/storage_partition_impl_map.h"
26 #include "content/common/child_process_host_impl.h" 24 #include "content/common/child_process_host_impl.h"
27 #include "content/public/browser/blob_handle.h" 25 #include "content/public/browser/blob_handle.h"
28 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/content_browser_client.h" 27 #include "content/public/browser/content_browser_client.h"
30 #include "content/public/browser/site_instance.h" 28 #include "content/public/browser/site_instance.h"
31 #include "net/cookies/cookie_store.h" 29 #include "net/cookies/cookie_store.h"
32 #include "net/ssl/channel_id_service.h" 30 #include "net/ssl/channel_id_service.h"
33 #include "net/ssl/channel_id_store.h" 31 #include "net/ssl/channel_id_store.h"
34 #include "net/url_request/url_request_context.h" 32 #include "net/url_request/url_request_context.h"
35 #include "net/url_request/url_request_context_getter.h" 33 #include "net/url_request/url_request_context_getter.h"
36 #include "storage/browser/database/database_tracker.h" 34 #include "storage/browser/database/database_tracker.h"
37 #include "storage/browser/fileapi/external_mount_points.h" 35 #include "storage/browser/fileapi/external_mount_points.h"
38 #endif // !OS_IOS
39 36
40 using base::UserDataAdapter; 37 using base::UserDataAdapter;
41 38
42 namespace content { 39 namespace content {
43 40
44 // Only ~BrowserContext() is needed on iOS.
45 #if !defined(OS_IOS)
46 namespace { 41 namespace {
47 42
48 base::LazyInstance<std::set<std::string>> g_used_user_ids = 43 base::LazyInstance<std::set<std::string>> g_used_user_ids =
49 LAZY_INSTANCE_INITIALIZER; 44 LAZY_INSTANCE_INITIALIZER;
50 base::LazyInstance<std::vector<std::pair<BrowserContext*, std::string>>> 45 base::LazyInstance<std::vector<std::pair<BrowserContext*, std::string>>>
51 g_context_to_user_id = LAZY_INSTANCE_INITIALIZER; 46 g_context_to_user_id = LAZY_INSTANCE_INITIALIZER;
52 47
53 // Key names on BrowserContext. 48 // Key names on BrowserContext.
54 const char kDownloadManagerKeyName[] = "download_manager"; 49 const char kDownloadManagerKeyName[] = "download_manager";
55 const char kStoragePartitionMapKeyName[] = "content_storage_partition_map"; 50 const char kStoragePartitionMapKeyName[] = "content_storage_partition_map";
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 353
359 auto it = std::find_if( 354 auto it = std::find_if(
360 g_context_to_user_id.Get().begin(), 355 g_context_to_user_id.Get().begin(),
361 g_context_to_user_id.Get().end(), 356 g_context_to_user_id.Get().end(),
362 [&browser_context](const std::pair<BrowserContext*, std::string>& p) { 357 [&browser_context](const std::pair<BrowserContext*, std::string>& p) {
363 return p.first == browser_context; }); 358 return p.first == browser_context; });
364 CHECK(it != g_context_to_user_id.Get().end()); 359 CHECK(it != g_context_to_user_id.Get().end());
365 return it->second; 360 return it->second;
366 } 361 }
367 362
368 #endif // !OS_IOS
369
370 BrowserContext::~BrowserContext() { 363 BrowserContext::~BrowserContext() {
371 CHECK(GetUserData(kMojoWasInitialized)) 364 CHECK(GetUserData(kMojoWasInitialized))
372 << "Attempting to destroy a BrowserContext that never called " 365 << "Attempting to destroy a BrowserContext that never called "
373 << "Initialize()"; 366 << "Initialize()";
374 367
375 #if !defined(OS_IOS)
376 if (GetUserData(kDownloadManagerKeyName)) 368 if (GetUserData(kDownloadManagerKeyName))
377 GetDownloadManager(this)->Shutdown(); 369 GetDownloadManager(this)->Shutdown();
378 #endif
379 } 370 }
380 371
381 } // namespace content 372 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698