Skip to content

Commit

Permalink
deps: cherry-pick 98c40a4bae915 from V8 upstream
Browse files Browse the repository at this point in the history
Original commit message:

    [platform] Return task runners as shared_ptr

    At the moment, task runners are returned as unique_ptr. This is
    inconvenient, however. In all implementations I did, the platform holds
    a shared pointer of the task runner and wraps it in a wrapper class just
    to return it as a unique_ptr. With this CL the platform API is changed
    to return a shared_ptr directly.

    [email protected]

    Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
    Change-Id: Ide278db855199ea239ad0ae14d97fd17349dac8c
    Reviewed-on: https://chromium-review.googlesource.com/768867
    Commit-Queue: Andreas Haas <[email protected]>
    Reviewed-by: Ross McIlroy <[email protected]>
    Cr-Commit-Position: refs/heads/master@{#49366}

Refs: v8/v8@98c40a4

PR-URL: #17134
Fixes: nodejs/node-v8#24
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and jasnell committed Nov 21, 2017
1 parent 5d35a1a commit 2540e3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps/v8/include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class Platform {
* Returns a TaskRunner which can be used to post a task on the foreground.
* This function should only be called from a foreground thread.
*/
virtual std::unique_ptr<v8::TaskRunner> GetForegroundTaskRunner(
virtual std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner(
Isolate* isolate) {
// TODO(ahaas): Make this function abstract after it got implemented on all
// platforms.
Expand All @@ -210,7 +210,7 @@ class Platform {
* Returns a TaskRunner which can be used to post a task on a background.
* This function should only be called from a foreground thread.
*/
virtual std::unique_ptr<v8::TaskRunner> GetBackgroundTaskRunner(
virtual std::shared_ptr<v8::TaskRunner> GetBackgroundTaskRunner(
Isolate* isolate) {
// TODO(ahaas): Make this function abstract after it got implemented on all
// platforms.
Expand Down

0 comments on commit 2540e3d

Please sign in to comment.