| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/browser/shell_browser_context.h" | 5 #include "content/shell/browser/shell_browser_context.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 net::NetLog* net_log) | 56 net::NetLog* net_log) |
| 57 : resource_context_(new ShellResourceContext), | 57 : resource_context_(new ShellResourceContext), |
| 58 ignore_certificate_errors_(false), | 58 ignore_certificate_errors_(false), |
| 59 off_the_record_(off_the_record), | 59 off_the_record_(off_the_record), |
| 60 net_log_(net_log), | 60 net_log_(net_log), |
| 61 guest_manager_(NULL) { | 61 guest_manager_(NULL) { |
| 62 InitWhileIOAllowed(); | 62 InitWhileIOAllowed(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 ShellBrowserContext::~ShellBrowserContext() { | 65 ShellBrowserContext::~ShellBrowserContext() { |
| 66 ShutdownStoragePartitions(); |
| 66 if (resource_context_) { | 67 if (resource_context_) { |
| 67 BrowserThread::DeleteSoon( | 68 BrowserThread::DeleteSoon( |
| 68 BrowserThread::IO, FROM_HERE, resource_context_.release()); | 69 BrowserThread::IO, FROM_HERE, resource_context_.release()); |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 | 72 |
| 72 void ShellBrowserContext::InitWhileIOAllowed() { | 73 void ShellBrowserContext::InitWhileIOAllowed() { |
| 73 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 74 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 74 if (cmd_line->HasSwitch(switches::kIgnoreCertificateErrors)) | 75 if (cmd_line->HasSwitch(switches::kIgnoreCertificateErrors)) |
| 75 ignore_certificate_errors_ = true; | 76 ignore_certificate_errors_ = true; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 return permission_manager_.get(); | 196 return permission_manager_.get(); |
| 196 } | 197 } |
| 197 | 198 |
| 198 BackgroundSyncController* ShellBrowserContext::GetBackgroundSyncController() { | 199 BackgroundSyncController* ShellBrowserContext::GetBackgroundSyncController() { |
| 199 if (!background_sync_controller_) | 200 if (!background_sync_controller_) |
| 200 background_sync_controller_.reset(new MockBackgroundSyncController()); | 201 background_sync_controller_.reset(new MockBackgroundSyncController()); |
| 201 return background_sync_controller_.get(); | 202 return background_sync_controller_.get(); |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace content | 205 } // namespace content |
| OLD | NEW |