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

Side by Side Diff: chrome/plugin/chrome_content_plugin_client.cc

Issue 718453003: Initialize V8 in PDFium from external files (plugin process only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/plugin/chrome_content_plugin_client.h" 5 #include "chrome/plugin/chrome_content_plugin_client.h"
6 6
7 #if defined(ENABLE_REMOTING) 7 #if defined(ENABLE_REMOTING)
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/public/common/content_paths.h" 10 #include "content/public/common/content_paths.h"
11 #include "media/base/media.h" 11 #include "media/base/media.h"
12 #if defined(OS_WIN) 12 #if defined(OS_WIN)
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/native_library.h" 14 #include "base/native_library.h"
15 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) 15 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS)
16 #include "crypto/nss_util.h" 16 #include "crypto/nss_util.h"
17 #endif 17 #endif
18 #endif 18 #endif
19 19
20 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
21 #include "gin/public/isolate_holder.h"
22 #endif
23
20 namespace chrome { 24 namespace chrome {
21 25
22 void ChromeContentPluginClient::PreSandboxInitialization() { 26 void ChromeContentPluginClient::PreSandboxInitialization() {
27 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
raymes 2014/11/11 03:26:39 Should we just bury this #ifdef in gin as well or
baixo1 2014/11/11 10:56:11 +jochen@ LoadV8Snapshot is currently only visible
raymes 2014/11/11 23:02:22 Feel free to do this in a followup CL if it requir
28 gin::IsolateHolder::LoadV8Snapshot();
raymes 2014/11/11 03:26:39 I suggest getting jschuh@ or cpu@ to review this p
baixo1 2014/11/11 10:56:11 +jschuh@ : could you take a look at this, please?
jschuh 2014/11/13 00:13:26 When would this get enabled? I.e. is the V8_USE_EX
29 #endif
30
23 #if defined(ENABLE_REMOTING) 31 #if defined(ENABLE_REMOTING)
24 32
25 // Load crypto libraries for the Chromoting client plugin. 33 // Load crypto libraries for the Chromoting client plugin.
26 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) 34 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS)
27 // On platforms where we use system NSS libraries, the .so's must be loaded 35 // On platforms where we use system NSS libraries, the .so's must be loaded
28 // before the sandbox is initialized. 36 // before the sandbox is initialized.
29 crypto::ForceNSSNoDBInit(); 37 crypto::ForceNSSNoDBInit();
30 crypto::EnsureNSSInit(); 38 crypto::EnsureNSSInit();
31 #elif defined(OS_WIN) 39 #elif defined(OS_WIN)
32 // crypt32.dll is used to decode X509 certificates for Chromoting. 40 // crypt32.dll is used to decode X509 certificates for Chromoting.
33 base::NativeLibraryLoadError error; 41 base::NativeLibraryLoadError error;
34 if (base::LoadNativeLibrary(base::FilePath(L"crypt32.dll"), &error) == NULL) 42 if (base::LoadNativeLibrary(base::FilePath(L"crypt32.dll"), &error) == NULL)
35 LOG(ERROR) << "Failed to load crypto32.dll: " << error.ToString(); 43 LOG(ERROR) << "Failed to load crypto32.dll: " << error.ToString();
36 #endif // defined(OS_WIN) 44 #endif // defined(OS_WIN)
37 45
38 // Load media libraries for the Chromoting client plugin. 46 // Load media libraries for the Chromoting client plugin.
39 base::FilePath media_path; 47 base::FilePath media_path;
40 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); 48 PathService::Get(content::DIR_MEDIA_LIBS, &media_path);
41 if (!media_path.empty()) 49 if (!media_path.empty())
42 media::InitializeMediaLibrary(media_path); 50 media::InitializeMediaLibrary(media_path);
43 51
44 #endif // defined(ENABLE_REMOTING) 52 #endif // defined(ENABLE_REMOTING)
45 } 53 }
46 54
47 } // namespace chrome 55 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/plugin/DEPS ('k') | pdf/out_of_process_instance.cc » ('j') | ppapi/proxy/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698