electron/atom/browser/api/atom_api_web_request.h

46 lines
1.2 KiB
C
Raw Normal View History

2015-12-01 10:22:22 +05:30
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_WEB_REQUEST_H_
#define ATOM_BROWSER_API_ATOM_API_WEB_REQUEST_H_
2015-12-04 03:54:26 +05:30
#include "atom/browser/api/trackable_object.h"
2015-12-01 10:22:22 +05:30
#include "atom/browser/net/atom_network_delegate.h"
#include "native_mate/arguments.h"
2015-12-04 03:54:26 +05:30
#include "native_mate/handle.h"
2015-12-01 10:22:22 +05:30
namespace atom {
class AtomBrowserContext;
namespace api {
2015-12-04 03:54:26 +05:30
class WebRequest : public mate::TrackableObject<WebRequest> {
2015-12-01 10:22:22 +05:30
public:
static mate::Handle<WebRequest> Create(v8::Isolate* isolate,
2015-12-10 00:46:03 +05:30
AtomBrowserContext* browser_context);
2015-12-01 10:22:22 +05:30
// mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
explicit WebRequest(AtomBrowserContext* browser_context);
~WebRequest();
2015-12-11 20:11:22 +08:00
template<AtomNetworkDelegate::EventType Event>
2015-12-01 10:22:22 +05:30
void SetListener(mate::Arguments* args);
private:
scoped_refptr<AtomBrowserContext> browser_context_;
DISALLOW_COPY_AND_ASSIGN(WebRequest);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_WEB_REQUEST_H_