source_map.h 850 B

1234567891011121314151617181920212223242526272829
  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. #ifndef EXTENSIONS_RENDERER_SOURCE_MAP_H_
  5. #define EXTENSIONS_RENDERER_SOURCE_MAP_H_
  6. #include <string>
  7. #include "v8/include/v8-forward.h"
  8. namespace extensions {
  9. // A map storing resources associated with a given API or utility.
  10. class SourceMap {
  11. public:
  12. virtual ~SourceMap() {}
  13. // Gets the source for the given resource name.
  14. virtual v8::Local<v8::String> GetSource(v8::Isolate* isolate,
  15. const std::string& name) const = 0;
  16. // Returns true if the map contains an entry for the given |name|.
  17. virtual bool Contains(const std::string& name) const = 0;
  18. };
  19. } // namespace extensions
  20. #endif // EXTENSIONS_RENDERER_SOURCE_MAP_H_