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

Side by Side Diff: gin/per_isolate_data.cc

Issue 2478813002: When an Isolate is configured to use lockers, foreground tasks need to lock (Closed)
Patch Set: updates Created 4 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
« no previous file with comments | « gin/per_isolate_data.h ('k') | gin/v8_platform.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gin/per_isolate_data.h" 5 #include "gin/per_isolate_data.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/threading/thread_task_runner_handle.h" 11 #include "base/threading/thread_task_runner_handle.h"
12 #include "gin/public/gin_embedders.h" 12 #include "gin/public/gin_embedders.h"
13 13
14 using v8::ArrayBuffer; 14 using v8::ArrayBuffer;
15 using v8::Eternal; 15 using v8::Eternal;
16 using v8::Isolate; 16 using v8::Isolate;
17 using v8::Local; 17 using v8::Local;
18 using v8::Object; 18 using v8::Object;
19 using v8::FunctionTemplate; 19 using v8::FunctionTemplate;
20 using v8::ObjectTemplate; 20 using v8::ObjectTemplate;
21 21
22 namespace gin { 22 namespace gin {
23 23
24 PerIsolateData::PerIsolateData(Isolate* isolate, 24 PerIsolateData::PerIsolateData(Isolate* isolate,
25 ArrayBuffer::Allocator* allocator) 25 ArrayBuffer::Allocator* allocator,
26 IsolateHolder::AccessMode access_mode)
26 : isolate_(isolate), 27 : isolate_(isolate),
27 allocator_(allocator), 28 allocator_(allocator),
29 access_mode_(access_mode),
28 task_runner_(base::ThreadTaskRunnerHandle::Get()) { 30 task_runner_(base::ThreadTaskRunnerHandle::Get()) {
29 isolate_->SetData(kEmbedderNativeGin, this); 31 isolate_->SetData(kEmbedderNativeGin, this);
30 } 32 }
31 33
32 PerIsolateData::~PerIsolateData() { 34 PerIsolateData::~PerIsolateData() {
33 isolate_->SetData(kEmbedderNativeGin, NULL); 35 isolate_->SetData(kEmbedderNativeGin, NULL);
34 } 36 }
35 37
36 PerIsolateData* PerIsolateData::From(Isolate* isolate) { 38 PerIsolateData* PerIsolateData::From(Isolate* isolate) {
37 return static_cast<PerIsolateData*>(isolate->GetData(kEmbedderNativeGin)); 39 return static_cast<PerIsolateData*>(isolate->GetData(kEmbedderNativeGin));
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 else 114 else
113 return NULL; 115 return NULL;
114 } 116 }
115 117
116 void PerIsolateData::EnableIdleTasks( 118 void PerIsolateData::EnableIdleTasks(
117 std::unique_ptr<V8IdleTaskRunner> idle_task_runner) { 119 std::unique_ptr<V8IdleTaskRunner> idle_task_runner) {
118 idle_task_runner_ = std::move(idle_task_runner); 120 idle_task_runner_ = std::move(idle_task_runner);
119 } 121 }
120 122
121 } // namespace gin 123 } // namespace gin
OLDNEW
« no previous file with comments | « gin/per_isolate_data.h ('k') | gin/v8_platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698