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

Unified Diff: net/proxy/proxy_resolver_v8.h

Issue 227233006: Make net use v8 through gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/proxy/proxy_resolver_v8.h
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h
index 9c34e25f696fd348d496be200a4cc49cdc9b0038..c754e311247220be59376b54b864377f45d12f10 100644
--- a/net/proxy/proxy_resolver_v8.h
+++ b/net/proxy/proxy_resolver_v8.h
@@ -10,6 +10,10 @@
#include "net/base/net_export.h"
#include "net/proxy/proxy_resolver.h"
+namespace gin {
+class IsolateHolder;
+} // namespace gin
+
namespace v8 {
class HeapStatistics;
class Isolate;
@@ -90,18 +94,10 @@ class NET_EXPORT_PRIVATE ProxyResolverV8 : public ProxyResolver {
const scoped_refptr<ProxyResolverScriptData>& script_data,
const net::CompletionCallback& /*callback*/) OVERRIDE;
- // Remember the default Isolate, must be called from the main thread. This
- // hack can be removed when the "default Isolate" concept is gone.
- static void RememberDefaultIsolate();
-
-#if defined(OS_WIN)
- // Create an isolate to use for the proxy resolver. Until the "default
- // Isolate" concept is gone, it is preferable to invoke
- // RememberDefaultIsolate() as creating a new Isolate in additional to the
- // default Isolate will waste a few MB of memory and the runtime it took to
- // create the default Isolate.
- static void CreateIsolate();
-#endif
+ // Create an isolate to use for the proxy resolver. If the embedder invokes
+ // this method multiple times, it must be invoked in a thread safe manner,
+ // e.g. always from the same thread.
+ static void EnsureIsolateCreated();
static v8::Isolate* GetDefaultIsolate();
@@ -111,7 +107,7 @@ class NET_EXPORT_PRIVATE ProxyResolverV8 : public ProxyResolver {
static size_t GetUsedHeapSize();
private:
- static v8::Isolate* g_default_isolate_;
+ static gin::IsolateHolder* g_proxy_resolver_isolate_;
// Context holds the Javascript state for the most recently loaded PAC
// script. It corresponds with the data from the last call to

Powered by Google App Engine
This is Rietveld 408576698