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

Side by Side Diff: gin/per_isolate_data.cc

Issue 2624033002: Tolerate a null WebScheduler in utility process V8 initialization (Closed)
Patch Set: . Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp » ('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"
(...skipping 11 matching lines...) Expand all
22 namespace gin { 22 namespace gin {
23 23
24 PerIsolateData::PerIsolateData( 24 PerIsolateData::PerIsolateData(
25 Isolate* isolate, 25 Isolate* isolate,
26 ArrayBuffer::Allocator* allocator, 26 ArrayBuffer::Allocator* allocator,
27 IsolateHolder::AccessMode access_mode, 27 IsolateHolder::AccessMode access_mode,
28 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 28 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
29 : isolate_(isolate), 29 : isolate_(isolate),
30 allocator_(allocator), 30 allocator_(allocator),
31 access_mode_(access_mode), 31 access_mode_(access_mode),
32 task_runner_(task_runner) { 32 task_runner_(
33 task_runner ? task_runner : base::ThreadTaskRunnerHandle::Get()) {
33 isolate_->SetData(kEmbedderNativeGin, this); 34 isolate_->SetData(kEmbedderNativeGin, this);
34 } 35 }
35 36
36 PerIsolateData::~PerIsolateData() { 37 PerIsolateData::~PerIsolateData() {
37 isolate_->SetData(kEmbedderNativeGin, NULL); 38 isolate_->SetData(kEmbedderNativeGin, NULL);
38 } 39 }
39 40
40 PerIsolateData* PerIsolateData::From(Isolate* isolate) { 41 PerIsolateData* PerIsolateData::From(Isolate* isolate) {
41 return static_cast<PerIsolateData*>(isolate->GetData(kEmbedderNativeGin)); 42 return static_cast<PerIsolateData*>(isolate->GetData(kEmbedderNativeGin));
42 } 43 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 else 117 else
117 return NULL; 118 return NULL;
118 } 119 }
119 120
120 void PerIsolateData::EnableIdleTasks( 121 void PerIsolateData::EnableIdleTasks(
121 std::unique_ptr<V8IdleTaskRunner> idle_task_runner) { 122 std::unique_ptr<V8IdleTaskRunner> idle_task_runner) {
122 idle_task_runner_ = std::move(idle_task_runner); 123 idle_task_runner_ = std::move(idle_task_runner);
123 } 124 }
124 125
125 } // namespace gin 126 } // namespace gin
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698