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

Delta Between Two Patch Sets: src/GlobalJsObject.cpp

Issue 10169005: Windows specific changes. All tests passing on Windows. (Closed)
Left Patch Set: Created April 9, 2013, 2:22 a.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include/AdblockPlus/FilterEngine.h ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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.size() > 0 ? functionArgume nts[0] : v8::Handle<v8::Value>(); 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);
Wladimir Palant 2013/04/09 05:47:07 No, this isn't right. You *copy* the first argumen
Oleksandr 2013/04/09 05:54:21 Ah. You're right. My bad. It's not that I *wante
Felix Dahlke 2013/04/09 08:18:06 Ah, just saw the original change here, didn't show
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;
64 int delay; 64 int delay;
(...skipping 27 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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld