forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move setup of code event handlers to gin
This will make sure that the handlers are set at the correct point during v8::Isolate construction BUG=none R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/567343002 Cr-Commit-Position: refs/heads/master@{#295066}
- Loading branch information
Showing
8 changed files
with
105 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2014 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. | ||
|
||
#include "gin/debug_impl.h" | ||
|
||
namespace gin { | ||
|
||
namespace { | ||
v8::FunctionEntryHook g_entry_hook = NULL; | ||
v8::JitCodeEventHandler g_jit_code_event_handler = NULL; | ||
} // namespace | ||
|
||
// static | ||
void Debug::SetFunctionEntryHook(v8::FunctionEntryHook entry_hook) { | ||
g_entry_hook = entry_hook; | ||
} | ||
|
||
// static | ||
void Debug::SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler) { | ||
g_jit_code_event_handler = event_handler; | ||
} | ||
|
||
// static | ||
v8::FunctionEntryHook DebugImpl::GetFunctionEntryHook() { | ||
return g_entry_hook; | ||
} | ||
|
||
// static | ||
v8::JitCodeEventHandler DebugImpl::GetJitCodeEventHandler() { | ||
return g_jit_code_event_handler; | ||
} | ||
|
||
} // namespace gin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2014 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 GIN_PUBLIC_DEBUG_IMPL_H_ | ||
#define GIN_PUBLIC_DEBUG_IMPL_H_ | ||
|
||
#include "gin/public/debug.h" | ||
#include "v8/include/v8.h" | ||
|
||
namespace gin { | ||
|
||
class DebugImpl { | ||
public: | ||
static v8::FunctionEntryHook GetFunctionEntryHook(); | ||
static v8::JitCodeEventHandler GetJitCodeEventHandler(); | ||
}; | ||
|
||
} // namespace gin | ||
|
||
#endif // GIN_PUBLIC_DEBUG_IMPL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2014 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 GIN_PUBLIC_DEBUG_H_ | ||
#define GIN_PUBLIC_DEBUG_H_ | ||
|
||
#include "gin/gin_export.h" | ||
#include "v8/include/v8.h" | ||
|
||
namespace gin { | ||
|
||
class GIN_EXPORT Debug { | ||
public: | ||
/* Installs a callback that is invoked on entry to every V8-generated | ||
* function. | ||
* | ||
* This only affects IsolateHolder instances created after | ||
* SetFunctionEntryHook was invoked. | ||
*/ | ||
static void SetFunctionEntryHook(v8::FunctionEntryHook entry_hook); | ||
|
||
/* Installs a callback that is invoked each time jit code is added, moved, | ||
* or removed. | ||
* | ||
* This only affects IsolateHolder instances created after | ||
* SetJitCodeEventHandler was invoked. | ||
*/ | ||
static void SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler); | ||
}; | ||
|
||
} // namespace gin | ||
|
||
#endif // GIN_PUBLIC_DEBUG_H_ |