net_module.cc 596 B

1234567891011121314151617181920212223
  1. // Copyright (c) 2006-2008 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 "net/base/net_module.h"
  5. #include "base/memory/ref_counted_memory.h"
  6. namespace net {
  7. static NetModule::ResourceProvider resource_provider;
  8. // static
  9. void NetModule::SetResourceProvider(ResourceProvider func) {
  10. resource_provider = func;
  11. }
  12. // static
  13. scoped_refptr<base::RefCountedMemory> NetModule::GetResource(int key) {
  14. return resource_provider ? resource_provider(key) : nullptr;
  15. }
  16. } // namespace net