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

Side by Side Diff: src/api.cc

Issue 2653293003: [inspector] introduced memory size limit for console message storage (Closed)
Patch Set: addressed comments Created 3 years, 11 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 | src/debug/debug-interface.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 9320 matching lines...) Expand 10 before | Expand all | Expand 10 after
9331 v8::Local<debug::Script> script) { 9331 v8::Local<debug::Script> script) {
9332 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); 9332 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
9333 ENTER_V8(isolate); 9333 ENTER_V8(isolate);
9334 i::DisallowHeapAllocation no_gc; 9334 i::DisallowHeapAllocation no_gc;
9335 i::SharedFunctionInfo::ScriptIterator iter(Utils::OpenHandle(*script)); 9335 i::SharedFunctionInfo::ScriptIterator iter(Utils::OpenHandle(*script));
9336 while (i::SharedFunctionInfo* info = iter.Next()) { 9336 while (i::SharedFunctionInfo* info = iter.Next()) {
9337 info->set_computed_debug_is_blackboxed(false); 9337 info->set_computed_debug_is_blackboxed(false);
9338 } 9338 }
9339 } 9339 }
9340 9340
9341 int debug::EstimatedValueSize(Isolate* v8_isolate, v8::Local<v8::Value> value) {
9342 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
9343 ENTER_V8(isolate);
9344 i::Handle<i::Object> object = Utils::OpenHandle(*value);
9345 if (object->IsSmi()) return 4;
ulan 2017/01/30 10:50:25 Smi uses kPointerSize bytes.
kozy 2017/01/30 16:13:07 Done.
9346 if (!object->IsHeapObject()) return 0;
ulan 2017/01/30 10:50:25 This branch is redundant. You can assert here that
kozy 2017/01/30 16:13:07 Done.
9347 return i::Handle<i::HeapObject>::cast(object)->Size();
9348 }
9349
9341 Local<String> CpuProfileNode::GetFunctionName() const { 9350 Local<String> CpuProfileNode::GetFunctionName() const {
9342 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); 9351 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
9343 i::Isolate* isolate = node->isolate(); 9352 i::Isolate* isolate = node->isolate();
9344 const i::CodeEntry* entry = node->entry(); 9353 const i::CodeEntry* entry = node->entry();
9345 i::Handle<i::String> name = 9354 i::Handle<i::String> name =
9346 isolate->factory()->InternalizeUtf8String(entry->name()); 9355 isolate->factory()->InternalizeUtf8String(entry->name());
9347 if (!entry->has_name_prefix()) { 9356 if (!entry->has_name_prefix()) {
9348 return ToApiHandle<String>(name); 9357 return ToApiHandle<String>(name);
9349 } else { 9358 } else {
9350 // We do not expect this to fail. Change this if it does. 9359 // We do not expect this to fail. Change this if it does.
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
10023 Address callback_address = 10032 Address callback_address =
10024 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10033 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10025 VMState<EXTERNAL> state(isolate); 10034 VMState<EXTERNAL> state(isolate);
10026 ExternalCallbackScope call_scope(isolate, callback_address); 10035 ExternalCallbackScope call_scope(isolate, callback_address);
10027 callback(info); 10036 callback(info);
10028 } 10037 }
10029 10038
10030 10039
10031 } // namespace internal 10040 } // namespace internal
10032 } // namespace v8 10041 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698