| OLD | NEW |
| 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> |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 context->SetUserData(kDownloadManagerKeyName, download_manager); | 145 context->SetUserData(kDownloadManagerKeyName, download_manager); |
| 146 } | 146 } |
| 147 | 147 |
| 148 class BrowserContextShellConnectionHolder | 148 class BrowserContextShellConnectionHolder |
| 149 : public base::SupportsUserData::Data { | 149 : public base::SupportsUserData::Data { |
| 150 public: | 150 public: |
| 151 BrowserContextShellConnectionHolder( | 151 BrowserContextShellConnectionHolder( |
| 152 std::unique_ptr<shell::Connection> connection, | 152 std::unique_ptr<shell::Connection> connection, |
| 153 shell::mojom::ShellClientRequest request) | 153 shell::mojom::ShellClientRequest request) |
| 154 : root_connection_(std::move(connection)), | 154 : root_connection_(std::move(connection)), |
| 155 shell_connection_(MojoShellConnection::Create(std::move(request))) {} | 155 shell_connection_(MojoShellConnection::Create( |
| 156 std::move(request), |
| 157 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) {} |
| 156 ~BrowserContextShellConnectionHolder() override {} | 158 ~BrowserContextShellConnectionHolder() override {} |
| 157 | 159 |
| 158 MojoShellConnection* shell_connection() { return shell_connection_.get(); } | 160 MojoShellConnection* shell_connection() { return shell_connection_.get(); } |
| 159 | 161 |
| 160 private: | 162 private: |
| 161 std::unique_ptr<shell::Connection> root_connection_; | 163 std::unique_ptr<shell::Connection> root_connection_; |
| 162 std::unique_ptr<MojoShellConnection> shell_connection_; | 164 std::unique_ptr<MojoShellConnection> shell_connection_; |
| 163 | 165 |
| 164 DISALLOW_COPY_AND_ASSIGN(BrowserContextShellConnectionHolder); | 166 DISALLOW_COPY_AND_ASSIGN(BrowserContextShellConnectionHolder); |
| 165 }; | 167 }; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 << "Attempting to destroy a BrowserContext that never called " | 486 << "Attempting to destroy a BrowserContext that never called " |
| 485 << "Initialize()"; | 487 << "Initialize()"; |
| 486 | 488 |
| 487 RemoveBrowserContextFromUserIdMap(this); | 489 RemoveBrowserContextFromUserIdMap(this); |
| 488 | 490 |
| 489 if (GetUserData(kDownloadManagerKeyName)) | 491 if (GetUserData(kDownloadManagerKeyName)) |
| 490 GetDownloadManager(this)->Shutdown(); | 492 GetDownloadManager(this)->Shutdown(); |
| 491 } | 493 } |
| 492 | 494 |
| 493 } // namespace content | 495 } // namespace content |
| OLD | NEW |