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

Side by Side Diff: src/api.cc

Issue 78453003: Reland r17877 - Introduce a v8::Platform class that bundles embedder callbacks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 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 | Annotate | Revision Log
« no previous file with comments | « include/v8-platform.h ('k') | src/default-platform.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 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5027 matching lines...) Expand 10 before | Expand all | Expand 10 after
5038 // Obscure semantics for undefined, but somehow checked in our unit tests... 5038 // Obscure semantics for undefined, but somehow checked in our unit tests...
5039 if (obj->IsUndefined()) return NULL; 5039 if (obj->IsUndefined()) return NULL;
5040 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0); 5040 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0);
5041 return i::Foreign::cast(foreign)->foreign_address(); 5041 return i::Foreign::cast(foreign)->foreign_address();
5042 } 5042 }
5043 5043
5044 5044
5045 // --- E n v i r o n m e n t --- 5045 // --- E n v i r o n m e n t ---
5046 5046
5047 5047
5048 void v8::V8::InitializePlatform(Platform* platform) {
5049 #ifdef V8_USE_DEFAULT_PLATFORM
5050 FATAL("Can't override v8::Platform when using default implementation");
5051 #else
5052 i::V8::InitializePlatform(platform);
5053 #endif
5054 }
5055
5056
5057 void v8::V8::ShutdownPlatform() {
5058 #ifdef V8_USE_DEFAULT_PLATFORM
5059 FATAL("Can't override v8::Platform when using default implementation");
5060 #else
5061 i::V8::ShutdownPlatform();
5062 #endif
5063 }
5064
5065
5048 bool v8::V8::Initialize() { 5066 bool v8::V8::Initialize() {
5049 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 5067 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
5050 if (isolate != NULL && isolate->IsInitialized()) { 5068 if (isolate != NULL && isolate->IsInitialized()) {
5051 return true; 5069 return true;
5052 } 5070 }
5053 return InitializeHelper(isolate); 5071 return InitializeHelper(isolate);
5054 } 5072 }
5055 5073
5056 5074
5057 void v8::V8::SetEntropySource(EntropySource entropy_source) { 5075 void v8::V8::SetEntropySource(EntropySource entropy_source) {
(...skipping 2602 matching lines...) Expand 10 before | Expand all | Expand 10 after
7660 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7678 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7661 Address callback_address = 7679 Address callback_address =
7662 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7680 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7663 VMState<EXTERNAL> state(isolate); 7681 VMState<EXTERNAL> state(isolate);
7664 ExternalCallbackScope call_scope(isolate, callback_address); 7682 ExternalCallbackScope call_scope(isolate, callback_address);
7665 callback(info); 7683 callback(info);
7666 } 7684 }
7667 7685
7668 7686
7669 } } // namespace v8::internal 7687 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-platform.h ('k') | src/default-platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698