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

Side by Side Diff: Source/bindings/core/v8/V8Initializer.cpp

Issue 464293002: [DevTools] ConsoleMessage storage moved from ConsoleAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@remove-can-generate
Patch Set: Created 6 years, 3 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/core/core.gypi » ('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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // If called during context initialization, there will be no entered window. 97 // If called during context initialization, there will be no entered window.
98 LocalDOMWindow* enteredWindow = enteredDOMWindow(isolate); 98 LocalDOMWindow* enteredWindow = enteredDOMWindow(isolate);
99 if (!enteredWindow || !enteredWindow->isCurrentlyDisplayedInFrame()) 99 if (!enteredWindow || !enteredWindow->isCurrentlyDisplayedInFrame())
100 return; 100 return;
101 101
102 String errorMessage = toCoreString(message->Get()); 102 String errorMessage = toCoreString(message->Get());
103 103
104 v8::Handle<v8::StackTrace> stackTrace = message->GetStackTrace(); 104 v8::Handle<v8::StackTrace> stackTrace = message->GetStackTrace();
105 RefPtrWillBeRawPtr<ScriptCallStack> callStack = nullptr; 105 RefPtrWillBeRawPtr<ScriptCallStack> callStack = nullptr;
106 // Currently stack trace is only collected when inspector is open. 106 // Currently stack trace is only collected when inspector is open.
107 if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) 107 if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) {
108 callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallSt ackSizeToCapture, isolate); 108 callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallSt ackSizeToCapture, isolate);
109 } else {
110 Vector<ScriptCallFrame> callFrames;
111 callStack = ScriptCallStack::create(callFrames);
112 }
109 113
110 v8::Handle<v8::Value> resourceName = message->GetScriptOrigin().ResourceName (); 114 v8::Handle<v8::Value> resourceName = message->GetScriptOrigin().ResourceName ();
111 bool shouldUseDocumentURL = resourceName.IsEmpty() || !resourceName->IsStrin g(); 115 bool shouldUseDocumentURL = resourceName.IsEmpty() || !resourceName->IsStrin g();
112 String resource = shouldUseDocumentURL ? enteredWindow->document()->url() : toCoreString(resourceName.As<v8::String>()); 116 String resource = shouldUseDocumentURL ? enteredWindow->document()->url() : toCoreString(resourceName.As<v8::String>());
113 AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCr ossOrigin : NotSharableCrossOrigin; 117 AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCr ossOrigin : NotSharableCrossOrigin;
114 118
115 ScriptState* scriptState = ScriptState::current(isolate); 119 ScriptState* scriptState = ScriptState::current(isolate);
116 RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, reso urce, message->GetLineNumber(), message->GetStartColumn() + 1, &scriptState->wor ld()); 120 RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, reso urce, message->GetLineNumber(), message->GetStartColumn() + 1, &scriptState->wor ld());
117 if (V8DOMWrapper::isDOMWrapper(data)) { 121 if (V8DOMWrapper::isDOMWrapper(data)) {
118 v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data); 122 v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 v8::V8::AddMessageListener(messageHandlerInWorker); 263 v8::V8::AddMessageListener(messageHandlerInWorker);
260 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); 264 v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker);
261 265
262 v8::ResourceConstraints resourceConstraints; 266 v8::ResourceConstraints resourceConstraints;
263 uint32_t here; 267 uint32_t here;
264 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin t32_t*)); 268 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin t32_t*));
265 v8::SetResourceConstraints(isolate, &resourceConstraints); 269 v8::SetResourceConstraints(isolate, &resourceConstraints);
266 } 270 }
267 271
268 } // namespace blink 272 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698