blob: 2dd8e9d4525b80ec364e44cfea9eb47a7b0e6ba7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_RENDERER_GET_SCRIPT_CONTEXT_H_
#define EXTENSIONS_RENDERER_GET_SCRIPT_CONTEXT_H_
#include "v8/include/v8.h"
namespace extensions {
class ScriptContext;
// TODO(devlin): This is a very random place for these. But there's not really
// a better one - ScriptContextSet is (currently) thread-agnostic, and it'd be
// nice to avoid changing that.
// Returns the ScriptContext associated with the given v8::Context. This is
// designed to work for both main thread and worker thread contexts.
ScriptContext* GetScriptContextFromV8Context(v8::Local<v8::Context> context);
// Same as above, but CHECK()s the result before returning.
ScriptContext* GetScriptContextFromV8ContextChecked(
v8::Local<v8::Context> context);
} // namespace extensions
#endif // EXTENSIONS_RENDERER_GET_SCRIPT_CONTEXT_H_
|