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

Side by Side Diff: Source/WebCore/bindings/v8/V8Proxy.h

Issue 7189061: Merge 89236 - 2011-06-19 Mads Ager <ager@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « no previous file | Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 return v8::Undefined(); 409 return v8::Undefined();
410 } 410 }
411 411
412 inline v8::Handle<v8::Primitive> throwError(v8::Local<v8::Value> exception) 412 inline v8::Handle<v8::Primitive> throwError(v8::Local<v8::Value> exception)
413 { 413 {
414 if (!v8::V8::IsExecutionTerminating()) 414 if (!v8::V8::IsExecutionTerminating())
415 v8::ThrowException(exception); 415 v8::ThrowException(exception);
416 return v8::Undefined(); 416 return v8::Undefined();
417 } 417 }
418 418
419 template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder) 419 enum IndependentMode {
420 MarkIndependent,
421 DoNotMarkIndependent
422 };
423
424 template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder, IndependentMode independent = DoNotMarkIndependent )
420 { 425 {
421 object->ref(); 426 object->ref();
422 V8DOMWrapper::setJSWrapperForDOMObject(object.get(), v8::Persistent<v8:: Object>::New(holder)); 427 v8::Persistent<v8::Object> handle = v8::Persistent<v8::Object>::New(hold er);
428 if (independent == MarkIndependent)
429 handle.MarkIndependent();
430 V8DOMWrapper::setJSWrapperForDOMObject(object.get(), handle);
423 return holder; 431 return holder;
424 } 432 }
425 433
426 } 434 }
427 435
428 #endif // V8Proxy_h 436 #endif // V8Proxy_h
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698