Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/GlobalJsObject.cpp

Issue 10169005: Windows specific changes. All tests passing on Windows. (Closed)
Patch Set: Comments address. WIN32 in #ifdef and whitespace Created April 10, 2013, 7:55 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <vector> 1 #include <vector>
2 #include <stdexcept> 2 #include <stdexcept>
3 3
4 #include "GlobalJsObject.h" 4 #include "GlobalJsObject.h"
5 #include "Thread.h" 5 #include "Thread.h"
6 6
7 using namespace AdblockPlus; 7 using namespace AdblockPlus;
8 8
9 namespace 9 namespace
10 { 10 {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 for (Values::iterator it = functionArguments.begin(); 43 for (Values::iterator it = functionArguments.begin();
44 it != functionArguments.end(); it++) 44 it != functionArguments.end(); it++)
45 it->Dispose(isolate); 45 it->Dispose(isolate);
46 } 46 }
47 47
48 void Run() 48 void Run()
49 { 49 {
50 Sleep(delay); 50 Sleep(delay);
51 const v8::Locker locker(isolate); 51 const v8::Locker locker(isolate);
52 const v8::HandleScope handleScope; 52 const v8::HandleScope handleScope;
53 v8::Handle<v8::Value> *argv = functionArguments.empty() ? 0 : &(functionAr guments.front()); 53 v8::Handle<v8::Value>* argv = functionArguments.empty() ? 0 : &(functionAr guments.front());
54 function->Call(function, functionArguments.size(), argv); 54 function->Call(function, functionArguments.size(), argv);
55 delete this; 55 delete this;
56 } 56 }
57 57
58 private: 58 private:
59 typedef v8::Persistent<v8::Value> Value; 59 typedef v8::Persistent<v8::Value> Value;
60 typedef std::vector<Value> Values; 60 typedef std::vector<Value> Values;
61 61
62 v8::Isolate* const isolate; 62 v8::Isolate* const isolate;
63 v8::Persistent<v8::Function> function; 63 v8::Persistent<v8::Function> function;
(...skipping 28 matching lines...) Expand all
92 v8::HandleScope handleScope; 92 v8::HandleScope handleScope;
93 const v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); 93 const v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
94 const v8::Handle<v8::ObjectTemplate> console = 94 const v8::Handle<v8::ObjectTemplate> console =
95 AdblockPlus::ConsoleJsObject::Create(errorCallback); 95 AdblockPlus::ConsoleJsObject::Create(errorCallback);
96 global->Set(v8::String::New("console"), console); 96 global->Set(v8::String::New("console"), console);
97 const v8::Handle<v8::FunctionTemplate> setTimeoutFunction = 97 const v8::Handle<v8::FunctionTemplate> setTimeoutFunction =
98 v8::FunctionTemplate::New(SetTimeoutCallback); 98 v8::FunctionTemplate::New(SetTimeoutCallback);
99 global->Set(v8::String::New("setTimeout"), setTimeoutFunction); 99 global->Set(v8::String::New("setTimeout"), setTimeoutFunction);
100 return handleScope.Close(global); 100 return handleScope.Close(global);
101 } 101 }
OLDNEW
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld