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

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

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync master Created 6 years, 2 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 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 DCHECK(!app_data_path.empty()); 2487 DCHECK(!app_data_path.empty());
2488 2488
2489 flags = base::File::FLAG_OPEN | base::File::FLAG_READ; 2489 flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2490 base::FilePath icudata_path = 2490 base::FilePath icudata_path =
2491 app_data_path.AppendASCII("icudtl.dat"); 2491 app_data_path.AppendASCII("icudtl.dat");
2492 base::File icudata_file(icudata_path, flags); 2492 base::File icudata_file(icudata_path, flags);
2493 DCHECK(icudata_file.IsValid()); 2493 DCHECK(icudata_file.IsValid());
2494 mappings->Transfer(kAndroidICUDataDescriptor, 2494 mappings->Transfer(kAndroidICUDataDescriptor,
2495 base::ScopedFD(icudata_file.TakePlatformFile())); 2495 base::ScopedFD(icudata_file.TakePlatformFile()));
2496 2496
2497 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
2498 base::FilePath v8_data_path;
2499 PathService::Get(base::DIR_ANDROID_APP_DATA, &v8_data_path);
2500 DCHECK(!v8_data_path.empty());
2501
2502 int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2503 base::FilePath v8_natives_data_path =
2504 v8_data_path.AppendASCII("natives_blob.bin");
2505 base::FilePath v8_snapshot_data_path =
2506 v8_data_path.AppendASCII("snapshot_blob.bin");
2507 base::File v8_natives_data_file(v8_natives_data_path, file_flags);
2508 base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
2509 DCHECK(v8_natives_data_file.IsValid());
2510 DCHECK(v8_snapshot_data_file.IsValid());
2511 mappings->Transfer(kV8NativesDataDescriptor,
2512 base::ScopedFD(v8_natives_data_file.TakePlatformFile()));
2513 mappings->Transfer(kV8SnapshotDataDescriptor,
2514 base::ScopedFD(v8_snapshot_data_file.TakePlatformFile()));
2515 #endif // V8_USE_EXTERNAL_STARTUP_DATA
2516
2497 #else 2517 #else
2498 int crash_signal_fd = GetCrashSignalFD(command_line); 2518 int crash_signal_fd = GetCrashSignalFD(command_line);
2499 if (crash_signal_fd >= 0) { 2519 if (crash_signal_fd >= 0) {
2500 mappings->Share(kCrashDumpSignal, crash_signal_fd); 2520 mappings->Share(kCrashDumpSignal, crash_signal_fd);
2501 } 2521 }
2502 #endif // defined(OS_ANDROID) 2522 #endif // defined(OS_ANDROID)
2503 } 2523 }
2504 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 2524 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
2505 2525
2506 #if defined(OS_WIN) 2526 #if defined(OS_WIN)
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 switches::kDisableWebRtcEncryption, 2660 switches::kDisableWebRtcEncryption,
2641 }; 2661 };
2642 to_command_line->CopySwitchesFrom(from_command_line, 2662 to_command_line->CopySwitchesFrom(from_command_line,
2643 kWebRtcDevSwitchNames, 2663 kWebRtcDevSwitchNames,
2644 arraysize(kWebRtcDevSwitchNames)); 2664 arraysize(kWebRtcDevSwitchNames));
2645 } 2665 }
2646 } 2666 }
2647 #endif // defined(ENABLE_WEBRTC) 2667 #endif // defined(ENABLE_WEBRTC)
2648 2668
2649 } // namespace chrome 2669 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698