flutter_flutter/engine/tonic/dart_class_library.cc
Adam Barth d8d7db82a0 Really remove config.h
This CL generated by |sed -i '/sky\/engine\/config.h/d'| and a manual sweep to
catch some oddballs.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1206763002.
2015-06-23 23:15:28 -07:00

34 lines
1018 B
C++

// Copyright 2015 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 "sky/engine/tonic/dart_class_library.h"
#include "base/logging.h"
#include "sky/engine/tonic/dart_wrapper_info.h"
namespace blink {
DartClassLibrary::DartClassLibrary() : provider_(nullptr) {
}
DartClassLibrary::~DartClassLibrary() {
// Note that we don't need to delete these persistent handles because this
// object lives as long as the isolate. The handles will get deleted when the
// isolate dies.
}
Dart_PersistentHandle DartClassLibrary::GetClass(const DartWrapperInfo& info) {
DCHECK(provider_);
const auto& result = cache_.add(&info, nullptr);
if (!result.isNewEntry)
return result.storedValue->value;
Dart_Handle class_handle = provider_->GetClassByName(info.interface_name);
result.storedValue->value = Dart_NewPersistentHandle(class_handle);
return result.storedValue->value;
}
} // namespace blink