native_handler.cc 560 B

123456789101112131415161718192021222324
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "extensions/renderer/native_handler.h"
  5. #include <ostream>
  6. #include "base/check.h"
  7. namespace extensions {
  8. NativeHandler::NativeHandler() : is_valid_(true) {}
  9. NativeHandler::~NativeHandler() {
  10. CHECK(!is_valid_) << "NativeHandlers must be invalidated before destruction";
  11. }
  12. void NativeHandler::Invalidate() {
  13. CHECK(is_valid_);
  14. is_valid_ = false;
  15. }
  16. } // namespace extensions