#include <stdlib.h>
#include <string.h>
#include <map>
#include <string>
#include "include/libplatform/libplatform.h"
#include "include/v8-array-buffer.h"
#include "include/v8-context.h"
#include "include/v8-exception.h"
#include "include/v8-external.h"
#include "include/v8-function.h"
#include "include/v8-initialization.h"
#include "include/v8-isolate.h"
#include "include/v8-local-handle.h"
#include "include/v8-object.h"
#include "include/v8-persistent-handle.h"
#include "include/v8-primitive.h"
#include "include/v8-script.h"
#include "include/v8-snapshot.h"
#include "include/v8-template.h"
#include "include/v8-value.h"
map;
pair;
string;
Context;
EscapableHandleScope;
External;
Function;
FunctionTemplate;
Global;
HandleScope;
Isolate;
Local;
MaybeLocal;
Name;
NamedPropertyHandlerConfiguration;
NewStringType;
Object;
ObjectTemplate;
PropertyCallbackInfo;
Script;
String;
TryCatch;
Value;
class HttpRequest { … };
class HttpRequestProcessor { … };
class JsHttpRequestProcessor : public HttpRequestProcessor { … };
static void LogCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { … }
bool JsHttpRequestProcessor::Initialize(map<string, string>* opts,
map<string, string>* output) { … }
bool JsHttpRequestProcessor::ExecuteScript(Local<String> script) { … }
bool JsHttpRequestProcessor::InstallMaps(map<string, string>* opts,
map<string, string>* output) { … }
bool JsHttpRequestProcessor::Process(HttpRequest* request) { … }
JsHttpRequestProcessor::~JsHttpRequestProcessor() { … }
Global<ObjectTemplate> JsHttpRequestProcessor::request_template_;
Global<ObjectTemplate> JsHttpRequestProcessor::map_template_;
Local<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) { … }
map<string, string>* JsHttpRequestProcessor::UnwrapMap(Local<Object> obj) { … }
string ObjectToString(v8::Isolate* isolate, Local<Value> value) { … }
v8::Intercepted JsHttpRequestProcessor::MapGet(
Local<Name> name, const PropertyCallbackInfo<Value>& info) { … }
v8::Intercepted JsHttpRequestProcessor::MapSet(
Local<Name> name, Local<Value> value_obj,
const PropertyCallbackInfo<void>& info) { … }
Local<ObjectTemplate> JsHttpRequestProcessor::MakeMapTemplate(
Isolate* isolate) { … }
Local<Object> JsHttpRequestProcessor::WrapRequest(HttpRequest* request) { … }
HttpRequest* JsHttpRequestProcessor::UnwrapRequest(Local<Object> obj) { … }
void JsHttpRequestProcessor::GetPath(Local<Name> name,
const PropertyCallbackInfo<Value>& info) { … }
void JsHttpRequestProcessor::GetReferrer(
Local<Name> name, const PropertyCallbackInfo<Value>& info) { … }
void JsHttpRequestProcessor::GetHost(Local<Name> name,
const PropertyCallbackInfo<Value>& info) { … }
void JsHttpRequestProcessor::GetUserAgent(
Local<Name> name, const PropertyCallbackInfo<Value>& info) { … }
Local<ObjectTemplate> JsHttpRequestProcessor::MakeRequestTemplate(
Isolate* isolate) { … }
void HttpRequestProcessor::Log(const char* event) { … }
class StringHttpRequest : public HttpRequest { … };
StringHttpRequest::StringHttpRequest(const string& path,
const string& referrer,
const string& host,
const string& user_agent)
: … { … }
void ParseOptions(int argc,
char* argv[],
map<string, string>* options,
string* file) { … }
MaybeLocal<String> ReadFile(Isolate* isolate, const string& name) { … }
const int kSampleSize = …;
StringHttpRequest kSampleRequests[kSampleSize] = …;
bool ProcessEntries(v8::Isolate* isolate, v8::Platform* platform,
HttpRequestProcessor* processor, int count,
StringHttpRequest* reqs) { … }
void PrintMap(map<string, string>* m) { … }
int main(int argc, char* argv[]) { … }