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

Side by Side Diff: services/navigation/content_client/content_browser_client.cc

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/navigation/content_client/content_browser_client.h" 5 #include "services/navigation/content_client/content_browser_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "content/public/browser/browser_thread.h"
11 #include "content/public/common/service_info.h" 12 #include "content/public/common/service_info.h"
12 #include "content/public/common/service_manager_connection.h" 13 #include "content/public/common/service_manager_connection.h"
13 #include "content/shell/browser/shell_browser_context.h" 14 #include "content/shell/browser/shell_browser_context.h"
14 #include "services/navigation/content_client/browser_main_parts.h" 15 #include "services/navigation/content_client/browser_main_parts.h"
15 #include "services/navigation/navigation.h" 16 #include "services/navigation/navigation.h"
17 #include "storage/browser/quota/quota_settings.h"
16 18
17 namespace navigation { 19 namespace navigation {
18 20
19 ContentBrowserClient::ContentBrowserClient() {} 21 ContentBrowserClient::ContentBrowserClient() {}
20 ContentBrowserClient::~ContentBrowserClient() {} 22 ContentBrowserClient::~ContentBrowserClient() {}
21 23
22 content::BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts( 24 content::BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts(
23 const content::MainFunctionParams& parameters) { 25 const content::MainFunctionParams& parameters) {
24 browser_main_parts_ = new BrowserMainParts(parameters); 26 browser_main_parts_ = new BrowserMainParts(parameters);
25 return browser_main_parts_; 27 return browser_main_parts_;
26 } 28 }
27 29
28 std::string ContentBrowserClient::GetServiceUserIdForBrowserContext( 30 std::string ContentBrowserClient::GetServiceUserIdForBrowserContext(
29 content::BrowserContext* browser_context) { 31 content::BrowserContext* browser_context) {
30 // Unlike Chrome, where there are different browser contexts for each process, 32 // Unlike Chrome, where there are different browser contexts for each process,
31 // each with their own userid, here there is only one and we should reuse the 33 // each with their own userid, here there is only one and we should reuse the
32 // same userid as our own process to avoid having to create multiple shell 34 // same userid as our own process to avoid having to create multiple shell
33 // connections. 35 // connections.
34 return content::ServiceManagerConnection::GetForProcess()->GetIdentity() 36 return content::ServiceManagerConnection::GetForProcess()->GetIdentity()
35 .user_id(); 37 .user_id();
36 } 38 }
37 39
38 void ContentBrowserClient::RegisterInProcessServices( 40 void ContentBrowserClient::RegisterInProcessServices(
39 StaticServiceMap* services) { 41 StaticServiceMap* services) {
40 content::ServiceManagerConnection::GetForProcess()->AddConnectionFilter( 42 content::ServiceManagerConnection::GetForProcess()->AddConnectionFilter(
41 base::MakeUnique<Navigation>()); 43 base::MakeUnique<Navigation>());
42 } 44 }
43 45
46 void ContentBrowserClient::GetQuotaSettings(
47 content::BrowserContext* context,
48 const base::FilePath& partition_path,
49 bool is_incognito,
50 const storage::OptionalQuotaSettingsCallback& callback) {
51 content::BrowserThread::PostTaskAndReplyWithResult(
52 content::BrowserThread::FILE, FROM_HERE,
53 base::Bind(&storage::CalculateNominalDynamicSettings, partition_path,
54 is_incognito),
55 callback);
56 }
57
44 } // namespace navigation 58 } // namespace navigation
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698