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

Side by Side Diff: sky/engine/bindings/core/v8/V8Binding.h

Issue 678003003: Begin to remove heap/* (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | sky/engine/bindings/core/v8/V8GCController.cpp » ('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 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 23 matching lines...) Expand all
34 34
35 #include "bindings/core/v8/DOMWrapperWorld.h" 35 #include "bindings/core/v8/DOMWrapperWorld.h"
36 #include "bindings/core/v8/ExceptionMessages.h" 36 #include "bindings/core/v8/ExceptionMessages.h"
37 #include "bindings/core/v8/ScriptValue.h" 37 #include "bindings/core/v8/ScriptValue.h"
38 #include "bindings/core/v8/ScriptWrappable.h" 38 #include "bindings/core/v8/ScriptWrappable.h"
39 #include "bindings/core/v8/V8BindingMacros.h" 39 #include "bindings/core/v8/V8BindingMacros.h"
40 #include "bindings/core/v8/V8PerIsolateData.h" 40 #include "bindings/core/v8/V8PerIsolateData.h"
41 #include "bindings/core/v8/V8StringResource.h" 41 #include "bindings/core/v8/V8StringResource.h"
42 #include "bindings/core/v8/V8ThrowException.h" 42 #include "bindings/core/v8/V8ThrowException.h"
43 #include "bindings/core/v8/V8ValueCache.h" 43 #include "bindings/core/v8/V8ValueCache.h"
44 #include "platform/heap/Heap.h"
45 #include "wtf/GetPtr.h" 44 #include "wtf/GetPtr.h"
46 #include "wtf/MathExtras.h" 45 #include "wtf/MathExtras.h"
47 #include "wtf/text/AtomicString.h" 46 #include "wtf/text/AtomicString.h"
48 #include <v8.h> 47 #include <v8.h>
49 48
50 namespace blink { 49 namespace blink {
51 50
52 class LocalDOMWindow; 51 class LocalDOMWindow;
53 class Document; 52 class Document;
54 class EventListener; 53 class EventListener;
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 PassRefPtr<JSONValue> v8ToJSONValue(v8::Isolate*, v8::Handle<v8::Value>, int); 894 PassRefPtr<JSONValue> v8ToJSONValue(v8::Isolate*, v8::Handle<v8::Value>, int);
896 895
897 // Result values for platform object 'deleter' methods, 896 // Result values for platform object 'deleter' methods,
898 // http://www.w3.org/TR/WebIDL/#delete 897 // http://www.w3.org/TR/WebIDL/#delete
899 enum DeleteResult { 898 enum DeleteResult {
900 DeleteSuccess, 899 DeleteSuccess,
901 DeleteReject, 900 DeleteReject,
902 DeleteUnknownProperty 901 DeleteUnknownProperty
903 }; 902 };
904 903
905 class V8IsolateInterruptor : public ThreadState::Interruptor {
906 public:
907 explicit V8IsolateInterruptor(v8::Isolate* isolate) : m_isolate(isolate) { }
908
909 static void onInterruptCallback(v8::Isolate* isolate, void* data)
910 {
911 reinterpret_cast<V8IsolateInterruptor*>(data)->onInterrupted();
912 }
913
914 virtual void requestInterrupt() override
915 {
916 m_isolate->RequestInterrupt(&onInterruptCallback, this);
917 }
918
919 virtual void clearInterrupt() override
920 {
921 m_isolate->ClearInterrupt();
922 }
923
924 private:
925 v8::Isolate* m_isolate;
926 };
927
928 class V8TestingScope { 904 class V8TestingScope {
929 public: 905 public:
930 explicit V8TestingScope(v8::Isolate*); 906 explicit V8TestingScope(v8::Isolate*);
931 ScriptState* scriptState() const; 907 ScriptState* scriptState() const;
932 v8::Isolate* isolate() const; 908 v8::Isolate* isolate() const;
933 ~V8TestingScope(); 909 ~V8TestingScope();
934 910
935 private: 911 private:
936 v8::HandleScope m_handleScope; 912 v8::HandleScope m_handleScope;
937 v8::Context::Scope m_contextScope; 913 v8::Context::Scope m_contextScope;
(...skipping 12 matching lines...) Expand all
950 m_block.ReThrow(); 926 m_block.ReThrow();
951 } 927 }
952 928
953 private: 929 private:
954 v8::TryCatch& m_block; 930 v8::TryCatch& m_block;
955 }; 931 };
956 932
957 } // namespace blink 933 } // namespace blink
958 934
959 #endif // V8Binding_h 935 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « no previous file | sky/engine/bindings/core/v8/V8GCController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698