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

Side by Side Diff: ash/shell/content_client/shell_content_browser_client.cc

Issue 1147213004: Store and load icudtl.dat directly from the apk rather than extracting on start-up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@load-from-apk
Patch Set: Keep extracting for components/ Created 5 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 "ash/shell/content_client/shell_content_browser_client.h" 5 #include "ash/shell/content_client/shell_content_browser_client.h"
6 6
7 #include "ash/shell/content_client/shell_browser_main_parts.h" 7 #include "ash/shell/content_client/shell_browser_main_parts.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/public/common/content_descriptors.h" 9 #include "content/public/common/content_descriptors.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD); 55 command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD);
56 } 56 }
57 #endif // V8_USE_EXTERNAL_STARTUP_DATA 57 #endif // V8_USE_EXTERNAL_STARTUP_DATA
58 #endif // OS_POSIX && !OS_MACOSX 58 #endif // OS_POSIX && !OS_MACOSX
59 } 59 }
60 60
61 #if defined(OS_POSIX) && !defined(OS_MACOSX) 61 #if defined(OS_POSIX) && !defined(OS_MACOSX)
62 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 62 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
63 const base::CommandLine& command_line, 63 const base::CommandLine& command_line,
64 int child_process_id, 64 int child_process_id,
65 content::FileDescriptorInfo* mappings) { 65 content::FileDescriptorInfo* mappings
66 #if defined(OS_ANDROID)
67 , std::map<int, base::MemoryMappedFile::Region>* regions
68 #endif
69 ) {
66 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 70 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
67 if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) { 71 if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) {
68 int v8_natives_fd = -1; 72 int v8_natives_fd = -1;
69 int v8_snapshot_fd = -1; 73 int v8_snapshot_fd = -1;
70 if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd, 74 if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd,
71 &v8_snapshot_fd)) { 75 &v8_snapshot_fd)) {
72 v8_natives_fd_.reset(v8_natives_fd); 76 v8_natives_fd_.reset(v8_natives_fd);
73 v8_snapshot_fd_.reset(v8_snapshot_fd); 77 v8_snapshot_fd_.reset(v8_snapshot_fd);
74 } 78 }
75 } 79 }
76 DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1); 80 DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1);
77 mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get()); 81 mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
78 mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get()); 82 mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
79 #endif // V8_USE_EXTERNAL_STARTUP_DATA 83 #endif // V8_USE_EXTERNAL_STARTUP_DATA
80 } 84 }
81 #endif // OS_POSIX && !OS_MACOSX 85 #endif // OS_POSIX && !OS_MACOSX
82 86
83 content::ShellBrowserContext* ShellContentBrowserClient::browser_context() { 87 content::ShellBrowserContext* ShellContentBrowserClient::browser_context() {
84 return shell_browser_main_parts_->browser_context(); 88 return shell_browser_main_parts_->browser_context();
85 } 89 }
86 90
87 } // namespace examples 91 } // namespace examples
88 } // namespace views 92 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698