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

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: Turn static variables into pointers and remove v8 init in net 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 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 DCHECK(!app_data_path.empty()); 2442 DCHECK(!app_data_path.empty());
2443 2443
2444 flags = base::File::FLAG_OPEN | base::File::FLAG_READ; 2444 flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2445 base::FilePath icudata_path = 2445 base::FilePath icudata_path =
2446 app_data_path.AppendASCII("icudtl.dat"); 2446 app_data_path.AppendASCII("icudtl.dat");
2447 base::File icudata_file(icudata_path, flags); 2447 base::File icudata_file(icudata_path, flags);
2448 DCHECK(icudata_file.IsValid()); 2448 DCHECK(icudata_file.IsValid());
2449 mappings->push_back(FileDescriptorInfo(kAndroidICUDataDescriptor, 2449 mappings->push_back(FileDescriptorInfo(kAndroidICUDataDescriptor,
2450 FileDescriptor(icudata_file.Pass()))); 2450 FileDescriptor(icudata_file.Pass())));
2451 2451
2452 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
2453 base::FilePath v8_data_path;
2454 PathService::Get(base::DIR_ANDROID_APP_DATA, &v8_data_path);
2455 DCHECK(!v8_data_path.empty());
2456
2457 int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
2458 base::FilePath v8_natives_data_path =
2459 v8_data_path.AppendASCII("natives_blob.bin");
2460 base::FilePath v8_snapshot_data_path =
2461 v8_data_path.AppendASCII("snapshot_blob.bin");
2462 base::File v8_natives_data_file(v8_natives_data_path, file_flags);
2463 base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
2464 DCHECK(v8_natives_data_file.IsValid());
2465 DCHECK(v8_snapshot_data_file.IsValid());
2466 mappings->push_back(FileDescriptorInfo(kV8NativesDataDescriptor,
2467 FileDescriptor(v8_natives_data_file.Pass())));
2468 mappings->push_back(FileDescriptorInfo(kV8SnapshotDataDescriptor,
2469 FileDescriptor(v8_snapshot_data_file.Pass())));
2470 #endif // V8_USE_EXTERNAL_STARTUP_DATA
2471
2452 #else 2472 #else
2453 int crash_signal_fd = GetCrashSignalFD(command_line); 2473 int crash_signal_fd = GetCrashSignalFD(command_line);
2454 if (crash_signal_fd >= 0) { 2474 if (crash_signal_fd >= 0) {
2455 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, 2475 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal,
2456 FileDescriptor(crash_signal_fd, 2476 FileDescriptor(crash_signal_fd,
2457 false))); 2477 false)));
2458 } 2478 }
2459 #endif // defined(OS_ANDROID) 2479 #endif // defined(OS_ANDROID)
2460 } 2480 }
2461 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 2481 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2593 switches::kDisableWebRtcEncryption, 2613 switches::kDisableWebRtcEncryption,
2594 }; 2614 };
2595 to_command_line->CopySwitchesFrom(from_command_line, 2615 to_command_line->CopySwitchesFrom(from_command_line,
2596 kWebRtcDevSwitchNames, 2616 kWebRtcDevSwitchNames,
2597 arraysize(kWebRtcDevSwitchNames)); 2617 arraysize(kWebRtcDevSwitchNames));
2598 } 2618 }
2599 } 2619 }
2600 #endif // defined(ENABLE_WEBRTC) 2620 #endif // defined(ENABLE_WEBRTC)
2601 2621
2602 } // namespace chrome 2622 } // namespace chrome
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | content/DEPS » ('j') | gin/isolate_holder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698