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

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

Issue 2847013002: Switch to mojo localstorage backend by default. (Closed)
Patch Set: rebase Created 3 years, 6 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 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 new BrowserContextServiceManagerConnectionHolder( 472 new BrowserContextServiceManagerConnectionHolder(
473 std::move(service_request)); 473 std::move(service_request));
474 browser_context->SetUserData(kServiceManagerConnection, 474 browser_context->SetUserData(kServiceManagerConnection,
475 base::WrapUnique(connection_holder)); 475 base::WrapUnique(connection_holder));
476 476
477 ServiceManagerConnection* connection = 477 ServiceManagerConnection* connection =
478 connection_holder->service_manager_connection(); 478 connection_holder->service_manager_connection();
479 479
480 // New embedded service factories should be added to |connection| here. 480 // New embedded service factories should be added to |connection| here.
481 481
482 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 482 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
483 switches::kMojoLocalStorage)) { 483 switches::kDisableMojoLocalStorage)) {
484 ServiceInfo info; 484 ServiceInfo info;
485 // TODO(mek): Use sequenced task runner rather than single thread task 485 // TODO(mek): Use sequenced task runner rather than single thread task
486 // runner when mojo supports that (http://crbug.com/678155). 486 // runner when mojo supports that (http://crbug.com/678155).
487 info.factory = base::Bind( 487 info.factory = base::Bind(
488 &file::CreateFileService, 488 &file::CreateFileService,
489 base::CreateSingleThreadTaskRunnerWithTraits( 489 base::CreateSingleThreadTaskRunnerWithTraits(
490 {base::MayBlock(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}), 490 {base::MayBlock(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
491 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); 491 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB));
492 connection->AddEmbeddedService(file::mojom::kServiceName, info); 492 connection->AddEmbeddedService(file::mojom::kServiceName, info);
493 } 493 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 568
569 // static 569 // static
570 std::string BrowserContext::CreateRandomMediaDeviceIDSalt() { 570 std::string BrowserContext::CreateRandomMediaDeviceIDSalt() {
571 std::string salt; 571 std::string salt;
572 base::Base64Encode(base::RandBytesAsString(16), &salt); 572 base::Base64Encode(base::RandBytesAsString(16), &salt);
573 DCHECK(!salt.empty()); 573 DCHECK(!salt.empty());
574 return salt; 574 return salt;
575 } 575 }
576 576
577 } // namespace content 577 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698