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

Side by Side Diff: headless/lib/browser/headless_browser_context_impl.cc

Issue 2159133002: Shutdown StoragePartition before ProfileIOData is being shut down (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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
« no previous file with comments | « content/shell/browser/shell_browser_context.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "headless/lib/browser/headless_browser_context_impl.h" 5 #include "headless/lib/browser/headless_browser_context_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 HeadlessBrowserContextImpl::HeadlessBrowserContextImpl( 69 HeadlessBrowserContextImpl::HeadlessBrowserContextImpl(
70 ProtocolHandlerMap protocol_handlers, 70 ProtocolHandlerMap protocol_handlers,
71 HeadlessBrowser::Options* options) 71 HeadlessBrowser::Options* options)
72 : protocol_handlers_(std::move(protocol_handlers)), 72 : protocol_handlers_(std::move(protocol_handlers)),
73 options_(options), 73 options_(options),
74 resource_context_(new HeadlessResourceContext) { 74 resource_context_(new HeadlessResourceContext) {
75 InitWhileIOAllowed(); 75 InitWhileIOAllowed();
76 } 76 }
77 77
78 HeadlessBrowserContextImpl::~HeadlessBrowserContextImpl() { 78 HeadlessBrowserContextImpl::~HeadlessBrowserContextImpl() {
79 ShutdownStoragePartitions();
79 if (resource_context_) { 80 if (resource_context_) {
80 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, 81 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
81 resource_context_.release()); 82 resource_context_.release());
82 } 83 }
83 } 84 }
84 85
85 // static 86 // static
86 HeadlessBrowserContextImpl* HeadlessBrowserContextImpl::From( 87 HeadlessBrowserContextImpl* HeadlessBrowserContextImpl::From(
87 HeadlessBrowserContext* browser_context) { 88 HeadlessBrowserContext* browser_context) {
88 return reinterpret_cast<HeadlessBrowserContextImpl*>(browser_context); 89 return reinterpret_cast<HeadlessBrowserContextImpl*>(browser_context);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return *this; 203 return *this;
203 } 204 }
204 205
205 std::unique_ptr<HeadlessBrowserContext> 206 std::unique_ptr<HeadlessBrowserContext>
206 HeadlessBrowserContext::Builder::Build() { 207 HeadlessBrowserContext::Builder::Build() {
207 return base::WrapUnique(new HeadlessBrowserContextImpl( 208 return base::WrapUnique(new HeadlessBrowserContextImpl(
208 std::move(protocol_handlers_), browser_->options())); 209 std::move(protocol_handlers_), browser_->options()));
209 } 210 }
210 211
211 } // namespace headless 212 } // namespace headless
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698