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

Side by Side Diff: include/v8.h

Issue 29053002: Provide a mechanism for the embedder to set a TotalPhysicalMemory callback function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
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 3826 matching lines...) Expand 10 before | Expand all | Expand 10 after
3837 enum AllocationAction { 3837 enum AllocationAction {
3838 kAllocationActionAllocate = 1 << 0, 3838 kAllocationActionAllocate = 1 << 0,
3839 kAllocationActionFree = 1 << 1, 3839 kAllocationActionFree = 1 << 1,
3840 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree 3840 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
3841 }; 3841 };
3842 3842
3843 typedef void (*MemoryAllocationCallback)(ObjectSpace space, 3843 typedef void (*MemoryAllocationCallback)(ObjectSpace space,
3844 AllocationAction action, 3844 AllocationAction action,
3845 int size); 3845 int size);
3846 3846
3847 typedef uint64_t (*TotalPhysicalMemoryCallback)();
3848
3847 // --- Leave Script Callback --- 3849 // --- Leave Script Callback ---
3848 typedef void (*CallCompletedCallback)(); 3850 typedef void (*CallCompletedCallback)();
3849 3851
3850 // --- Failed Access Check Callback --- 3852 // --- Failed Access Check Callback ---
3851 typedef void (*FailedAccessCheckCallback)(Local<Object> target, 3853 typedef void (*FailedAccessCheckCallback)(Local<Object> target,
3852 AccessType type, 3854 AccessType type,
3853 Local<Value> data); 3855 Local<Value> data);
3854 3856
3855 // --- AllowCodeGenerationFromStrings callbacks --- 3857 // --- AllowCodeGenerationFromStrings callbacks ---
3856 3858
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
4460 4462
4461 /** 4463 /**
4462 * Enables the host application to provide a mechanism for recording 4464 * Enables the host application to provide a mechanism for recording
4463 * histograms. The CreateHistogram function returns a 4465 * histograms. The CreateHistogram function returns a
4464 * histogram which will later be passed to the AddHistogramSample 4466 * histogram which will later be passed to the AddHistogramSample
4465 * function. 4467 * function.
4466 */ 4468 */
4467 static void SetCreateHistogramFunction(CreateHistogramCallback); 4469 static void SetCreateHistogramFunction(CreateHistogramCallback);
4468 static void SetAddHistogramSampleFunction(AddHistogramSampleCallback); 4470 static void SetAddHistogramSampleFunction(AddHistogramSampleCallback);
4469 4471
4470 /** Callback function for reporting failed access checks.*/ 4472 /** Callback function for reporting failed access checks. */
4471 static void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback); 4473 static void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback);
4472 4474
4473 /** 4475 /**
4476 * Enables the host application to provide a function which returns the total
4477 * amount of physical memory available on the platform.
4478 */
4479 static void SetTotalPhysicalMemoryFunction(TotalPhysicalMemoryCallback);
4480
4481 /**
4474 * Enables the host application to receive a notification before a 4482 * Enables the host application to receive a notification before a
4475 * garbage collection. Allocations are not allowed in the 4483 * garbage collection. Allocations are not allowed in the
4476 * callback function, you therefore cannot manipulate objects (set 4484 * callback function, you therefore cannot manipulate objects (set
4477 * or delete properties for example) since it is possible such 4485 * or delete properties for example) since it is possible such
4478 * operations will result in the allocation of objects. It is possible 4486 * operations will result in the allocation of objects. It is possible
4479 * to specify the GCType filter for your callback. But it is not possible to 4487 * to specify the GCType filter for your callback. But it is not possible to
4480 * register the same callback function two times with different 4488 * register the same callback function two times with different
4481 * GCType filters. 4489 * GCType filters.
4482 */ 4490 */
4483 static void AddGCPrologueCallback( 4491 static void AddGCPrologueCallback(
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
6457 */ 6465 */
6458 6466
6459 6467
6460 } // namespace v8 6468 } // namespace v8
6461 6469
6462 6470
6463 #undef TYPE_CHECK 6471 #undef TYPE_CHECK
6464 6472
6465 6473
6466 #endif // V8_H_ 6474 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698