Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Side by Side Diff: webkit/chaos/V8CustomChaosPositionCallback.cpp

Issue 160084: Chaos geolocation demo, non-WebKit part. Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/chaos/V8CustomChaosPositionCallback.h ('k') | webkit/glue/chrome_client_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #include "config.h"
2
3 #include "V8CustomChaosPositionCallback.h"
4 #include "V8CustomVoidCallback.h"
5 #include "V8Index.h"
6 #include "V8Proxy.h"
7
8 #include "Frame.h"
9
10 namespace WebCore {
11
12 V8CustomChaosPositionCallback::V8CustomChaosPositionCallback(Frame *frame, v8::L ocal<v8::Object> callback)
13 : callback_(v8::Persistent<v8::Object>::New(callback)), frame_(frame) {
14 }
15
16 void V8CustomChaosPositionCallback::handleEvent(ChaosGeoposition* position) {
17 // Boilerplate lifted from V8CustomSQLTransactionCallback.cpp
18 v8::HandleScope handleScope;
19
20 v8::Handle<v8::Context> context = V8Proxy::context(frame_.get());
21 if (context.IsEmpty())
22 return;
23
24 v8::Context::Scope scope(context);
25 // end of boilerplate
26
27 v8::Handle<v8::Value> argv[] = {
28 V8DOMWrapper::convertToV8Object(V8ClassIndex::CHAOSGEOPOSITION, position)
29 };
30 bool callbackReturnValue = false;
31 bool raisedException
32 = invokeCallback(callback_, 1, argv, callbackReturnValue);
33 }
34
35 } // namespace WebCore
OLDNEW
« no previous file with comments | « webkit/chaos/V8CustomChaosPositionCallback.h ('k') | webkit/glue/chrome_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698