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

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 2613803003: Simplifying ContentBrowserClient::GetAdditionalMappedFiles...() (Closed)
Patch Set: Created 3 years, 11 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 "android_webview/browser/aw_content_browser_client.h" 5 #include "android_webview/browser/aw_content_browser_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 return false; 468 return false;
469 } 469 }
470 470
471 content::TracingDelegate* AwContentBrowserClient::GetTracingDelegate() { 471 content::TracingDelegate* AwContentBrowserClient::GetTracingDelegate() {
472 return new AwTracingDelegate(); 472 return new AwTracingDelegate();
473 } 473 }
474 474
475 void AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 475 void AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
476 const base::CommandLine& command_line, 476 const base::CommandLine& command_line,
477 int child_process_id, 477 int child_process_id,
478 content::FileDescriptorInfo* mappings, 478 content::FileDescriptorInfo* mappings) {
479 std::map<int, base::MemoryMappedFile::Region>* regions) { 479 base::MemoryMappedFile::Region region;
480 int fd = ui::GetMainAndroidPackFd( 480 int fd = ui::GetMainAndroidPackFd(&region);
481 &(*regions)[kAndroidWebViewMainPakDescriptor]); 481 mappings->ShareWithRegion(kAndroidWebViewMainPakDescriptor, fd, region);
482 mappings->Share(kAndroidWebViewMainPakDescriptor, fd);
483 482
484 fd = ui::GetCommonResourcesPackFd( 483 fd = ui::GetCommonResourcesPackFd(&region);
485 &(*regions)[kAndroidWebView100PercentPakDescriptor]); 484 mappings->ShareWithRegion(kAndroidWebView100PercentPakDescriptor, fd, region);
486 mappings->Share(kAndroidWebView100PercentPakDescriptor, fd);
487 485
488 fd = ui::GetLocalePackFd(&(*regions)[kAndroidWebViewLocalePakDescriptor]); 486 fd = ui::GetLocalePackFd(&region);
489 mappings->Share(kAndroidWebViewLocalePakDescriptor, fd); 487 mappings->ShareWithRegion(kAndroidWebViewLocalePakDescriptor, fd, region);
490 488
491 base::ScopedFD crash_signal_file = 489 base::ScopedFD crash_signal_file =
492 breakpad::CrashMicroDumpManager::GetInstance()->CreateCrashInfoChannel( 490 breakpad::CrashMicroDumpManager::GetInstance()->CreateCrashInfoChannel(
493 child_process_id); 491 child_process_id);
494 if (crash_signal_file.is_valid()) { 492 if (crash_signal_file.is_valid()) {
495 mappings->Transfer(kAndroidWebViewCrashSignalDescriptor, 493 mappings->Transfer(kAndroidWebViewCrashSignalDescriptor,
496 std::move(crash_signal_file)); 494 std::move(crash_signal_file));
497 } 495 }
498 } 496 }
499 497
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 render_frame_host)); 550 render_frame_host));
553 551
554 // Although WebView does not support password manager feature, renderer code 552 // Although WebView does not support password manager feature, renderer code
555 // could still request this interface, so we register a dummy binder which 553 // could still request this interface, so we register a dummy binder which
556 // just drops the incoming request, to avoid the 'Failed to locate a binder 554 // just drops the incoming request, to avoid the 'Failed to locate a binder
557 // for interface' error log.. 555 // for interface' error log..
558 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver)); 556 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver));
559 } 557 }
560 558
561 } // namespace android_webview 559 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698