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

Side by Side Diff: sky/engine/tonic/dart_state.cc

Issue 1182543002: Remove bogus CHECK in set_isolate. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/tonic/dart_state.h" 6 #include "sky/engine/tonic/dart_state.h"
7 7
8 #include "sky/engine/tonic/dart_class_library.h" 8 #include "sky/engine/tonic/dart_class_library.h"
9 #include "sky/engine/tonic/dart_converter.h" 9 #include "sky/engine/tonic/dart_converter.h"
10 #include "sky/engine/tonic/dart_exception_factory.h" 10 #include "sky/engine/tonic/dart_exception_factory.h"
(...skipping 15 matching lines...) Expand all
26 string_cache_(adoptPtr(new DartStringCache)), 26 string_cache_(adoptPtr(new DartStringCache)),
27 exception_factory_(adoptPtr(new DartExceptionFactory(this))), 27 exception_factory_(adoptPtr(new DartExceptionFactory(this))),
28 timer_heap_(adoptPtr(new DartTimerHeap())), 28 timer_heap_(adoptPtr(new DartTimerHeap())),
29 weak_factory_(this) { 29 weak_factory_(this) {
30 } 30 }
31 31
32 DartState::~DartState() { 32 DartState::~DartState() {
33 } 33 }
34 34
35 void DartState::SetIsolate(Dart_Isolate isolate) { 35 void DartState::SetIsolate(Dart_Isolate isolate) {
36 CHECK(!isolate_);
37 isolate_ = isolate; 36 isolate_ = isolate;
38 if (!isolate_) 37 if (!isolate_)
39 return; 38 return;
40 39
41 { 40 {
42 Scope dart_scope(this); 41 Scope dart_scope(this);
43 index_handle_.Set(this, ToDart("index")); 42 index_handle_.Set(this, ToDart("index"));
44 } 43 }
45 44
46 DidSetIsolate(); 45 DidSetIsolate();
47 } 46 }
48 47
49 DartState* DartState::From(Dart_Isolate isolate) { 48 DartState* DartState::From(Dart_Isolate isolate) {
50 return static_cast<DartState*>(Dart_IsolateData(isolate)); 49 return static_cast<DartState*>(Dart_IsolateData(isolate));
51 } 50 }
52 51
53 DartState* DartState::Current() { 52 DartState* DartState::Current() {
54 return static_cast<DartState*>(Dart_CurrentIsolateData()); 53 return static_cast<DartState*>(Dart_CurrentIsolateData());
55 } 54 }
56 55
57 base::WeakPtr<DartState> DartState::GetWeakPtr() { 56 base::WeakPtr<DartState> DartState::GetWeakPtr() {
58 return weak_factory_.GetWeakPtr(); 57 return weak_factory_.GetWeakPtr();
59 } 58 }
60 59
61 } // namespace blink 60 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698