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

Side by Side Diff: net/test/run_all_unittests.cc

Issue 957933002: Lazily initialize the v8::Isolate used by ProxyResolverV8 (in the browser process). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/metrics/statistics_recorder.h" 5 #include "base/metrics/statistics_recorder.h"
6 #include "base/test/launcher/unit_test_launcher.h" 6 #include "base/test/launcher/unit_test_launcher.h"
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "crypto/nss_util.h" 8 #include "crypto/nss_util.h"
9 #include "net/socket/client_socket_pool_base.h" 9 #include "net/socket/client_socket_pool_base.h"
10 #include "net/socket/ssl_server_socket.h" 10 #include "net/socket/ssl_server_socket.h"
11 #include "net/spdy/spdy_session.h" 11 #include "net/spdy/spdy_session.h"
12 #include "net/test/net_test_suite.h" 12 #include "net/test/net_test_suite.h"
13 13
14 #if defined(OS_ANDROID) 14 #if defined(OS_ANDROID)
15 #include "base/android/jni_android.h" 15 #include "base/android/jni_android.h"
16 #include "base/android/jni_registrar.h" 16 #include "base/android/jni_registrar.h"
17 #include "base/test/test_file_util.h" 17 #include "base/test/test_file_util.h"
18 #include "net/android/net_jni_registrar.h" 18 #include "net/android/net_jni_registrar.h"
19 #include "url/android/url_jni_registrar.h" 19 #include "url/android/url_jni_registrar.h"
20 #endif 20 #endif
21 21
22 #if !defined(OS_IOS)
23 #include "net/proxy/proxy_resolver_v8.h"
24 #endif
25
26 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
27 #include "gin/public/isolate_holder.h"
28 #endif
29
30 #if !defined(OS_ANDROID) && !defined(OS_IOS) 22 #if !defined(OS_ANDROID) && !defined(OS_IOS)
31 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" 23 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h"
32 #endif 24 #endif
33 25
34 using net::internal::ClientSocketPoolBaseHelper; 26 using net::internal::ClientSocketPoolBaseHelper;
35 using net::SpdySession; 27 using net::SpdySession;
36 28
37 int main(int argc, char** argv) { 29 int main(int argc, char** argv) {
38 // Record histograms, so we can get histograms data in tests. 30 // Record histograms, so we can get histograms data in tests.
39 base::StatisticsRecorder::Initialize(); 31 base::StatisticsRecorder::Initialize();
(...skipping 18 matching lines...) Expand all
58 50
59 #if defined(OS_WIN) && !defined(USE_OPENSSL) 51 #if defined(OS_WIN) && !defined(USE_OPENSSL)
60 // We want to be sure to init NSPR on the main thread. 52 // We want to be sure to init NSPR on the main thread.
61 crypto::EnsureNSPRInit(); 53 crypto::EnsureNSPRInit();
62 #endif 54 #endif
63 55
64 // Enable support for SSL server sockets, which must be done while 56 // Enable support for SSL server sockets, which must be done while
65 // single-threaded. 57 // single-threaded.
66 net::EnableSSLServerSockets(); 58 net::EnableSSLServerSockets();
67 59
68 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
69 gin::IsolateHolder::LoadV8Snapshot();
70 #endif
71
72 #if !defined(OS_IOS)
73 net::ProxyResolverV8::EnsureIsolateCreated();
74 #endif
75
76 #if !defined(OS_ANDROID) && !defined(OS_IOS) 60 #if !defined(OS_ANDROID) && !defined(OS_IOS)
77 mojo::embedder::test::InitWithSimplePlatformSupport(); 61 mojo::embedder::test::InitWithSimplePlatformSupport();
78 #endif 62 #endif
79 63
80 return base::LaunchUnitTests( 64 return base::LaunchUnitTests(
81 argc, argv, base::Bind(&NetTestSuite::Run, 65 argc, argv, base::Bind(&NetTestSuite::Run,
82 base::Unretained(&test_suite))); 66 base::Unretained(&test_suite)));
83 } 67 }
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698