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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1156873002: Load v8 snapshots directly from APK (and store them uncompressed) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8initializer
Patch Set: fix webview, content shell, chromecast Created 5 years, 7 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 extra_parts_[i]->GetAdditionalFileSystemBackends( 2217 extra_parts_[i]->GetAdditionalFileSystemBackends(
2218 browser_context, storage_partition_path, additional_backends); 2218 browser_context, storage_partition_path, additional_backends);
2219 } 2219 }
2220 } 2220 }
2221 2221
2222 #if defined(OS_POSIX) && !defined(OS_MACOSX) 2222 #if defined(OS_POSIX) && !defined(OS_MACOSX)
2223 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 2223 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
2224 const base::CommandLine& command_line, 2224 const base::CommandLine& command_line,
2225 int child_process_id, 2225 int child_process_id,
2226 FileDescriptorInfo* mappings) { 2226 FileDescriptorInfo* mappings) {
2227 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 2227 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) && !defined(OS_ANDROID)
2228 if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) { 2228 if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) {
2229 int v8_natives_fd = -1; 2229 int v8_natives_fd = -1;
2230 int v8_snapshot_fd = -1; 2230 int v8_snapshot_fd = -1;
2231 if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd, 2231 if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd,
2232 &v8_snapshot_fd)) { 2232 &v8_snapshot_fd)) {
2233 v8_natives_fd_.reset(v8_natives_fd); 2233 v8_natives_fd_.reset(v8_natives_fd);
2234 v8_snapshot_fd_.reset(v8_snapshot_fd); 2234 v8_snapshot_fd_.reset(v8_snapshot_fd);
2235 } 2235 }
2236 } 2236 }
2237 DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1); 2237 DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1);
2238 mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get()); 2238 mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
2239 mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get()); 2239 mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
2240 #endif // V8_USE_EXTERNAL_STARTUP_DATA 2240 #endif // V8_USE_EXTERNAL_STARTUP_DATA && !defined(OS_ANDROID)
2241 2241
2242 #if defined(OS_ANDROID) 2242 #if defined(OS_ANDROID)
2243 base::FilePath data_path; 2243 base::FilePath data_path;
2244 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); 2244 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path);
2245 DCHECK(!data_path.empty()); 2245 DCHECK(!data_path.empty());
2246 2246
2247 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; 2247 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2248 base::FilePath chrome_resources_pak = 2248 base::FilePath chrome_resources_pak =
2249 data_path.AppendASCII("chrome_100_percent.pak"); 2249 data_path.AppendASCII("chrome_100_percent.pak");
2250 base::File file(chrome_resources_pak, flags); 2250 base::File file(chrome_resources_pak, flags);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 switches::kDisableWebRtcEncryption, 2446 switches::kDisableWebRtcEncryption,
2447 }; 2447 };
2448 to_command_line->CopySwitchesFrom(from_command_line, 2448 to_command_line->CopySwitchesFrom(from_command_line,
2449 kWebRtcDevSwitchNames, 2449 kWebRtcDevSwitchNames,
2450 arraysize(kWebRtcDevSwitchNames)); 2450 arraysize(kWebRtcDevSwitchNames));
2451 } 2451 }
2452 } 2452 }
2453 #endif // defined(ENABLE_WEBRTC) 2453 #endif // defined(ENABLE_WEBRTC)
2454 2454
2455 } // namespace chrome 2455 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698