proxy_resolver_error_observer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (c) 2011 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 NET_PROXY_RESOLUTION_PROXY_RESOLVER_ERROR_OBSERVER_H_
  5. #define NET_PROXY_RESOLUTION_PROXY_RESOLVER_ERROR_OBSERVER_H_
  6. #include <string>
  7. #include "net/base/net_export.h"
  8. namespace net {
  9. // Interface for observing JavaScript error messages from PAC scripts.
  10. class NET_EXPORT_PRIVATE ProxyResolverErrorObserver {
  11. public:
  12. ProxyResolverErrorObserver() = default;
  13. ProxyResolverErrorObserver(const ProxyResolverErrorObserver&) = delete;
  14. ProxyResolverErrorObserver& operator=(const ProxyResolverErrorObserver&) =
  15. delete;
  16. virtual ~ProxyResolverErrorObserver() = default;
  17. // Handler for when an error is encountered. |line_number| may be -1
  18. // if a line number is not applicable to this error. |error| is a message
  19. // describing the error.
  20. //
  21. // Note on threading: This may get called from a worker thread. If the
  22. // backing proxy resolver is ProxyResolverV8Tracing, then it will not
  23. // be called concurrently, however it will be called from a different
  24. // thread than the proxy resolver's origin thread.
  25. virtual void OnPACScriptError(int line_number,
  26. const std::u16string& error) = 0;
  27. };
  28. } // namespace net
  29. #endif // NET_PROXY_RESOLUTION_PROXY_RESOLVER_ERROR_OBSERVER_H_